Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OerebLex Prebublinks #1617

Closed
michmuel opened this issue Nov 30, 2022 · 4 comments
Closed

OerebLex Prebublinks #1617

michmuel opened this issue Nov 30, 2022 · 4 comments
Assignees

Comments

@michmuel
Copy link
Collaborator

We use OerebLex in BL and will use the OerebLex-"Prepub-Module" for managing the "Laufende Aenderungen". The "prepublinks"-xml differs a bit from the "geolinks"-xml by the attributes of the element "document" (if attribute doctype="prepublication": additional attributes "status", "status_start_date", "status_end_date" but without attributes "municipality", "category", "enactment_date", "abrogation_date", "decree_date").

The mapping of the lexlink information to the document record has to be refined (

def _get_document_records(self, document, language):
). There are also changes required in the geolink_formatter.

I can provide these changes but have to know if someone else is using the OerebLex-Prepub-Module for the "Laufende Aenderungen" to see what are the requirements for a standard mapping.

@michmuel michmuel self-assigned this Nov 30, 2022
@thomasmarti
Copy link
Collaborator

thomasmarti commented Dec 1, 2022

Hi @michmuel
We are also interested in using prebubs. I've tried this just today and got the following error.
Is this the one you'd like to address with this issue?

documents = self._parser.from_url(url, request_params, proxies=self._proxies, auth=self._auth)

  File "/usr/local/lib/python3.9/site-packages/geolink_formatter/parser.py", line 182, in from_url
    return self.from_string(response.content)
  File "/usr/local/lib/python3.9/site-packages/geolink_formatter/parser.py", line 106, in from_string
    root = self._parse_xml(xml)

  File "/usr/local/lib/python3.9/site-packages/geolink_formatter/parser.py", line 83, in _parse_xml
    self._schema.assertValid(content)
	
  File "src/lxml/etree.pyx", line 3640, in lxml.etree._Validator.assertValid
lxml.etree.DocumentInvalid: Element 'prepublinks': No matching global declaration available for the validation root., line 2

@thomasmarti
Copy link
Collaborator

Here is a sample prepub-Link:

https://oereblex.ag.ch/api/prepubs/4504.xml

@michmuel
Copy link
Collaborator Author

michmuel commented Dec 1, 2022

Yes. There are two issues:

First, the xml provided by the prepublink is not valid against the xml schema definition used by the xml format check routine of the geolink_formatter. This causes the error indicated in your post.

Second, the document element in the prepublink does not provide all the attributes expected by the OerebLex source of pyramid_oereb. E.G. there is no attribute "enactment_date" but an attribute "status_start_date". Another question is if the attribute "status" should be used for generating the document title.

I think pyramid oereb should be able to process prepublinks in a general way. More elaborated cantonal rules would require to write and use individual functions.

@michmuel
Copy link
Collaborator Author

Changes in oereblex source implemented. Handling of prepublinks is possible now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants