| 1 | = Configurable thesaurus concept selection = |
| 2 | |
| 3 | || '''Date''' || 2011-10-26 || |
| 4 | || '''Contact(s)''' || Francois Prunayre || |
| 5 | || '''Status''' || Being discussed, in progress, initial implementation in progress || |
| 6 | || '''Assigned to release''' || 2.9.x || |
| 7 | || '''Resources''' || Available || |
| 8 | || '''Ticket #''' || #XYZ || |
| 9 | || '''Github dev branch ''' || https://github.com/fxprunayre/core-geonetwork/commits/feature/registers-transformations || |
| 10 | |
| 11 | == Overview == |
| 12 | |
| 13 | Configure transformation in order to use thesaurus to add different types of elements (eg. use a concept to add a keyword or an extent). |
| 14 | |
| 15 | === Proposal Type === |
| 16 | * '''Type''': GUI Change, Schema Change |
| 17 | * '''App''': !GeoNetwork |
| 18 | * '''Module''': Schema |
| 19 | |
| 20 | === Links === |
| 21 | * '''Documents''': |
| 22 | |
| 23 | === Voting History === |
| 24 | * Vote not yet proposed. |
| 25 | |
| 26 | == Motivations == |
| 27 | |
| 28 | == Proposal == |
| 29 | |
| 30 | |
| 31 | === Adding transformations === |
| 32 | |
| 33 | XSL transformations mapped raw format for keyword to a XML snippet of the target schema. They are defined per schema plugins in a convert/thesaurus-transformation.xsl. |
| 34 | |
| 35 | {{{ |
| 36 | <xsl:include href="blanks/metadata-schema01/convert/thesaurus-transformation.xsl"/> |
| 37 | }}} |
| 38 | This transformation file define as many template as required: |
| 39 | {{{ |
| 40 | <xsl:template name="to-iso19139-keyword"> |
| 41 | <xsl:param name="withAnchor" select="false()"/> |
| 42 | <xsl:param name="withXlink" select="false()"/> |
| 43 | |
| 44 | <gmd:MD_Keywords> |
| 45 | ... |
| 46 | }}} |
| 47 | |
| 48 | Naming convention for template: to-{schemaIdentifier}-{outputDescription}. |
| 49 | |
| 50 | |
| 51 | The raw format is the following and remain unchanged with previous !GeoNetwork release: |
| 52 | {{{ |
| 53 | <keyword> |
| 54 | <selected>false</selected> |
| 55 | <id>0</id> |
| 56 | <value language="eng">Agricultural and aquaculture facilities</value> |
| 57 | <definition language="eng"/> |
| 58 | <defaultLang>eng</defaultLang> |
| 59 | <thesaurus> |
| 60 | <key>external.theme.inspire-theme</key> |
| 61 | <title>GEMET - INSPIRE themes, version 1.0</title> |
| 62 | <date>2008-06-01</date> |
| 63 | <type>theme</type> |
| 64 | <url>http://localhost:8080/geonetwork/srv/en/thesaurus.download?ref=external.theme.inspire-theme</url> |
| 65 | </thesaurus> |
| 66 | <uri>http://rdfdata.eionet.europa.eu/inspirethemes/themes/22</uri> |
| 67 | <values> |
| 68 | <value language="eng">Agricultural and aquaculture facilities</value> |
| 69 | </values> |
| 70 | <definitions> |
| 71 | <definition language="eng"/> |
| 72 | </definitions> |
| 73 | </keyword> |
| 74 | }}} |
| 75 | |
| 76 | === Using the transformation === |
| 77 | |
| 78 | A transformation parameter is added to the xml.keyword.get service in order to choose the mapping to use. For example, to create a gmd:descriptiveKeyword section in ISO19139, 3 transformations are defined: |
| 79 | * ISO19139 with CharacterString: |
| 80 | http://localhost:8080/geonetwork/srv/eng/xml.keyword.get?thesaurus=external.theme.inspire-theme&id=http://rdfdata.eionet.europa.eu/inspirethemes/themes/22,http://rdfdata.eionet.europa.eu/inspirethemes/themes/30&multiple=true&transformation=to-iso19139-keyword |
| 81 | * ISO19139 with Anchor: |
| 82 | http://localhost:8080/geonetwork/srv/eng/xml.keyword.get?thesaurus=external.theme.inspire-theme&id=http://rdfdata.eionet.europa.eu/inspirethemes/themes/22,http://rdfdata.eionet.europa.eu/inspirethemes/themes/30&multiple=true&transformation=to-iso19139-keyword-with-anchor |
| 83 | * ISO19139 with Anchor: TODO |
| 84 | http://localhost:8080/geonetwork/srv/eng/xml.keyword.get?thesaurus=external.theme.inspire-theme&id=http://rdfdata.eionet.europa.eu/inspirethemes/themes/22,http://rdfdata.eionet.europa.eu/inspirethemes/themes/30&multiple=true&transformation=to-iso19139-keyword-with-anchor |
| 85 | |
| 86 | * ISO19139 extent element : |
| 87 | http://localhost:8080/geonetwork/srv/eng/xml.keyword.get?thesaurus=external.place.regions&id=http://geonetwork-opensource.org/regions%232&multiple=true&transformation=to-iso19139-extent |
| 88 | |
| 89 | |
| 90 | === Define which transformation to use according to the element type === |
| 91 | |
| 92 | {{{ |
| 93 | <!-- |
| 94 | registerAssociation : hold associations between elements ISO element and the thesaurus to propose for that element. |
| 95 | --> |
| 96 | <registerAssociation registerId="local://thesaurus/external.place.regions" element="gmd:extent"/> |
| 97 | <registerAssociation registerId="local://thesaurus/external.place.regions" element="gmd:descriptiveKeywords"/> |
| 98 | <registerAssociation registerId="local://thesaurus/external.theme.inspire-theme" element="gmd:descriptiveKeywords"/> |
| 99 | |
| 100 | <!-- |
| 101 | registerTransformation : hold associations between elements ISO element and the template to use for its transformation from SKOS format. |
| 102 | --> |
| 103 | <registerTransformation element="gmd:extent" xslTpl='to-iso19139-gmd_extent'/> |
| 104 | <registerTransformation element="gmd:descriptiveKeywords" xslTpl='to-iso19139-keywords'/> |
| 105 | <registerTransformation element="gmd:descriptiveKeywords" xslTpl='to-iso19139-keywords-with-anchor'/> |
| 106 | <registerTransformation element="gmd:descriptiveKeywords" xslTpl='to-iso19139-keywords-with-xlink'/> |
| 107 | }}} |
| 108 | |
| 109 | A new service is added to retrieve the list of transformation: |
| 110 | * schema.register.get?schema={schemaIdentifier}&element={elementName} |
| 111 | |
| 112 | === Editor widget for adding elements === |
| 113 | |
| 114 | Widget configuration: |
| 115 | * renderTo : null if popup mode, identifier of the DOM element for inline mode |
| 116 | * elementType : element type to edit (eg. gmd:descriptiveKeywords) |
| 117 | * transformations : array of transformations (use to override the server configuration) |
| 118 | * thesaurus : array of thesaurus (use to override the server configuration) |
| 119 | * defaultThesaurus : thesaurus identifier to select by default (null by default) |
| 120 | * keywords : Store of select keyword (uri, value, thesaurus, xmin, ymin, xmax, ymax) |
| 121 | * lang : search language (default is GUI language) |
| 122 | * allowSearch : display search filter or not (default is true) |
| 123 | * searchOnLoad : trigger search on load |
| 124 | |
| 125 | |
| 126 | {{{ |
| 127 | <div class='thesaurusPicker' config='...'/> |
| 128 | }}} |
| 129 | |
| 130 | |
| 131 | === Backwards Compatibility Issues === |
| 132 | |
| 133 | |
| 134 | === New libraries added === |
| 135 | |
| 136 | None. |
| 137 | |
| 138 | == Risks == |
| 139 | |
| 140 | Everything involves some element of risk.... |
| 141 | |
| 142 | == Participants == |
| 143 | |
| 144 | * Francois Prunayre |
| 145 | * Others? |