[GeoNetwork-devel] ISO 19139 validation issue

Hi: using GN in svn trunk (on fc12), I have issues when, after uploading
an ISO 19139 document, trying to check the document for errors.

Not that the XML document validates fine using XML Spy 2010. The XML
document is attached.

Steps:
- login to GN
- click "Administration"
- click "Metadata Insert"
- Insert mode = file upload
- file type = single file
- metadata = path to XML document on local desktop
- type = metadata
- import actions = no action on import
- stylesheet = none
- validate checkbox CHECKED
- group = a user created groupname
- category = datasets
- click "Insert" (the metadata is inserted successfully without errors
or warnings.
- click the id number of "new metadata inserted" to edit the document
- click "Edit"
- click "Check"

I get the following popup error page:

Metadata is not valid.

Validation against schema definitions succeeded

but there were Error(s) in validating against schematron rules

Schematron report available here.

I've attached both the XML document and the schemtron error report for
review.

Any suggestions?

Thanks

..Tom

(attachments)

sample.xml (2.96 KB)
gn-trunk-schematron-errors.txt (1.97 KB)

I had problems importing ISO 19139 metadata when adding name spaces to the XML that were not in use (gsr, gss, gts, etc.).
WG
Kralidis,Tom [Ontario] wrote:

···
_______________________________
Wolfgang Grunberg
Arizona Geological Survey
[wgrunberg@anonymised.com](mailto:wgrunberg@anonymised.com)
520-770-3500

Hi: using GN in svn trunk (on fc12), I have issues when, after uploading
an ISO 19139 document, trying to check the document for errors.

Not that the XML document validates fine using XML Spy 2010.  The XML
document is attached.

Steps:
- login to GN
- click "Administration"
- click "Metadata Insert"
 - Insert mode = file upload
 - file type = single file
 - metadata = path to XML document on local desktop
 - type = metadata
 - import actions = no action on import
 - stylesheet = none
 - validate checkbox CHECKED
 - group = a user created groupname
 - category = datasets
- click "Insert" (the metadata is inserted successfully without errors
or warnings.
- click the id number of "new metadata inserted" to edit the document
- click "Edit"
- click "Check"

I get the following popup error page:

Metadata is not valid.

Validation against schema definitions succeeded

but there were Error(s) in validating against schematron rules

Schematron report available here.

I've attached both the XML document and the schemtron error report for
review.

Any suggestions?

Thanks

..Tom

  


---

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
[http://p.sf.net/sfu/google-dev2dev](http://p.sf.net/sfu/google-dev2dev)


---

_______________________________________________
GeoNetwork-devel mailing list
[GeoNetwork-devel@lists.sourceforge.net](mailto:GeoNetwork-devel@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geonetwork-devel](https://lists.sourceforge.net/lists/listinfo/geonetwork-devel)
GeoNetwork OpenSource is maintained at [http://sourceforge.net/projects/geonetwork](http://sourceforge.net/projects/geonetwork)

Kralidis,Tom [Ontario] wrote:

but there were Error(s) in validating against schematron rules

Schematron report available here.

I've attached both the XML document and the schemtron error report for
review.

Any suggestions?

GeoNetwork has done the right thing with your
metadata, but the output is not very helpful if you don't
know how to read it!

In this case, GN has correctly reported that your sample does not pass
all the requirements in Table A.1 of ISO 19139.

In particular:

Row 1: You haven't specified a language (MD_Metadata/language)
Row 5: Since hierarchyLevel is dataset (the default),
   you must specify MD_DataIdentification/topicCategory.

These are the two errors marked in the Schematron
report. Yes, it is confusing that the report lists
all of the tests, but in fact it is only the lines
that are followed by a line beginning with a # that are
failures.

--
Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082

On Tuesday, 15 December 2009 6:44 AM Tom Kralidis wrote:

Hi: using GN in svn trunk (on fc12), I have issues when,
after uploading
an ISO 19139 document, trying to check the document for errors.

Not that the XML document validates fine using XML Spy 2010.

This may be your first problem. A long time ago I found that XML Spy doesn't fully implement the different XML specifications. XML Spy may not be able to handle the Schematron/XSLT validation.

The XML
document is attached.

Steps:
- login to GN
- click "Administration"
- click "Metadata Insert"
- Insert mode = file upload
- file type = single file
- metadata = path to XML document on local desktop
- type = metadata
- import actions = no action on import
- stylesheet = none
- validate checkbox CHECKED
- group = a user created groupname
- category = datasets
- click "Insert" (the metadata is inserted successfully without errors
or warnings.
- click the id number of "new metadata inserted" to edit the document
- click "Edit"
- click "Check"

I get the following popup error page:

Metadata is not valid.

Validation against schema definitions succeeded

but there were Error(s) in validating against schematron rules

Schematron report available here.

I've attached both the XML document and the schemtron error report for
review.

I have validated your document using Oxygen.

The document is valid according to the XSDs but it is not valid according the Schematron. There were two Schematron errors.

The first error is on line Location: 26:0

Description: [ISO Schematron (XSLT 2.0)] Warning: [report] topicCategory is mandatory if MD_Metadata.hierarchyLevel equal "dataset" or "series" or doesn't exist ((not(../../gmd:hierarchyLevel) or (../../gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue='dataset') or (../../gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue='series')) and (not(gmd:topicCategory)))

You have not entered a hierarchyLevel. The standard interprets this to mean that your hierarchyLevel "is dataset". If your metadata is about 'dataset' or 'series' you must include a 'topicCategory'. You sample metadata record doesn't have a 'topicCategory' value.

The second error is on line Location: 2:0

Description: [ISO Schematron (XSLT 2.0)] language not present (gmd:language and ((normalize-space(gmd:language) ne '') or (normalize-space(gmd:language/gco:CharacterString) ne '') or (gmd:language/gmd:LanguageCode) or (gmd:language/@gco:nilReason = $nilReasonList)))

You have not entered a MD_Metadata/language. The standard requires the language to be recorded if it is not defined by the encoding. ISO 19139 does not allow 'language' in the XML encoding. I *think* this is because of GML but I'm not sure. Anyway, you need to add the language element.

I have fixed these errors in the attached XML metadata record. Please note that I have added a topicCategory of 'biota' to test the validation process. You need to change this if your metadata is not about 'biota'. Look for the comment:
"
Tom, you should change this topicCategory if you dataset does not relate to 'biota'
"
and change the value in the line below the comment.

I have also noticed the following:

- You have not included a complete set of locations for your namespaces within your 'schemaLocation' attribute of your root element, "MD_Metadata". This may make it difficult for others to validate your metadata record if they didn't already know about those namespaces.

- You unique identifier is not unique. The value of "SCF" for your parentIdentifier is surely repeated somewhere else in the world. ;--)

- You 'codeList' attributes do not point to any codeList on the internet. This value should be an absolute URL where the CT_CodelistCatalogue XML file can be found that contains the 'codeListValue' that you have chosen. Otherwise people using your metadata record won't know whether your codeListValue is valid according to the codeList.

I haven't corrected these problems in the attached XML record. I'll leave that up to you.

I hope that this helps.

John

Any suggestions?

Thanks

..Tom

(attachments)

sample.xml (3.25 KB)

Hi John,

I am currently struggling to reconcile the various ISO and OGC standards documents and I have a question regarding the codeList attribute in ISO 19139.

You wrote:

- You 'codeList' attributes do not point to any codeList on the internet. This value should be an absolute URL where the CT_CodelistCatalogue XML file can be found that contains the 'codeListValue' that you have chosen.  Otherwise people using your metadata record won't know whether your codeListValue is valid according to the codeList.

Is your recommendation based on a particular Profile (ANZLIC?)? I thought that the data type for the codeList attribute can be any registered URI and that it acts as an identifier which means it could be a URL or a URN.

As a developer, I lean towards putting in a URL that points to something more tangible such as an actual XML file. However, how would I resolve the following two codeList URIs?
“http://fu.org/babelCodelist.xml#CI_OnlineFunctionCode”
“http://bar.org/babelCodelist.xml#CI_OnlineFunctionCode”
If the URLs point to XML files with the same content, are we still dealing with the same codeList?

I appreciate your thoughts on this.

Ciao, Wolfgang

wrote:

···
_______________________________
Wolfgang Grunberg
Arizona Geological Survey
[wgrunberg@anonymised.com](mailto:wgrunberg@anonymised.com)
520-770-3500

John.Hockaday@anonymised.com

On Tuesday, 15 December 2009 6:44 AM Tom Kralidis wrote:

  
Hi: using GN in svn trunk (on fc12), I have issues when,
after uploading
an ISO 19139 document, trying to check the document for errors.

Not that the XML document validates fine using XML Spy 2010.
    

This may be your first problem. A long time ago I found that XML Spy doesn't fully implement the different XML specifications. XML Spy may not be able to handle the Schematron/XSLT validation.

  
The XML
document is attached.

Steps:
- login to GN
- click "Administration"
- click "Metadata Insert"
 - Insert mode = file upload
 - file type = single file
 - metadata = path to XML document on local desktop
 - type = metadata
 - import actions = no action on import
 - stylesheet = none
 - validate checkbox CHECKED
 - group = a user created groupname
 - category = datasets
- click "Insert" (the metadata is inserted successfully without errors
or warnings.
- click the id number of "new metadata inserted" to edit the document
- click "Edit"
- click "Check"

I get the following popup error page:

Metadata is not valid.

Validation against schema definitions succeeded

but there were Error(s) in validating against schematron rules

Schematron report available here.

I've attached both the XML document and the schemtron error report for
review.
    

I have validated your document using Oxygen.

The document is valid according to the XSDs but it is not valid according the Schematron. There were two Schematron errors.

The first error is on line Location: 26:0

Description: [ISO Schematron (XSLT 2.0)] Warning: [report] topicCategory is mandatory if MD_Metadata.hierarchyLevel equal "dataset" or "series" or doesn't exist ((not(../../gmd:hierarchyLevel) or (../../gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue='dataset') or (../../gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue='series')) and (not(gmd:topicCategory)))

You have not entered a hierarchyLevel. The standard interprets this to mean that your hierarchyLevel "is dataset". If your metadata is about 'dataset' or 'series' you must include a 'topicCategory'. You sample metadata record doesn't have a 'topicCategory' value.

The second error is on line Location: 2:0

Description: [ISO Schematron (XSLT 2.0)] language not present (gmd:language and ((normalize-space(gmd:language) ne '') or (normalize-space(gmd:language/gco:CharacterString) ne '') or (gmd:language/gmd:LanguageCode) or (gmd:language/@gco:nilReason = $nilReasonList)))

You have not entered a MD_Metadata/language. The standard requires the language to be recorded if it is not defined by the encoding. ISO 19139 does not allow 'language' in the XML encoding. I *think* this is because of GML but I'm not sure. Anyway, you need to add the language element.

I have fixed these errors in the attached XML metadata record. Please note that I have added a topicCategory of 'biota' to test the validation process. You need to change this if your metadata is not about 'biota'.  Look for the comment:
"
Tom, you should change this topicCategory if you dataset does not relate to 'biota'
"
 and change the value in the line below the comment.

I have also noticed the following:

- You have not included a complete set of locations for your namespaces within your 'schemaLocation' attribute of your root element, "MD_Metadata".  This may make it difficult for others to validate your metadata record if they didn't already know about those namespaces.

- You unique identifier is not unique. The value of "SCF" for your parentIdentifier is surely repeated somewhere else in the world. ;--)

- You 'codeList' attributes do not point to any codeList on the internet. This value should be an absolute URL where the CT_CodelistCatalogue XML file can be found that contains the 'codeListValue' that you have chosen.  Otherwise people using your metadata record won't know whether your codeListValue is valid according to the codeList.

I haven't corrected these problems in the attached XML record. I'll leave that up to you.

I hope that this helps.

John

  
Any suggestions?

Thanks

..Tom

    

```

---

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
[http://p.sf.net/sfu/google-dev2dev](http://p.sf.net/sfu/google-dev2dev)

```

```

---

_______________________________________________
GeoNetwork-devel mailing list
[GeoNetwork-devel@lists.sourceforge.net](mailto:GeoNetwork-devel@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geonetwork-devel](https://lists.sourceforge.net/lists/listinfo/geonetwork-devel)
GeoNetwork OpenSource is maintained at [http://sourceforge.net/projects/geonetwork](http://sourceforge.net/projects/geonetwork)
```

Hi Wolfgang,

You can use a URN in the codeList attribute value but, as you mention, I prefer to use a URL. URNs need some sort of resolver in the validation process whereas a URL XML file can be called into the validation process using the XSLT 'document' element.

I tried to access the XML as indicated by your two examples below. I didn't get any valid CT_CodelistCatalogue XML files from those two URLs so the validation process would not work.

An example of a CT_CodelistCatalogue XML file is available at http://asdd.ga.gov.au/asdd/profileinfo/gmxCodelists.xml. This is a copy of the revised http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml with corrected "schemaLocation" values.

If there were valid CT_CodelistCatalogue XML files at the URLs you provided then it wouldn't matter if they were the same or not. As long as the 'codeListValue's used in your XML metadata record were the same as the 'gml:identifier' element values within the CodeListDictionary within those XML files.

The validation process could be implemented using Schematron. Schematron is usually implemented by being converted into XSLT. The XSLT then downloads the CT_CodelistCatalogue XML file using the 'document' element. The Schematron at http://asdd.ga.gov.au/asdd/profileinfo/codeListValidation.sch does this validation.

The following Schematron components of the above mentioned Schematron rules do (I strongly suggest you look at the http://asdd.ga.gov.au/asdd/profileinfo/codeListValidation.sch Schematron as you read these components to understand what is happening):

- the "substring-before(@codeList,'#'))//" separates the URL from the code list dictionary entry. In your first example it would return: http://fu.org/babelCodelist.xml. In your second example it would return: "http://bar.org/babelCodelist.xml", in my example it returns http://asdd.ga.gov.au/asdd/profileinfo/gmxCodelists.xml.

- the "document(substring-before(@codeList,'#'))//" returns the content of the entire XML document. IE. In my example the entire content of the http://asdd.ga.gov.au/asdd/profileinfo/gmxCodelists.xml XML document.

- the "substring-after(current()/@codeList,'#')" returns the content of the URL after the "#". IE the code list dictionary value. In your examples this would be "CI_OnlineFunctionCode"

- the "//gmx:CodeListDictionary[@gml:id = substring-after(current()/@codeList,'#')]" returns the entire content of the codeListDictionary. In your example this would be the entire content of the "CI_OnlineFunctionCode" code list dictionary within the XML document.

- the test value of "@codeListValue = $codeListDoc/gmx:codeEntry/gmx:CodeDefinition/gml:identifier" tests to see if the content of the current codeListValue attribute in the XML metadata record against the gml:identifiers in the CodeListDictionary of the XML located at the codeList URL. In your example this would be all the gml:identifiers within the "CI_OnlineFunctionCode" code list dictionary within the http://fu.org/babelCodelist.xml or the http://bar.org/babelCodelist.xml XML codeList files if they existed. ;--) In my example this would be the all the gml:identifiers within the "CI_OnlineFunctionCode" code list dictionary within the http://asdd.ga.gov.au/asdd/profileinfo/gmxCodelists.xml XML document.

Using my URL the validation process wouldn't produce any errors because the XML document at that URL is a valid CT_CodelistCatalogue XML file.

Using your URLs the validation process would produce errors because there are no valid CT_CodelistCatalogue XML file located at those URLs.

So the Schematron validation process:

- checks to see if there is a valid CT_CodelistCatalogue XML file at the specified URL. If there isn't then an error is return. If there is then
- checks to see if the CodeListDictionary value (the value after the "#" in the URL) exists in the CT_CodelistCatalogue XML file. If it doesn't exist then an error is returned. If it does exist then
- checks to see if the codeListValue, in the XML metadata record being validated, is the same as one of the list of CodeDefinition/gml:identifers within the CodeListDictionary within the CT_CodelistCatalogue XML file. If it isn't the same then an error is returned. If it is the same then the validation process is passed.

If you want to see how I use the codeList values in an XML Metadata record, have a look at http://asdd.ga.gov.au/asdd/profileinfo/ANZCW0703008022testSchematron.xml. This file has many codeList and codeListValue pairs. All are valid except the very first one. This one fails because it is very unlikely that you will have my codeList located in the exact location on your computer as it do on mine. IE. In the file:///O:/downloads/ISO19139/ISO19139schemas/ISO19139schemas/resources/Codelist/ directory. That is why absolute URLs should be used within the codeList attribute.

I hope that this long and complicated explanation helps you.

John

-----Original Message-----
From: Wolfgang Grunberg [mailto:wgrunberg@anonymised.com]
Sent: Tuesday, 15 December 2009 11:09 AM
To: Hockaday John
Cc: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] ISO 19139 validation issue

Hi John,

I am currently struggling to reconcile the various ISO and OGC standards documents and I have a question regarding the codeList attribute in ISO 19139.

You wrote:

- You 'codeList' attributes do not point to any codeList on the internet. This value should be an absolute URL where the CT_CodelistCatalogue XML file can be found that contains the 'codeListValue' that you have chosen. Otherwise people using your metadata record won't know whether your codeListValue is valid according to the codeList.
Is your recommendation based on a particular Profile (ANZLIC?)? I thought that the data type for the codeList attribute can be any registered URI and that it acts as an identifier which means it could be a URL or a URN.

As a developer, I lean towards putting in a URL that points to something more tangible such as an actual XML file. However, how would I resolve the following two codeList URIs?
"http://fu.org/babelCodelist.xml#CI_OnlineFunctionCode"
"http://bar.org/babelCodelist.xml#CI_OnlineFunctionCode"
If the URLs point to XML files with the same content, are we still dealing with the same codeList?

I appreciate your thoughts on this.

Ciao, Wolfgang

_______________________________
Wolfgang Grunberg
Arizona Geological Survey
wgrunberg@anonymised.com
520-770-3500

John.Hockaday@anonymised.com wrote:
On Tuesday, 15 December 2009 6:44 AM Tom Kralidis wrote:

Hi: using GN in svn trunk (on fc12), I have issues when,
after uploading
an ISO 19139 document, trying to check the document for errors.

Not that the XML document validates fine using XML Spy 2010.

This may be your first problem. A long time ago I found that XML Spy doesn't fully implement the different XML specifications. XML Spy may not be able to handle the Schematron/XSLT validation.

The XML
document is attached.

Steps:
- login to GN
- click "Administration"
- click "Metadata Insert"
- Insert mode = file upload
- file type = single file
- metadata = path to XML document on local desktop
- type = metadata
- import actions = no action on import
- stylesheet = none
- validate checkbox CHECKED
- group = a user created groupname
- category = datasets
- click "Insert" (the metadata is inserted successfully without errors
or warnings.
- click the id number of "new metadata inserted" to edit the document
- click "Edit"
- click "Check"

I get the following popup error page:

Metadata is not valid.

Validation against schema definitions succeeded

but there were Error(s) in validating against schematron rules

Schematron report available here.

I've attached both the XML document and the schemtron error report for
review.

I have validated your document using Oxygen.

The document is valid according to the XSDs but it is not valid according the Schematron. There were two Schematron errors.

The first error is on line Location: 26:0

Description: [ISO Schematron (XSLT 2.0)] Warning: [report] topicCategory is mandatory if MD_Metadata.hierarchyLevel equal "dataset" or "series" or doesn't exist ((not(../../gmd:hierarchyLevel) or (../../gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue='dataset') or (../../gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue='series')) and (not(gmd:topicCategory)))

You have not entered a hierarchyLevel. The standard interprets this to mean that your hierarchyLevel "is dataset". If your metadata is about 'dataset' or 'series' you must include a 'topicCategory'. You sample metadata record doesn't have a 'topicCategory' value.

The second error is on line Location: 2:0

Description: [ISO Schematron (XSLT 2.0)] language not present (gmd:language and ((normalize-space(gmd:language) ne '') or (normalize-space(gmd:language/gco:CharacterString) ne '') or (gmd:language/gmd:LanguageCode) or (gmd:language/@gco:nilReason = $nilReasonList)))

You have not entered a MD_Metadata/language. The standard requires the language to be recorded if it is not defined by the encoding. ISO 19139 does not allow 'language' in the XML encoding. I *think* this is because of GML but I'm not sure. Anyway, you need to add the language element.

I have fixed these errors in the attached XML metadata record. Please note that I have added a topicCategory of 'biota' to test the validation process. You need to change this if your metadata is not about 'biota'. Look for the comment:
"
Tom, you should change this topicCategory if you dataset does not relate to 'biota'
"
and change the value in the line below the comment.

I have also noticed the following:

- You have not included a complete set of locations for your namespaces within your 'schemaLocation' attribute of your root element, "MD_Metadata". This may make it difficult for others to validate your metadata record if they didn't already know about those namespaces.

- You unique identifier is not unique. The value of "SCF" for your parentIdentifier is surely repeated somewhere else in the world. ;--)

- You 'codeList' attributes do not point to any codeList on the internet. This value should be an absolute URL where the CT_CodelistCatalogue XML file can be found that contains the 'codeListValue' that you have chosen. Otherwise people using your metadata record won't know whether your codeListValue is valid according to the codeList.

I haven't corrected these problems in the attached XML record. I'll leave that up to you.

I hope that this helps.

John

Any suggestions?

Thanks

..Tom

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev

_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

The datatype for codeList is anyURI. It is meant to be an identifier for the scope of the codeListValue, within which that value is defined and unique. Provision that codeList is a resolvable URL to a CT_CodelistCatlogue is certainly a reasonable provision for an application profile, but is not mandated by ISO19139 or gco.xsd. This is just one manifestation of a much larger problem of dealing with identifiers in a global network. We're wrestling with the same issues with GeoSciML services, gml:scopedName and gml:identifier.

steve

John.Hockaday@anonymised.com wrote:

Hi Wolfgang,

You can use a URN in the codeList attribute value but, as you mention, I prefer to use a URL. URNs need some sort of resolver in the validation process whereas a URL XML file can be called into the validation process using the XSLT 'document' element.

I tried to access the XML as indicated by your two examples below. I didn't get any valid CT_CodelistCatalogue XML files from those two URLs so the validation process would not work.

An example of a CT_CodelistCatalogue XML file is available at http://asdd.ga.gov.au/asdd/profileinfo/gmxCodelists.xml. This is a copy of the revised http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml with corrected "schemaLocation" values.

If there were valid CT_CodelistCatalogue XML files at the URLs you provided then it wouldn't matter if they were the same or not. As long as the 'codeListValue's used in your XML metadata record were the same as the 'gml:identifier' element values within the CodeListDictionary within those XML files.

The validation process could be implemented using Schematron. Schematron is usually implemented by being converted into XSLT. The XSLT then downloads the CT_CodelistCatalogue XML file using the 'document' element. The Schematron at http://asdd.ga.gov.au/asdd/profileinfo/codeListValidation.sch does this validation.

The following Schematron components of the above mentioned Schematron rules do (I strongly suggest you look at the http://asdd.ga.gov.au/asdd/profileinfo/codeListValidation.sch Schematron as you read these components to understand what is happening):

- the "substring-before(@codeList,'#'))//" separates the URL from the code list dictionary entry. In your first example it would return: http://fu.org/babelCodelist.xml. In your second example it would return: "http://bar.org/babelCodelist.xml", in my example it returns http://asdd.ga.gov.au/asdd/profileinfo/gmxCodelists.xml.

- the "document(substring-before(@codeList,'#'))//" returns the content of the entire XML document. IE. In my example the entire content of the http://asdd.ga.gov.au/asdd/profileinfo/gmxCodelists.xml XML document.

- the "substring-after(current()/@codeList,'#')" returns the content of the URL after the "#". IE the code list dictionary value. In your examples this would be "CI_OnlineFunctionCode"

- the "//gmx:CodeListDictionary[@gml:id = substring-after(current()/@codeList,'#')]" returns the entire content of the codeListDictionary. In your example this would be the entire content of the "CI_OnlineFunctionCode" code list dictionary within the XML document.

- the test value of "@codeListValue = $codeListDoc/gmx:codeEntry/gmx:CodeDefinition/gml:identifier" tests to see if the content of the current codeListValue attribute in the XML metadata record against the gml:identifiers in the CodeListDictionary of the XML located at the codeList URL. In your example this would be all the gml:identifiers within the "CI_OnlineFunctionCode" code list dictionary within the http://fu.org/babelCodelist.xml or the http://bar.org/babelCodelist.xml XML codeList files if they existed. ;--) In my example this would be the all the gml:identifiers within the "CI_OnlineFunctionCode" code list dictionary within the http://asdd.ga.gov.au/asdd/profileinfo/gmxCodelists.xml XML document.

Using my URL the validation process wouldn't produce any errors because the XML document at that URL is a valid CT_CodelistCatalogue XML file.

Using your URLs the validation process would produce errors because there are no valid CT_CodelistCatalogue XML file located at those URLs.

So the Schematron validation process:

- checks to see if there is a valid CT_CodelistCatalogue XML file at the specified URL. If there isn't then an error is return. If there is then
- checks to see if the CodeListDictionary value (the value after the "#" in the URL) exists in the CT_CodelistCatalogue XML file. If it doesn't exist then an error is returned. If it does exist then
- checks to see if the codeListValue, in the XML metadata record being validated, is the same as one of the list of CodeDefinition/gml:identifers within the CodeListDictionary within the CT_CodelistCatalogue XML file. If it isn't the same then an error is returned. If it is the same then the validation process is passed.

If you want to see how I use the codeList values in an XML Metadata record, have a look at http://asdd.ga.gov.au/asdd/profileinfo/ANZCW0703008022testSchematron.xml. This file has many codeList and codeListValue pairs. All are valid except the very first one. This one fails because it is very unlikely that you will have my codeList located in the exact location on your computer as it do on mine. IE. In the file:///O:/downloads/ISO19139/ISO19139schemas/ISO19139schemas/resources/Codelist/ directory. That is why absolute URLs should be used within the codeList attribute.

I hope that this long and complicated explanation helps you.

John

-----Original Message-----
From: Wolfgang Grunberg [mailto:wgrunberg@anonymised.com]
Sent: Tuesday, 15 December 2009 11:09 AM
To: Hockaday John
Cc: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] ISO 19139 validation issue

Hi John,

I am currently struggling to reconcile the various ISO and OGC standards documents and I have a question regarding the codeList attribute in ISO 19139.

You wrote:

- You 'codeList' attributes do not point to any codeList on the internet. This value should be an absolute URL where the CT_CodelistCatalogue XML file can be found that contains the 'codeListValue' that you have chosen. Otherwise people using your metadata record won't know whether your codeListValue is valid according to the codeList.
Is your recommendation based on a particular Profile (ANZLIC?)? I thought that the data type for the codeList attribute can be any registered URI and that it acts as an identifier which means it could be a URL or a URN.

As a developer, I lean towards putting in a URL that points to something more tangible such as an actual XML file. However, how would I resolve the following two codeList URIs?
"http://fu.org/babelCodelist.xml#CI_OnlineFunctionCode"
"http://bar.org/babelCodelist.xml#CI_OnlineFunctionCode"
If the URLs point to XML files with the same content, are we still dealing with the same codeList?

I appreciate your thoughts on this.

Ciao, Wolfgang

_______________________________
Wolfgang Grunberg
Arizona Geological Survey
wgrunberg@anonymised.com
520-770-3500

John.Hockaday@anonymised.com wrote:
On Tuesday, 15 December 2009 6:44 AM Tom Kralidis wrote:

Hi: using GN in svn trunk (on fc12), I have issues when,
after uploading
an ISO 19139 document, trying to check the document for errors.

Not that the XML document validates fine using XML Spy 2010.

This may be your first problem. A long time ago I found that XML Spy doesn't fully implement the different XML specifications. XML Spy may not be able to handle the Schematron/XSLT validation.

The XML
document is attached.

Steps:
- login to GN
- click "Administration"
- click "Metadata Insert"
- Insert mode = file upload
- file type = single file
- metadata = path to XML document on local desktop
- type = metadata
- import actions = no action on import
- stylesheet = none
- validate checkbox CHECKED
- group = a user created groupname
- category = datasets
- click "Insert" (the metadata is inserted successfully without errors
or warnings.
- click the id number of "new metadata inserted" to edit the document
- click "Edit"
- click "Check"

I get the following popup error page:

Metadata is not valid.

Validation against schema definitions succeeded

but there were Error(s) in validating against schematron rules

Schematron report available here.

I've attached both the XML document and the schemtron error report for
review.

I have validated your document using Oxygen.

The document is valid according to the XSDs but it is not valid according the Schematron. There were two Schematron errors.

The first error is on line Location: 26:0

Description: [ISO Schematron (XSLT 2.0)] Warning: [report] topicCategory is mandatory if MD_Metadata.hierarchyLevel equal "dataset" or "series" or doesn't exist ((not(../../gmd:hierarchyLevel) or (../../gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue='dataset') or (../../gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue='series')) and (not(gmd:topicCategory)))

You have not entered a hierarchyLevel. The standard interprets this to mean that your hierarchyLevel "is dataset". If your metadata is about 'dataset' or 'series' you must include a 'topicCategory'. You sample metadata record doesn't have a 'topicCategory' value.

The second error is on line Location: 2:0

Description: [ISO Schematron (XSLT 2.0)] language not present (gmd:language and ((normalize-space(gmd:language) ne '') or (normalize-space(gmd:language/gco:CharacterString) ne '') or (gmd:language/gmd:LanguageCode) or (gmd:language/@gco:nilReason = $nilReasonList)))

You have not entered a MD_Metadata/language. The standard requires the language to be recorded if it is not defined by the encoding. ISO 19139 does not allow 'language' in the XML encoding. I *think* this is because of GML but I'm not sure. Anyway, you need to add the language element.

I have fixed these errors in the attached XML metadata record. Please note that I have added a topicCategory of 'biota' to test the validation process. You need to change this if your metadata is not about 'biota'. Look for the comment:
"
Tom, you should change this topicCategory if you dataset does not relate to 'biota'
"
and change the value in the line below the comment.

I have also noticed the following:

- You have not included a complete set of locations for your namespaces within your 'schemaLocation' attribute of your root element, "MD_Metadata". This may make it difficult for others to validate your metadata record if they didn't already know about those namespaces.

- You unique identifier is not unique. The value of "SCF" for your parentIdentifier is surely repeated somewhere else in the world. ;--)

- You 'codeList' attributes do not point to any codeList on the internet. This value should be an absolute URL where the CT_CodelistCatalogue XML file can be found that contains the 'codeListValue' that you have chosen. Otherwise people using your metadata record won't know whether your codeListValue is valid according to the codeList.

I haven't corrected these problems in the attached XML record. I'll leave that up to you.

I hope that this helps.

John

Any suggestions?

Thanks

..Tom

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev

_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork