Changes between Initial Version and Version 1 of ProfileSupport


Ignore:
Timestamp:
Jun 24, 2008, 12:34:22 PM (16 years ago)
Author:
simonp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ProfileSupport

    v1 v1  
     1= Proposal number : Proposal title : Profile Support for GN =
     2
     3|| '''Date''' || 2008/06/20 ||
     4|| '''Contact(s)''' || Simon Pigot ||
     5|| '''Last edited''' || [[Timestamp]] ||
     6|| '''Status''' || draft, under development ||
     7|| '''Assigned to release''' || 2.3 ||
     8|| '''Resources''' || Available ||
     9
     10== Overview ==
     11
     12GN supports different metadata standards eg. Dublin Core, ISO, FGDC etc based on XML Schema Definition (XSD) files. To suit the needs of different communities, jurisdictions and organisations, these standards (particularly the ISO standards) can be profiled – typically this means extending and restricting the types of elements and introducing (or relaxing) conditions based on content. For example, the spatial council for Australia and New Zealand, ANZLIC, profiled the ISO metadata standard with one of the changes being to make the gmd:fileIdentifier element mandatory. The Australian Marine Community profiled the ISO standard by adding new elements and changing the conditionality of others.[[BR]]
     13
     14GN needs to adopt a set of XSD procedures for describing profiles and implement support for profiles that re-uses as much of the underlying standard as possible. This proposal outlines:
     15
     161.the XSD procedures supported by GN for describing a profile – extension, restriction and substitution groups
     172.the components needed to describe a profile in GN
     183.how profile support is implemented
     19
     20National profiles will be included as optional installation packages. The template for this will be developed using BlueNet supported profiles for Australian use.
     21
     22Although other standards can and have been profiles, this proposal relates to profiles of the ISO iso19139 standard.
     23
     24A future proposal will describe support for profiles as dynamic plug-ins.
     25
     26=== Proposal Type ===
     27 * '''Type''': Module changes, Guidelines change, Installer change
     28 * '''App''': !Geonetwork
     29 * '''Module''': XSLT layer, DataManager, CSW (later)
     30
     31=== Links ===
     32 * '''Editor proposal''' [http://trac.osgeo.org/geonetwork/wiki/EditorEnhancements]:
     33
     34=== Voting History ===
     35 * No history yet
     36
     37----
     38
     39== Motivations ==
     40
     41See overview.
     42
     43== How to Add a Profile under this Proposal ==
     44
     45An implementation can be found in the BlueNet MEST version of GN – here: [http://anzlicmet.bluenet.utas.edu.au] with source code here: [http://geonetwork.svn.sourceforge.net/viewvc/geonetwork/sandbox/]
     46
     47This proposal describes this implementation.
     48
     49'''1 - Where are profiles stored and what are the XSD procedures can be used to define a profile?'''
     50
     51Profiles live in web/geonetwork/xml/schemas with the other standards. They are named according to base standard with an extension after a '.' to indicate the profile eg. Marine Community Profile (MCP) of iso19139 is named iso19139.mcp, so the full path to that profile would be web/geonetwork/xml/schemas/iso19139.mcp. The XSD files are held in the schema directory. The layout of the XSD files in the schema directory is not fixed.
     52
     53The idea underlying profile support is that the XSD files of the base standard are not modified, instead, a new namespace is introduced and elements in the base standard are extended to contain new elements or restricted to change cardinality using the XSD mechanisms: xs:extension, xs:restriction and substitution groups.
     54
     55So for example, in the MCP we add mcp:MD_CreativeCommons as an additional gmd:MD_Constraint as follows:
     56
     57
     58{{{
     59<!-- ================================================================== -->
     60<!-- Add MD_CreativeCommons as a substitute for MD_Constraints          -->
     61<!-- ================================================================== -->
     62
     63 <xs:element name="MD_CreativeCommons" substitutionGroup="gmd:MD_Constraints" type="mcp:MD_Constraints_Type"/>     
     64
     65  <xs:complexType name="MD_Constraints_Type">
     66    <xs:annotation>
     67      <xs:documentation>
     68        Add MD_CreativeCommons as an extension of gmd:MD_Constraints_Type
     69      </xs:documentation>
     70    </xs:annotation>
     71    <xs:complexContent>
     72      <xs:extension base="gmd:MD_Constraints_Type">
     73        <xs:sequence minOccurs="0">
     74          <xs:element name="jurisdictionLink" type="gmd:URL_PropertyType" minOccurs="1"/>
     75          <xs:element name="licenseLink" type="gmd:URL_PropertyType" minOccurs="1"/>
     76          <xs:element name="imageLink" type="gmd:URL_PropertyType" minOccurs="1"/>
     77          <xs:element name="licenseName" type="gco:CharacterString_PropertyType" minOccurs="1"/>
     78        </xs:sequence>
     79        <xs:attribute ref="gco:isoType" use="required" fixed="gmd:MD_Constraints"/>
     80      </xs:extension>
     81    </xs:complexContent>
     82  </xs:complexType>
     83}}}
     84
     85The extension process for adding this new type of constraint, begins with the definition of the new element (gmd:MD_CreativeCommons) and the element it can substitute for (gmd:MD_Constraints).
     86
     87Next the type of this element (gmd:MD_ConstraintsType) is defined as an extension of gmd:MD_Constraints_Type (xs:extension). The new elements that we are extending this type with are then shown in a sequence. Finally, following the ISO guidelines, we define the name of the element that this element can replace (gmd:MD_Constraints) as a fixed value, mandatory attribute (gco:isoType=”gmd:MD_Constraints”) of the new element MD_CreativeCommons.
     88
     89A good reference on this type of profile definition can be found on the Australian SEEGRID site: [https://www.seegrid.csiro.au/twiki/bin/view/AppSchemas/MetadataProfiles]
     90
     91To load the extensions plus the base iso19139 schema, we include the file containing the extensions in the schema directory and in the schema.xsd file. An example from the MCP is as follows:
     92
     93
     94{{{
     95<?xml version="1.0" encoding="UTF-8"?>
     96
     97<xs:schema targetNamespace="http://bluenet3.antcrc.utas.edu.au/mcp" elementFormDefault="qualified"
     98        xmlns:xs="http://www.w3.org/2001/XMLSchema"
     99        xmlns:mcp="http://bluenet3.antcrc.utas.edu.au/mcp"
     100        xmlns:gmd="http://www.isotc211.org/2005/gmd"
     101        xmlns:srv="http://www.isotc211.org/2005/srv">
     102  <xs:include schemaLocation="schema/extensions/mcpExtensions.xsd"/>
     103  <xs:import namespace="http://www.isotc211.org/2005/srv" schemaLocation="schema/srv/srv.xsd"/>
     104</xs:schema>
     105}}}
     106
     107A good way of beginning to define a profile is to copy one of the existing profiles to a new directory and make changes to that.
     108
     109Depending on which elements you have extended, you will need to:
     110
     111 * modify the XSLTs: extract-thumbnails.xsl, extract-uuid.xsl, index-fields.xsl, set-thumbnail.xsl, unset-thumbnail.xsl, update-fixed-info.xsl
     112 * modify the help file: loc/en/labels.xml – note you need only include in here help strings for the new elements you have added to your profile or any from the base standard that you would like to override. GN looks in the base standard help file for anything it can't find here. You will also need to add this file to the <gui> element of web/geonetwork/WEB-INF/config.xml and add your namespace to web/geonetwork/scripts/editor/tooltip.js.
     113 * add any new rules to the schematron file for the base standard (see the schematrons directory in your install) and regenerate the schematron.xsl and schematron_xml.xsl files.
     114
     115'''2 – XSLT sheet for Rendering'''
     116
     117GN uses metadata-iso19139.xsl to render iso19139 schema specific elements in HTML. Your profile will continue to use this because the bulk of the elements in your profile are the standard ones that GN already renders.
     118
     119Following on from the naming convention given earlier, you would name your profile specific XSLT for rendering elements to HTML with the name of the profile included. So for the MCP profile of iso19139, you would use metadata-iso19139.mcp.xsl (this is not mandatory? - needs checking in profiling rules and GN).
     120
     121In this XSLT you define templates to render:
     122
     123 * any specific elements of your profile
     124 * any elements in the base standard that you want to override with different behaviours and
     125 * any profile specific tabs
     126
     127You define the templates for your elements using the same mode as the base standard (in this case iso19139) and you use the namespace you adopted in your extension XSD. You will need to edit metadata-iso19139.xsl to include callbacks to profile specific tabs and to tell GN which tab is the 'simple' tab.
     128
     129You need to include your profile specific XSLT renderer in metadata-utils.xsl.
     130
     131You don't need to tell GN anything else here because GN assumes that any profile that starts with iso19139 (eg. iso19139.mcp) is iso19139 and you will have defined namespace specific actions for the new elements in your profile in your XSLT.
     132
     133=== Proposal ===
     134
     135Modifications to GN
     136
     1371. in XSLT – altering schema= to schema.startsWith etc – done – need a profile_to_ISO XSLT that will process each element, convert back to iso19139 (using gco:isoType) and throw away elements belonging to the additional namespaces – result is iso19139
     1382. in Java – chase down all the schema guessing code – too often this is of the form (schema == 'iso19139') etc – doesn't take note of the fact that a profile may actually be supported locally. CSW and harvesting should apply a profile_to_ISO XSLT (one for all: uses gco:isoType attributes and drops elements with other namespaces) so that the record can be harvested etc
     139
     140Installer packs for National Profiles
     141
     142Why? Shouldn't be necessary to create a branch for profile support. Should be reasonably straight forward to create – maintenance (for maintainers) will be an overhead until callbacks for tab display are removed from metadata-iso19139.xsl under the EditorEnhancements proposal here: [http://trac.osgeo.org/geonetwork/wiki/EditorEnhancements].
     143
     144=== Backwards Compatibility Issues ===
     145
     146Earlier versions need to be supported when harvesting from 2.3 by applying profile_to_ISO XSLT
     147
     148== Risks ==
     149
     150== Participants ==
     151
     152 * As above
     153