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

"Constraints related to access and use" error #3

Open
sylar11 opened this issue May 13, 2019 · 2 comments
Open

"Constraints related to access and use" error #3

sylar11 opened this issue May 13, 2019 · 2 comments

Comments

@sylar11
Copy link
Contributor

sylar11 commented May 13, 2019

Hi,
I was trying to get a fully validated ISO 19115 metadata but I was always facing this error
Constraints related to access and use
in all the recent Geonetwork version.

I decided to dig a little bit in XSL file and I probably found the error.
I would like to ask you to check if my suggestion is correct or if I'm misunderstanding something.
Looking at the file
/core-geonetwork/web/src/main/webapp/WEB-INF/data/config/schema_plugins/iso19115-3.2018/schematron/schematron-rules-inspire.xsl
at line 2184 is defined the variable useLimitation_count.

This variable, probably, is not well defined because in my metadata I have two nodes useLimitation_count but if I check the value of the count function it always returns 0.

On the contrary, if I define the variable as follow:

<xsl:variable name="VeB_useLimitation_count" select="count(//mdb:identificationInfo/mri:MD_DataIdentification/mri:resourceConstraints/*/mco:useLimitation/gco:CharacterString/text())"/>
(variable name is a temporary one)

then the error disappears, the count function returns a value different from zero and the metadata ISO19115 is fully validated.

To summarize I will suggest changing this line:

l. 2184 <xsl:variable name="useLimitation_count" select="count(mco:useLimitation/*/text())"/>

with this one

<xsl:variable name="useLimitation_count" select="count(//mdb:identificationInfo/mri:MD_DataIdentification/mri:resourceConstraints/mco:MD_LegalConstraints/mco:useLimitation/gco:CharacterString/text())"/>

If you prefer to not change the variable definition, I guess that at line 2172 and following there are errors in the definition of the Xpath.

In my opinion, the trick could be there too.

Could you please check this my suggestion??

Thanks in advance.

Bartolomeo

@fxprunayre
Copy link
Contributor

Hi, first when you do schematron, you have to deal with *.sch files which are compiled into XSL when the application starts or when using GET /api/0.1/standards/reload in the API.

So your issue is around here https://github.com/metadata101/iso19115-3.2018/blob/3.7.x/src/main/plugin/iso19115-3.2018/schematron/schematron-rules-inspire.sch#L620.

Then indeed, if you record has 2 resource constraints, then the rule is checked on each as defined by the context.

Maybe we should change it and make it similar to the initial one in ISO19139
https://github.com/geonetwork/core-geonetwork/blob/master/schemas/iso19139/src/main/plugin/iso19139/schematron/schematron-rules-inspire.sch#L647-L674

Here the context is Identification and we check that there is at least one non empty useLimitation.

I let you check what is best and make a pull request. Thanks

@sylar11
Copy link
Contributor Author

sylar11 commented May 20, 2019

Thanks a lot for your answer.

Actually, my records have two "mri:resourceConstraints" with at least one mco:useLimitation tag inside, but it is still giving me the same error.

I will check better your suggestion and I will let you know!!

Cheers

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