Problem with new metadata profile

4991
8
03-12-2012 06:57 AM
Jean-Charleslegrand
New Contributor
Hi.

I I've tried to create a new metadata profil. I've followed indications from there.
My problem:

In the form:
If only one mandatory field is empty, I just get one error message so, it's ok.
(eg: Profil de test IRD (test) General Information - Title: is required. )

If all the mandatory fiedls, which are definied in my *-definition.xml file, are filled then one error message appears for each mandatory field (which means I can get up to 10 error messages):
(e.g : ISO 19115 (Data) (iso-19115) General Information - Title: is required. General Information - Abstract: is required. . . . etc)


In fact, it looks like there are two validation steps. The first one checks my "definition.xml" file. but I do not understand the second one...

It's said in documentation the key for the "schema" must be unique.
I've tried to put the same key for my new profile, and for the ISO-19115 profile.

In the list where you chose your metadata profile, iso-19115 is not there anymore and is replace by my new profile.
Problems disappears, I can complete the form. (Ok I got an error (Unrecognized metadata schema) but if I try with a simple profile it works fine).

My question is, how could I do to validate my form whitout overwritting the iso-19115 profile.
It seems that there is a problem whith the shema key. <schema key="test" ............ >
Shall I define this key somewhere? I've never read it but . . .
0 Kudos
8 Replies
CliveReece
Esri Contributor
What version of Geoportal Server are you running? 
A better explanation of creating custom metadata profiles is on SourceForge:  http://sourceforge.net/apps/mediawiki/geoportal/index.php?title=Add_a_Custom_Profile
0 Kudos
Jean-Charleslegrand
New Contributor
Thank for this link. It explains more things than what I had read for the moment. But I haven't found the error yet.
I use geoportal 1.2.
I use my own template file.

It's said:
"Upon saving, the geoportal validates that all parameters that are designated as mandatory have been filled out in the form. If the definition.xml file contains an xsd reference, the geoportal also validates that the information satisfies the requirements of the xsd. If the document passes these validations, then the geoportal writes the metadata content into a metadata XML document. [...]"

How can I recognize this xsd reference ? (I've search for it but don't find so I think I haven't got this reference). When I click on save button, geoportal use my definition file then, if mandatory fields are filled, launch an other validtion test and none of the fields are recognized. It also ask for fields that I haven't got in my definition.xml file.
0 Kudos
CliveReece
Esri Contributor
XSDs get referenced in the <schema> tag of a definition.xml as a property (xsdLocation).  For example, in inspire-iso-19115-definition.xml, notice the xsdLocation property: 

<schema
key="inspire-iso-19115"
templateFile="gpt/metadata/iso/inspire/inspire-iso-19115-template.xml"
cswOutputSchema="http://www.isotc211.org/2005/gmd"
cswBriefXslt="gpt/metadata/iso/apiso-brief.xslt"
cswSummaryXslt="gpt/metadata/iso/apiso-summary.xslt"
xsdLocation="http://www.isotc211.org/2005/gmd/metadataEntity.xsd"
        detailsXslt="gpt/metadata/iso/iso-details.xslt">
0 Kudos
Jean-Charleslegrand
New Contributor
I've checked and there is no reference to xsd in my definition.xml file.

Have you got any idea of what could call the second verification ?
0 Kudos
CliveReece
Esri Contributor
How similar is your custom metadata profile to the built-in iso-19115?  Looking through your original message, it sounds like you are having validation problems when your custom profile and iso-19115 are both set in the schemas.xml. 

And then from your error message:  "(e.g : ISO 19115 (Data) (iso-19115) General Information - Title: is required. General Information - Abstract: is required. . . . etc)", I am noticing that Geoportal is interpreting your metadata as "ISO 19115 (Data)" even though (i am guessing from your message) that you are trying to validate the custom profile.

That points to a potential problem where Geoportal is getting confused over the interrogation rules for the metadata profile. 

You should take a look at and compare the interrogation rules for your custom profile and iso-19115.

The <interrogation> element is in your definition file.   The default one for iso-19115 is: 
  <interrogation count="count(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification)"/>


There are two cases where you can run into problems with interrogation rules:

1. The interrogation rules for your custom profile and the default iso-19115 are the same.  They are incompatible in this case.  Geoportal will use whichever profile is nearest the top in your schemas.xml file.  Want to make sure Geoportal uses your custom profile?  Then make sure iso-19115 gets placed after your custom profile (and as a result of being lower in the schemas.xml, iso-19115 will never get used.

2. The interrogation rules for your custom profile is different from iso-19115, but not necessarily exclusive.  Geoportal will scan through the schemas.xml file starting from the top.  The first interrogation rule that meets the metadata will be used by Geoportal to define what metadata profile rules it will use during validation.  For example, you may have iso-19115 above your custom profile in the schemas.xml.  Then, if your metadata meets the interrogation rule for iso-19115, then Geoportal will use iso-19115 rules instead of your custom profile rules.  The solution for this problem is to use custom profile interrogation rules and make sure your custom profile is defined before iso-19115 in schemas.xml.  That way, the logic for Geoportal is to try to catch custom profile metadata first before the more general metadata category of iso-19115.
0 Kudos
Jean-Charleslegrand
New Contributor
Hi. Thank for the help.

My custom metadata profile is based on iso 19115, so they are very similar.
I've tryed to change the "shema interrogation" but it don't works.

<interrogation count="count(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:ressourceConstraints)"/>


(there aren't any "ressourceConstraints" in the others default profile)

I've place iso-19115 after my custom profile. In the select menu iso-19115 is below my custom profile but I still have the same problem.

I've tryed something.

- create 2 identical custom metadata profile (copy/past of the definition.xml and template.xml file --> rename files  --> update these changes in gpt properties and schema.xml. change the key for the shema and templafile path . . . )

There are 2 validation step. The first one is ok and follow the last definition.xml file
(if I let title empty  ---->      

  test (test2)
    General Information - Title: is required.
)


If i fill all the fields . . . The validation follow the clone I've made and say that all the mandatory field are empty.

Profil de test IRD (test)
General Information - Title: is required.
General Information - Abstract: is required.
General Information - File Identifier: is required.
Spatial Domain - West Bounding Longitude: is required.
Spatial Domain - South Bounding Latitude: is required.
.
.
.


I think that my error can't be in the "body".
Here is what we could call the header.

[HTML]
<?xml version="1.0" encoding="UTF-8"?>
<schema key="test"
        templateFile="gpt/metadata/iso/profil-IRD-template.xml"
        cswOutputSchema="http://www.isotc211.org/2005/gmd"
        cswBriefXslt="gpt/metadata/iso/apiso-brief.xslt"
        cswSummaryXslt="gpt/metadata/iso/apiso-summary.xslt">

<!-- schema label -->
<label resourceKey="catalog.mdParam.schema.IRD.coregeog"/>


<!-- schema namespaces -->
<namespace prefix="gmd" uri="http://www.isotc211.org/2005/gmd"/>
<namespace prefix="gco" uri="http://www.isotc211.org/2005/gco"/>
<namespace prefix="gml" uri="http://www.opengis.net/gml/3.2"/>
<namespace prefix="gts" uri="http://www.isotc211.org/2005/gts"/>
<namespace prefix="gmi" uri="http://www.isotc211.org/2005/gmi"/>
<!--  NGDC Addition -->
<namespace prefix="srv" uri="http://www.isotc211.org/2005/srv"/>

<!-- schema interrogation -->
<interrogation count="count(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:ressourceConstraints)"/>

<!-- indexables -->
<indexables fileName="gpt/metadata/iso/apiso-2-indexables.xml"/>

[/HTML]

ps : Sorry for my english I try to be understandable. If I'm not, saying it I could try to explain another time.
0 Kudos
CliveReece
Esri Contributor
Are you sure "ressourceConstraints" actually gets written in your XML?  "ressourceConstraints" is not a valid ISO19115 element (spelling).

If you are using Geoportal Server 1.2, I assume your definition.xml file is using the GXE for online metadata creation.  Yes/no?

  <!-- Geoportal XML editor -->
  <editor fileName="gpt/gxe/iso/iso19139/iso19139-dataset-editor.xml"/>


and you are testing the validation behavior with the online editor.  Correct?  (versus uploaded XML)
0 Kudos
Jean-Charleslegrand
New Contributor
Thank you !

It seems that it work now.

and you are testing the validation behavior with the online editor. Correct?

Yes

If you are using Geoportal Server 1.2, I assume your definition.xml file is using the GXE for online metadata creation. Yes/no?

No I don't use it.

Are you sure "ressourceConstraints" actually gets written in your XML? is not a valid ISO19115 element (spelling).

You're right, it's "resourceConstraints" thank you, I hadn't seen the second "s".

now I use that:

<interrogation count="count(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:accessConstraints)"/>


I still have some problems but I think I can fix them. (between definition.xml and tempalte.xml or something in relation with the iso norm. I will see later).

Thank for the help.
0 Kudos