[Geoserver-users] App-schema extension: fail to map om: namespace attributes

Hi,

My exercise is to apply Observations&Measurements for my own observation
database in PostGIS

I defined myns:Observation as specialization of om:OM_Observation, so
myns:Observation inherits all attributes from om: and has its own.

I mapped it like this:
<FeatureTypeMapping>
      <sourceDataStore>datastore</sourceDataStore>
      <sourceType>testdata_toc</sourceType>
      <targetElement>toc2:Observation</targetElement>
      <attributeMappings>
        <AttributeMapping>
          <targetAttribute>toc2:Observation</targetAttribute>
          <idExpression>
            <OCQL>Concatenate('OB_', occ_type, occ_id)</OCQL>
          </idExpression>
        </AttributeMapping>
        <AttributeMapping>
          <targetAttribute>om:phenomenonTime</targetAttribute>
          <idExpression>
            <OCQL>Concatenate('T_', occ_type, occ_id)</OCQL>
          </idExpression>
          <targetAttributeNode>gml:TimeInstantPropertyType</targetAttributeNode>
        </AttributeMapping>
        <AttributeMapping>
        
<targetAttribute>om:phenomenonTime/gml:TimeInstant/gml:timePosition</targetAttribute>
          <sourceExpression>
            <OCQL>timespan_begin</OCQL>
          </sourceExpression>
          <ClientProperty>
            <name>frame</name>
            <value>'#ISO-8601'</value>
          </ClientProperty>
        </AttributeMapping>

I also defined namespace element in mapping, added secondary workspace om:
and have app-schema-cache for om.
    <Namespace>
      <prefix>om</prefix>
      <uri>"http://www.opengis.net/om/2.0&quot;&lt;/uri&gt;
    </Namespace>
I did everything I could find on Geoserver documentation pages to secure
reading of om: namespace, but still have exception:
Internal error occurred Error applying mapping with targetAttribute
toc2:Observation Error applying mapping with targetAttribute om:metadata
om:metadata is not a valid location path for type
http://loom-gis.geo.ut.ee/ermas/schemas/toc2:ObservationType.
om:phenomenonTime ns: "http://www.opengis.net/om/2.0&quot;, ObservationType
properties: ..... http://www.opengis.net/om/2.0#type,
http://www.opengis.net/om/2.0#metadata,
http://www.opengis.net/om/2.0#relatedObservation,
http://www.opengis.net/om/2.0#phenomenonTime,
http://www.opengis.net/om/2.0#resultTime, .... etc.

Is it something esle I need to define to be able to read om: elements?

Looking forward for your reply.....
Valentina

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/App-schema-extension-fail-to-map-om-namespace-attributes-tp5138766.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Valentina,

there should not be quotes inside the <uri> element:
<uri>"http://www.opengis.net/om/2.0&quot;&lt;/uri&gt;

app-schema is lenient and will allow you to include quotes in your namespace! This is incorrect.

Instead use this:
<uri>http://www.opengis.net/om/2.0&lt;/uri&gt;

Kind regards,
Ben.

On 06/05/14 16:22, Valentina Sagris wrote:

Hi,

My exercise is to apply Observations&Measurements for my own observation
database in PostGIS

I defined myns:Observation as specialization of om:OM_Observation, so
myns:Observation inherits all attributes from om: and has its own.

I mapped it like this:
<FeatureTypeMapping>
      <sourceDataStore>datastore</sourceDataStore>
      <sourceType>testdata_toc</sourceType>
      <targetElement>toc2:Observation</targetElement>
      <attributeMappings>
        <AttributeMapping>
          <targetAttribute>toc2:Observation</targetAttribute>
          <idExpression>
            <OCQL>Concatenate('OB_', occ_type, occ_id)</OCQL>
          </idExpression>
        </AttributeMapping>
        <AttributeMapping>
          <targetAttribute>om:phenomenonTime</targetAttribute>
          <idExpression>
            <OCQL>Concatenate('T_', occ_type, occ_id)</OCQL>
          </idExpression>
          <targetAttributeNode>gml:TimeInstantPropertyType</targetAttributeNode>
        </AttributeMapping>
        <AttributeMapping>
        
<targetAttribute>om:phenomenonTime/gml:TimeInstant/gml:timePosition</targetAttribute>
          <sourceExpression>
            <OCQL>timespan_begin</OCQL>
          </sourceExpression>
          <ClientProperty>
            <name>frame</name>
            <value>'#ISO-8601'</value>
          </ClientProperty>
        </AttributeMapping>

I also defined namespace element in mapping, added secondary workspace om:
and have app-schema-cache for om.
    <Namespace>
      <prefix>om</prefix>
      <uri>"http://www.opengis.net/om/2.0&quot;&lt;/uri&gt;
    </Namespace>
I did everything I could find on Geoserver documentation pages to secure
reading of om: namespace, but still have exception:
Internal error occurred Error applying mapping with targetAttribute
toc2:Observation Error applying mapping with targetAttribute om:metadata
om:metadata is not a valid location path for type
http://loom-gis.geo.ut.ee/ermas/schemas/toc2:ObservationType.
om:phenomenonTime ns: "http://www.opengis.net/om/2.0&quot;, ObservationType
properties: ..... http://www.opengis.net/om/2.0#type,
http://www.opengis.net/om/2.0#metadata,
http://www.opengis.net/om/2.0#relatedObservation,
http://www.opengis.net/om/2.0#phenomenonTime,
http://www.opengis.net/om/2.0#resultTime, .... etc.

Is it something esle I need to define to be able to read om: elements?

Looking forward for your reply.....
Valentina

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/App-schema-extension-fail-to-map-om-namespace-attributes-tp5138766.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

Uff, so stupid of me....

thanks a lot Ben
and apologies for junk posting
Valentina

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/App-schema-extension-fail-to-map-om-namespace-attributes-tp5138766p5138789.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

No problem at all. Taking the time to ask your question on the lists helps others searching for solutions, so thanks!

Kind regards,
Ben.

On 06/05/14 17:33, Valentina Sagris wrote:

Uff, so stupid of me....

thanks a lot Ben
and apologies for junk posting
Valentina

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre