Rudy,
have you considered using a database view to join LinkedTable and
Sample1Table? You can then use feature chaining to deliver Sample1
(sourced from the view) nested inside Object1. This approach allows you
to retain the correct normalisation of your database with the link table.
I also note that your example XML contains Sample1 as a direct child of
Object1. This is not permitted by the GML encoding rules. Sample1 must
be enclosed in a property type like:
<Object1>
<name></name>
<desc></desc>
<sample>
<Sample1>
<name></name>
<desc></desc>
</Sample1>
</sample>
</Object1>
GML contains objects and properties, and no element can be both. Objects
can have properties, but cannot directly contain other objects (without
an intervening property). These rules ensure that properties are names
and type information is encoded explicitly in GML instance documents.
From p20-22 of OGC 07-036 (the GML 3.2.1 specification) see discussion
in 7.1 and in particular:
******
7.1.3 XML Schema definition of GML language
The GML schema consists of W3C XML Schema components that define types
and declare
- XML elements to encode GML objects with identity,
- XML elements to encode GML properties of those objects, and
- XML attributes qualifying those properties.
A GML object is an XML element of a type derived directly or indirectly
from gml:AbstractGMLType. From this
derivation, a GML object shall have a gml:id attribute.
A GML property shall not be derived from gml:AbstractGMLType, shall not
have a gml:id attribute, or any
other attribute of XML type ID.
An element is a GML property if and only if it is a child element of a
GML object.
A GML object shall not appear as the immediate child of a GML object.
Consequently, no element may be both a GML object and a GML property.
******
Kind regards,
Ben.
On 14/06/12 00:40, RudyWI wrote:
> Hi,
>
> I try to map 3 tables into 2 features.
> I have these tables :
>
> Object1Table (id int, name varchar, desc text, typeid int)
> LinkedTable (id int, sample1 int, sample2 int, sample3 int)
> Sample1Table (id int, name varchar, desc text)
>
> Relations are
> - Object1Table.typeid -> LinkedTable.id
> - LinkedTable.sample1 -> Sample1Table.id
>
> I want to produce the following feature
> <Object1>
> <name></name>
> <desc></desc>
> <Sample1>
> <name></name>
> <desc></desc>
> </Sample1>
> </Object1>
>
> I have defined the following mapping files :
> - One file to map Object1Table to "Object1" element
> - One file to map Sample1Table to "Sample1" element
>
> But I cannot define mapping file for LinkedTable because I don't have any
> element to map with.
> So I cannot use "FEATURE_LINK" between "Object1" and "Sample1" mapping
> files.
>
> How can I do ?
>
> Best regards,
>
> Rudy
>
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/App-schema-plugin-Mapping-of-3-tables-into-2-features-join-table-tp4981222.html
> Sent from the GeoServer - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
--
Ben Caradoc-Davies <[email protected]>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users