Hi,

I am trying to have a Geoserver display GML its output in the GeodesyML
schema, outlined  here
<https://geoscienceaustralia.github.io/GeodesyML-Github-Pages/>  . In
particular, I am working with GPS monument meta data. For now I'm trying to
just output the siteName in GeodesyML schema when I click GML in the Layers
Preview in Geoserver. The relevant XML schema definition file for GeodesyML
is called monumentInfo.xsd. Unfortunately, I can't seem to get the mapping
correct from my database schema to GeodesyML. In particular I think the
problem is in the <targetElement> or <targetAttribute> fields within
<FeatureTypeMapping>. I concluded that I should use geo:GeodesyML as the
argument to schemaUri because it is the only xsd file with a top level
element (type GeodesyMLType). 

How can I use the schema outlined in the monumentInfo.xsd schema definition?
Specifically here, how can I map site_name in my database schema to siteName
in the GeodesyML schema?

Any help is sincerely appreciated and I apologize if my lack of familiarity
with XML is causing me to ask a silly question. I have done a fair bit of
Google research. The tutorial I followed to get this far is  here
<http://docs.geoserver.org/latest/en/user/data/app-schema/tutorial.html>  ,
with supporting documentation  here
<http://docs.geoserver.org/stable/en/user/data/app-schema/mapping-file.html>  
but they are using GeoscienceML, not GeodesyML.

-Gavin Medley


*The view I am querying, called geoml_monuments contains:*
id | station_code | site_name | geolocation | iers_domex | country_name
I am pretty sure this is fine.



*The monumentsInfo.xsd file:*
https://github.com/GeoscienceAustralia/GeodesyML/blob/master/schemas/monumentInfo.xsd
<https://github.com/GeoscienceAustralia/GeodesyML/blob/master/schemas/monumentInfo.xsd>
  



*The GeodesyML.xsd file:*
https://github.com/GeoscienceAustralia/GeodesyML/blob/master/schemas/geodesyML.xsd
<https://github.com/GeoscienceAustralia/GeodesyML/blob/master/schemas/geodesyML.xsd>
  




*My mapping file:*



<?xml version="1.0" encoding="UTF-8"?>
<as:AppSchemaDataAccess 
        xmlns:as="http://www.geotools.org/app-schema";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://www.geotools.org/app-schema
AppSchemaDataAccess.xsd">
        <namespaces>
                <Namespace>
                        <prefix>geo</prefix>
                        <uri>urn:xml-gov-au:icsm:egeodesy:0.4</uri>
                </Namespace>
                <Namespace>
                        <prefix>gml</prefix>
                        <uri>http://www.opengis.net/gml/3.2</uri>
                </Namespace>
                <Namespace>
                        <prefix>gmd</prefix>
                        <uri>http://www.isotc211.org/2005/gmd</uri>
                </Namespace>
        </namespaces>
        <includedTypes></includedTypes>
        <sourceDataStores>
                <DataStore>
                        <id>thedb</id>
                        <parameters>
                                <Parameter>
                            <name>dbtype</name>
                            <value>postgisng</value>
                        </Parameter>
                        <Parameter>
                            <name>host</name>
                            <value>thedatabaselocation.unavco.org</value>
                        </Parameter>
                        <Parameter>
                            <name>port</name>
                            <value>5432</value>
                        </Parameter>
                        <Parameter>
                            <name>database</name>
                            <value>tst3</value>
                        </Parameter>
                        <Parameter>
                            <name>user</name>
                            <value>theuser</value>
                        </Parameter>
                        <Parameter>
                            <name>passwd</name>
                            <value>thepassword</value>
                        </Parameter>
                    </parameters>
                </DataStore>
        </sourceDataStores>
        <catalog></catalog>
        <targetTypes>
                <FeatureType>
                        
<schemaUri>http://localhost/geodesyML_schemas/geodesyML.xsd</schemaUri>
                </FeatureType>
        </targetTypes>
        <typeMappings>
                <FeatureTypeMapping>
                        <sourceDataStore>thedb</sourceDataStore>
                        <sourceType>geoml_monuments</sourceType>
                        
                        <targetElement>geo:GeodesyML</targetElement>
                        
                        <attributeMappings>
                                <AttributeMapping>
                                        
                                
<targetAttribute>geo:siteIdentificationType/geo:siteName</targetAttribute>
                                        
<sourceExpression><OCQL>site_name</OCQL></sourceExpression>
                                </AttributeMapping>
                                
                        </attributeMappings>
                </FeatureTypeMapping>
        </typeMappings>
</as:AppSchemaDataAccess>




*The output upon clicking GML from Layer Preview:*

<ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:ows="http://www.opengis.net/ows";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/ows
http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd";>
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>
java.lang.RuntimeException: Error applying mapping with targetAttribute
geo:siteIdentificationType/geo:siteName Error applying mapping with
targetAttribute geo:siteIdentificationType/geo:siteName
geo:siteIdentificationType is not a valid location path for type
urn:xml-gov-au:icsm:egeodesy:0.4:GeodesyMLType. geo:siteIdentificationType
ns: urn:xml-gov-au:icsm:egeodesy:0.4, GeodesyMLType properties:
http://www.opengis.net/gml/3.2#metaDataProperty,
http://www.opengis.net/gml/3.2#description,
http://www.opengis.net/gml/3.2#descriptionReference,
http://www.opengis.net/gml/3.2#identifier,
http://www.opengis.net/gml/3.2#name,
http://www.opengis.net/gml/3.2#boundedBy,
http://www.opengis.net/gml/3.2#location,
http://www.opengis.net/gml/3.2#validTime,
urn:xml-gov-au:icsm:egeodesy:0.4#Node,
urn:xml-gov-au:icsm:egeodesy:0.4#AbstractPosition,
urn:xml-gov-au:icsm:egeodesy:0.4#PositionPairCovariance,
urn:xml-gov-au:icsm:egeodesy:0.4#Site,
urn:xml-gov-au:icsm:egeodesy:0.4#siteVisit,
urn:xml-gov-au:icsm:egeodesy:0.4#Monument,
urn:xml-gov-au:icsm:egeodesy:0.4#SupplementaryMark,
urn:xml-gov-au:icsm:egeodesy:0.4#AbstractMeasurement,
urn:xml-gov-au:icsm:egeodesy:0.4#Instrument,
urn:xml-gov-au:icsm:egeodesy:0.4#Sensor,
urn:xml-gov-au:icsm:egeodesy:0.4#AbstractPositionSource,
urn:xml-gov-au:icsm:egeodesy:0.4#AbstractPositionEstimator,
urn:xml-gov-au:icsm:egeodesy:0.4#AbstractMeasurementSource,
urn:xml-gov-au:icsm:egeodesy:0.4#AbstractMeasurementOperation,
urn:xml-gov-au:icsm:egeodesy:0.4#AbstractDefinitionSource,
urn:xml-gov-au:icsm:egeodesy:0.4#AbstractDefinitionOperation,
urn:xml-gov-au:icsm:egeodesy:0.4#AbstractSiteLog,
urn:xml-gov-au:icsm:egeodesy:0.4#Project,
urn:xml-gov-au:icsm:egeodesy:0.4#Document,
urn:xml-gov-au:icsm:egeodesy:0.4#Setup,
urn:xml-gov-au:icsm:egeodesy:0.4#TerrestrialReferenceFrame,
urn:xml-gov-au:icsm:egeodesy:0.4#DynamicTransformation,
http://www.opengis.net/gml/3.2#AbstractCRS, null#FEATURE_LINK,
null#FEATURE_LINK
</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/App-Schema-Mapping-File-to-GeodesyML-tp5324416.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to