[GeoNetwork-devel] Plugin profiles conversion question

hello,

I have a plugin profile that uses its own schema, overriding some of the standard ISO19139 elements.

My goal is that the CSW server by default returns the metadata as they are (using the profile schema) but when clients ask for , it should apply an XSLT to convert the overridden elements back to their standard ISO ones.

The documentation says this :

“If the new GeoNetwork plugin schema is to support on the fly translation of metadata records to other schemas, then the convert directory should be created and populated with appropriate XSLTs.” (see http://geonetwork-opensource.org/manuals/trunk/eng/developer/schemaPlugins/index.html).

But I find this explanation a bit sparse. For example, how should these XSLTs be named, in order to be applied when client asks for some particular outputschema ?

I tried creating an XSLT called “to19139.xsl” in the /convert directory, analogous to how it is in the French profile. However when clients ask for outputschema http://www.isotc211.org/2005/gmd, it seems this XSLT is not applied and the md are returned as is (with the profile schema elements).

What should I do to make that work ?

Kind regards
Heikki Doeleman

Sparse to the point of being unhelpful I'd say :slight_smile:

The untidy state of this dir has been bugging me for a while. The purpose of the convert directory is to provide schema specific XSLTs to convert metadata to/from that schema (so the spare statement is right). However the layout of the dir and its contents needs further discussion and maybe this is a good opportunity for rationalization to make things clearer:

- Some XSLTs eg. xml_iso19139.xsl are used to provide on the fly conversions in the search results and metadata show windows - see WEB-INF/config-export.xml eg. the service xml_iso19139 calls xml_iso19139.xsl (this is probably the source for the sparse comment above)

- oai_dc.xsl is used to convert schema records to oai_dc format on the fly for the OAIPMH harvester (and configured in WEB-INF/config-oai-prefixes.xml - can be other converters for this as well - there is an example in there)

- the functions.xsl file is used by index-fields.xsl and update-fixed-info.xsl - it should move up into the same directory as the xslts that use it or possibly into an xslt-includes subdirectory of the schema so it doesn't cause confusion here
   
- the convert directory also contains optional subdirectories used by harvesters for specific transformations to/from the schema if supported - in particular:

ThreddsDIFToISO - XSLTs for converting Thredds catalog metadata in DIF format to the schema - thredds harvester
ThreddsToFragments - XSLTs for converting Thredds catalog metadata to schema (fragments) - thredds harvester
WFSToFragments - XSLTs for converting WFS GetFeature requests to schema (fragments) - wfs harvester
OGCWxSGetCapabilitiesto19119 - XSLTs for converting GetCaps responses to 19119 service descriptions for this schema - OGCWxS harvester

So after all that - my feeling is that rather than rely just on a naming convention, each schema should have a config that describes the conversions it supports (to be read by the SchemaManager) eg:

<schema name="iso19139" nsUrl="http://www.isotc211.org/2005/gmd&quot; schemaLocation="http://www.isotc211.org/2005/gmd/gmd\.xsd&quot; xslt="xml_iso19139.xsl"/> <!-- localized description of what xml_iso19139.xsl does in schema strings file? -->

This could then be used for your use-case but also for others as it contains not just the name of the converter but the namespace produced (which could also be used to search for a matching converter).

Maybe there is a better alternative? In any case I'd like to get this (or something like it) in place asap as this needs to be in a state where it can be properly documented and used.

Cheers,
Simon

________________________________________
From: heikki [tropicano@anonymised.com]
Sent: Tuesday, 14 February 2012 10:55 PM
To: Devel geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] Plugin profiles conversion question

hello,

I have a plugin profile that uses its own schema, overriding some of the standard ISO19139 elements.

My goal is that the CSW server by default returns the metadata as they are (using the profile schema) but when clients ask for , it should apply an XSLT to convert the overridden elements back to their standard ISO ones.

The documentation says this :

"If the new GeoNetwork plugin schema is to support on the fly translation of metadata records to other schemas, then the convert directory should be created and populated with appropriate XSLTs." (see http://geonetwork-opensource.org/manuals/trunk/eng/developer/schemaPlugins/index.html).

But I find this explanation a bit sparse. For example, how should these XSLTs be named, in order to be applied when client asks for some particular outputschema ?

I tried creating an XSLT called "to19139.xsl" in the /convert directory, analogous to how it is in the French profile. However when clients ask for outputschema GMD — Resource site for ISO/TC 211 Geographic information/Geomatics, it seems this XSLT is not applied and the md are returned as is (with the profile schema elements).

What should I do to make that work ?

Kind regards
Heikki Doeleman

hi Simon,

thanks for response. Sounds like a plan to structure these things better. I’ll come back to that soon.

Just to confirm: am I correct that at present, there is no facility to make the CSW server respond to requests such that some particular (profile-specific) XSLT is applied when clients ask for some particular OutputSchema ?

Kind regards
Heikki Doeleman

On Wed, Feb 15, 2012 at 2:04 PM, Simon.Pigot@anonymised.com wrote:

Sparse to the point of being unhelpful I’d say :slight_smile:

The untidy state of this dir has been bugging me for a while. The purpose of the convert directory is to provide schema specific XSLTs to convert metadata to/from that schema (so the spare statement is right). However the layout of the dir and its contents needs further discussion and maybe this is a good opportunity for rationalization to make things clearer:

  • Some XSLTs eg. xml_iso19139.xsl are used to provide on the fly conversions in the search results and metadata show windows - see WEB-INF/config-export.xml eg. the service xml_iso19139 calls xml_iso19139.xsl (this is probably the source for the sparse comment above)

  • oai_dc.xsl is used to convert schema records to oai_dc format on the fly for the OAIPMH harvester (and configured in WEB-INF/config-oai-prefixes.xml - can be other converters for this as well - there is an example in there)

  • the functions.xsl file is used by index-fields.xsl and update-fixed-info.xsl - it should move up into the same directory as the xslts that use it or possibly into an xslt-includes subdirectory of the schema so it doesn’t cause confusion here

  • the convert directory also contains optional subdirectories used by harvesters for specific transformations to/from the schema if supported - in particular:

ThreddsDIFToISO - XSLTs for converting Thredds catalog metadata in DIF format to the schema - thredds harvester
ThreddsToFragments - XSLTs for converting Thredds catalog metadata to schema (fragments) - thredds harvester
WFSToFragments - XSLTs for converting WFS GetFeature requests to schema (fragments) - wfs harvester
OGCWxSGetCapabilitiesto19119 - XSLTs for converting GetCaps responses to 19119 service descriptions for this schema - OGCWxS harvester

So after all that - my feeling is that rather than rely just on a naming convention, each schema should have a config that describes the conversions it supports (to be read by the SchemaManager) eg:

This could then be used for your use-case but also for others as it contains not just the name of the converter but the namespace produced (which could also be used to search for a matching converter).

Maybe there is a better alternative? In any case I’d like to get this (or something like it) in place asap as this needs to be in a state where it can be properly documented and used.

Cheers,
Simon


From: heikki [tropicano@anonymised.com]
Sent: Tuesday, 14 February 2012 10:55 PM
To: Devel geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] Plugin profiles conversion question

hello,

I have a plugin profile that uses its own schema, overriding some of the standard ISO19139 elements.

My goal is that the CSW server by default returns the metadata as they are (using the profile schema) but when clients ask for , it should apply an XSLT to convert the overridden elements back to their standard ISO ones.

The documentation says this :

“If the new GeoNetwork plugin schema is to support on the fly translation of metadata records to other schemas, then the convert directory should be created and populated with appropriate XSLTs.” (see http://geonetwork-opensource.org/manuals/trunk/eng/developer/schemaPlugins/index.html).

But I find this explanation a bit sparse. For example, how should these XSLTs be named, in order to be applied when client asks for some particular outputschema ?

I tried creating an XSLT called “to19139.xsl” in the /convert directory, analogous to how it is in the French profile. However when clients ask for outputschema http://www.isotc211.org/2005/gmd, it seems this XSLT is not applied and the md are returned as is (with the profile schema elements).

What should I do to make that work ?

Kind regards
Heikki Doeleman

hi Simon,

yes, something like this sounds good.

I think it would be good to move all format-transforming XSLTs into their appropriate schema/profile directory. Now, we have them also in at least webapp/conversion, webapp/xml/mappings, and webapp/xsl/conversion. Ideally all specific stuff (incl. every reference to ISO19139 for example) should be only in specific schema/profile directories, in my opinion.

We could introduce a conversions.xml in the schema/profiles’ /convert directory which should list all available conversions to and from that specific schema or profile, and list where to find the XSLTs to do them. Then the catalog could display available and appropriate functions depending on the metadata; e.g. if my catalog has both ISO19139 metadata and MyProfile metadata, it could display a button Save As ISO19139 when displaying a MyProfile metadata if such a conversion is declared in conversions.xml, and Save As MyProfile when displaying an ISO19139 metadata if the conversion is declared.

Similarly the CSW server, when returning metadata in GetRecords, should apply some transformation before returning the response depending on both the requested OutputSchema and the schema of each metadata to return. So conversions.xml must contain a map from supported OutputSchema values to transformations.

Something like this ?

Kind regards
Heikki Doeleman

On Wed, Feb 15, 2012 at 2:04 PM, <Simon.Pigot@anonymised.com…> wrote:

Sparse to the point of being unhelpful I’d say :slight_smile:

The untidy state of this dir has been bugging me for a while. The purpose of the convert directory is to provide schema specific XSLTs to convert metadata to/from that schema (so the spare statement is right). However the layout of the dir and its contents needs further discussion and maybe this is a good opportunity for rationalization to make things clearer:

  • Some XSLTs eg. xml_iso19139.xsl are used to provide on the fly conversions in the search results and metadata show windows - see WEB-INF/config-export.xml eg. the service xml_iso19139 calls xml_iso19139.xsl (this is probably the source for the sparse comment above)

  • oai_dc.xsl is used to convert schema records to oai_dc format on the fly for the OAIPMH harvester (and configured in WEB-INF/config-oai-prefixes.xml - can be other converters for this as well - there is an example in there)

  • the functions.xsl file is used by index-fields.xsl and update-fixed-info.xsl - it should move up into the same directory as the xslts that use it or possibly into an xslt-includes subdirectory of the schema so it doesn’t cause confusion here

  • the convert directory also contains optional subdirectories used by harvesters for specific transformations to/from the schema if supported - in particular:

ThreddsDIFToISO - XSLTs for converting Thredds catalog metadata in DIF format to the schema - thredds harvester
ThreddsToFragments - XSLTs for converting Thredds catalog metadata to schema (fragments) - thredds harvester
WFSToFragments - XSLTs for converting WFS GetFeature requests to schema (fragments) - wfs harvester
OGCWxSGetCapabilitiesto19119 - XSLTs for converting GetCaps responses to 19119 service descriptions for this schema - OGCWxS harvester

So after all that - my feeling is that rather than rely just on a naming convention, each schema should have a config that describes the conversions it supports (to be read by the SchemaManager) eg:

This could then be used for your use-case but also for others as it contains not just the name of the converter but the namespace produced (which could also be used to search for a matching converter).

Maybe there is a better alternative? In any case I’d like to get this (or something like it) in place asap as this needs to be in a state where it can be properly documented and used.

Cheers,
Simon


From: heikki [tropicano@anonymised.com]
Sent: Tuesday, 14 February 2012 10:55 PM
To: Devel geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] Plugin profiles conversion question

hello,

I have a plugin profile that uses its own schema, overriding some of the standard ISO19139 elements.

My goal is that the CSW server by default returns the metadata as they are (using the profile schema) but when clients ask for , it should apply an XSLT to convert the overridden elements back to their standard ISO ones.

The documentation says this :

“If the new GeoNetwork plugin schema is to support on the fly translation of metadata records to other schemas, then the convert directory should be created and populated with appropriate XSLTs.” (see http://geonetwork-opensource.org/manuals/trunk/eng/developer/schemaPlugins/index.html).

But I find this explanation a bit sparse. For example, how should these XSLTs be named, in order to be applied when client asks for some particular outputschema ?

I tried creating an XSLT called “to19139.xsl” in the /convert directory, analogous to how it is in the French profile. However when clients ask for outputschema http://www.isotc211.org/2005/gmd, it seems this XSLT is not applied and the md are returned as is (with the profile schema elements).

What should I do to make that work ?

Kind regards
Heikki Doeleman