Feature chaining (feature links) always produce a feature type, i.e. this
functionality cannot
be used to map multivalued attributes that are of a primitive type (e.g.
String, Integers, etc ...).
Unless I missed something using Ben suggestion is the only way of achieving
this with App-Schema right now.
On 09/22/2017 09:21 PM, Ben Caradoc-Davies wrote:
It looks like you are trying to map a ModelView into an individualName
property, which is of type xs:string. This does not make sense, so app-schema
converts the ModelView to its Java String representation as a final fallback.
Have you considered using a denormalised source table? This works for gml:name
and will likely work for gsmlp:individualName:
http://docs.geoserver.org/latest/en/user/data/app-schema/mapping-file.html#denormalised-sources
Kind regards,
Ben.
On 23/09/17 00:33, aquentin wrote:
Hi,
In order to better understand the problem, many details added :
I'm trying to use app schema to expose a simple feature that have attributes
with cardinality 0...N.
The xsd is here and concern modelview=>
https://forge.brgm.fr/svnrepository/epos/trunk/schemas/epos-lite.xsd
for example :
element name="individualName" type="string" maxOccurs="unbounded">
<annotation>
<documentation>Name of the author(s).</documentation>
</annotation>
</element>
In database, I create one table "modelview" with foreign key to another
table "individualname", to respect multiplicity.
I tried to use feature link but an error raised "No top level element found
in schemas". It shouldn't be the good manner to do mapping.
I tried FEATURE LINK as is :
in modelview mapping :
...
<includedTypes>
<Include>mapping_individualname.xml</Include>
</includedTypes>
...
<FeatureTypeMapping>
<isDenormalised>false</isDenormalised>
<sourceDataStore>datastore</sourceDataStore>
<sourceType>modelview</sourceType>
<targetElement>gsmlp:ModelView</targetElement>
<attributeMappings>
<AttributeMapping>
<targetAttribute>gsmlp:ModelView</targetAttribute>
<idExpression>
<OCQL>modelid</OCQL>
</idExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>gsmlp:individualName</targetAttribute>
<sourceExpression>
<OCQL>modelid</OCQL>
<linkElement>individualNameType</linkElement>
<linkField>FEATURE_LINK</linkField>
</sourceExpression>
<isMultiple>true</isMultiple>
</AttributeMapping>
and in mapping_individualname.xml file :
<typeMappings>
<FeatureTypeMapping>
<isDenormalised>false</isDenormalised>
<sourceDataStore>datastore</sourceDataStore>
<sourceType>modelview_individualname</sourceType>
<targetElement>gsmlp:ModelView</targetElement>
<mappingName>individualNameType</mappingName>
<attributeMappings>
<AttributeMapping>
<targetAttribute>gsmlp:individualName</targetAttribute>
<sourceExpression>
<OCQL>individualname</OCQL>
</sourceExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>FEATURE_LINK</targetAttribute>
<sourceExpression>
<OCQL>modelid</OCQL>
</sourceExpression>
</AttributeMapping>
</attributeMappings>
</FeatureTypeMapping>
</typeMappings>
but the output here
(https://epos.brgm-rec.fr/geoserver/ows?service=wfs&version=2.0.0&request=GetFeature&typenames=gsmlp:ModelView&OUTPUTFORMAT=GML3)
is not really what I'm waiting for :
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd6>=[AttributeImpl:individualName<string>=G.
Courrioux]
</gsmlp:individualName>
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd5>=[AttributeImpl:individualName<string>=S.
Gabalda]
</gsmlp:individualName>
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd4>=[AttributeImpl:individualName<string>=C.
Allanic]
</gsmlp:individualName>
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd3>=[AttributeImpl:individualName<string>=K.
Schulmann]
</gsmlp:individualName>
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd2>=[AttributeImpl:individualName<string>=E.
Skrzypek]
</gsmlp:individualName>
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd1>=[AttributeImpl:individualName<string>=A.
Guillen]
</gsmlp:individualName>
thank you
Regards.
--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html
------------------------------------------------------------------------------
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
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==
Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i
file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo
è consentito esclusivamente al destinatario del messaggio, per le finalità
indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne
il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di
procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro
sistema. Conservare il messaggio stesso, divulgarlo anche in parte,
distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse,
costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.
------------------------------------------------------------------------------
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
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users