Andrea,
I think you are right.
Deen, generics.xsd in CityGML does not appear to be a GML application schema because it violates the GML encoding rule. It appears to be a mechanism to encode generic weak types. This schema does not follow the GML property model. For this schema to be supported by app-schema, it would need gen:value to be enclosed by an additional complex type; this extra layer encodes type information in case a subclass is used to create a derived type. For example, something like this:
<bldg:Building gml:id="BLDG_0003000b0009a940">
<gen:stringAttribute>
<gen:StringAttribute>
<gen:value>09030374</gen:value>
</gen:StringAttribute>
</gen:stringAttribute>
</bldg:Building>
Subclasses of StringAttribute might add properties that support, for example, internationalisation. Imagine a type called InternationalisedStringAttribute. Because generics.xsd violates the GML encoding rule and omits this layer, a consumer of such an instance document has no way of determining the type because it cannot know if the element contained in gen:stringAttribute is a subclass.
See section 7.1.1 on page 20-21 (PDF page 30-31) of the GML 3.2.1 standard (OGC 07-036):
http://portal.opengeospatial.org/files/?artifact_id=20509
The rule is the same for (GML 3.1.1).
Kind regards,
Ben.
On 12/05/16 02:19, Andrea Aime wrote:
Hi Deen,
I'm not 100% sure (still a novice in app-schema) but it seems to me this
XML schema is violating
the "GML striping" rule. From the documentation:
-----
Note that the GML encoding rules require that complex types are never the
direct property of another complex type; they are always contained in a
property type to ensure that their type is encoded in a surrounding
element. Encoded GML is always type/property/type/property. This is also
known as the GML “striping” rule.
-----
http://docs.geoserver.org/latest/en/user/data/app-schema/mapping-file.html
If that's the case, app-schema might just not be able to encode it.
Hopefully someone more experienced
will follow up confirming this, or showing a way to do what you want
Cheers
Andrea
On Tue, May 10, 2016 at 5:20 PM, Deen <kensongzhu@anonymised.com> wrote:
Hi everyone,
currently I am trying to map the feature type 'Building' of CityGML with
geoserver application schema and I came across some problems when i tried
to map the generic attributes of the buildings. One of feature types about
the generic attributes of the building is "stringAttribute",which is
defined in http://schemas.opengis.net/citygml/generics/2.0/generics.xsd,
and what i want is just chaining two feature types "buildng" and
"stringAttribute"
Here is the a piece of my mapping file "bldg_Building.xml"
<typeMappings>
<FeatureTypeMapping>
<sourceDataStore>bldg</sourceDataStore>
<sourceType>v1_bldg_building</sourceType>
<targetElement>bldg:Building</targetElement>
......
<AttributeMapping>
<targetAttribute>core:_GenericApplicationPropertyOfCityObject</targetAttribute>
<sourceExpression>
<OCQL>id</OCQL>
<linkElement>gen:stringAttribute</linkElement>
<linkField>FEATURE_LINK</linkField>
</sourceExpression>
<targetAttributeNode>gen:StringAttributeType</targetAttributeNode>
</AttributeMapping>
......
<typeMappings>
Here is the a piece of my mapping file "gen_stringAttribute.xml"
<typeMappings>
<FeatureTypeMapping>
<sourceDataStore>bldg</sourceDataStore>
<sourceType>v1_gen_string_attr</sourceType>
<targetElement>gen:stringAttribute</targetElement>
.......
<AttributeMapping>
<targetAttribute>FEATURE_LINK</targetAttribute>
<sourceExpression>
<OCQL>cityobject_id</OCQL>
</sourceExpression>
</AttributeMapping>
......
</typeMappings>
Here is What I got from WFS of geoserver :
<gml:featureMember>
<bldg:Building gml:id="BLDG_0003000b0009a940">
<core:_GenericApplicationPropertyOfCityObject>
[FeatureImpl:stringAttribute<StringAttributeType
id=DENK_ID>=[AttributeImpl:value<string>=09030374]]
<gen:stringAttribute>
<gen:value>09030374</gen:value>
</gen:stringAttribute>
</core:_GenericApplicationPropertyOfCityObject>
<core:_GenericApplicationPropertyOfCityObject>
<gen:stringAttribute>
<gen:value>09030374</gen:value>
</gen:stringAttribute>
</core:_GenericApplicationPropertyOfCityObject>
.....
My question is if there is any way to link two feature types without
"container" attribute "core:_GenericApplicationPropertyOfCityObject",
because the standard GML file is something like
<bldg:Building gml:id="BLDG_0003000b0009a940">
<gen:stringAttribute>
<gen:value>09030374</gen:value>
</gen:stringAttribute>
<gen:stringAttribute>
<gen:value>0903387</gen:value>
</gen:stringAttribute>
......
This problem is bugging me for a while and any help I would really
appreciate
Thanks
Deen
*gen_stringAttribute.xml* (3K) Download Attachment
<http://osgeo-org.1560.x6.nabble.com/attachment/5265622/0/gen_stringAttribute.xml>
*bldg_Building.xml* (6K) Download Attachment
<http://osgeo-org.1560.x6.nabble.com/attachment/5265622/1/bldg_Building.xml>
------------------------------
View this message in context: Problems with CityGML and application schema
<http://osgeo-org.1560.x6.nabble.com/Problems-with-CityGML-and-application-schema-tp5265622.html>
Sent from the GeoServer - User mailing list archive
<http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html> at
Nabble.com.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data
untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <http://transient.nz/>
New Zealand