52North / GEO-label-java

A Java implementation of the GEO label, including client and server module and a standalone generator for GEO labels.
http://geolabel.info/
Apache License 2.0
4 stars 7 forks source link

Add metadata element #60

Open nuest opened 9 years ago

nuest commented 9 years ago

Allow to trigger a full include of the original document via the API, e.g. parameter include=source. This inserts one svg:metadata element into the svg containing the full input documents as children of XML elements named after the input parameters, e.g.:

<svg:svg id="NA" height="200" width="200" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1">
    <svg:title>A GEO label</svg:title>
    <svg:metadata>
        <geolabel />
        <metadata><!-- full ISO document --></metadata>
        <feeback><!-- full feedback summary --></feedback>
        <!-- missing parameters as empty elements -->
        <parent_metadata />
        <parent_feedback />
    </svg:metadata>
    <svg:svg viewBox="0 0 200 200" preserveAspectRatio="xMinYMin meet">
<!-- rest of the label -->

See http://www.w3.org/TR/SVG/metadata.html#MetadataElement

If the parameter is not set to source, then the metadata element contains the original URL of the metadata and feedback documents if the GET API is used, or the element(s) are missing if the POST API is used. In any case the metadata element publicly announces that it contains information about a GEO label using the element geolabel with arbitrary content. XPaths checking against existance of this element can be used to identify an SVG as a GEO label.

Example for include != source:

<svg:svg id="NA" height="200" width="200" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1">
    <svg:title>A GEO label</svg:title>
    <svg:metadata>
        <geolabel version="1" provider="52N GEO-labal-java">true</geolabel>
        <metadata>http://schemas.geoviqua.org/GVQ/4.0/example_documents/PQMs/DigitalClimaticAtlas_mt_an_GEOlabel.xml</metadata>
        <feeback>http://schemas.geoviqua.org/GVQ/4.0/example_documents/UQMs/example_feedback_summary.xml</feedback>
    </svg:metadata>
    <svg:metadata><!-- non GEO label metadata elements... --></svg:metadata>
    <svg:svg viewBox="0 0 200 200" preserveAspectRatio="xMinYMin meet">
<!-- rest of the label -->