Hi Julián, Like Ben said ValueReference is not yet supported with app-schema (although this may change soon if IGN work gets committed). This would explain why your filter results return the wrong results with property files.
GetFeature: asking for an AdminUnitName that is situatedwithin the AdminUnitName which name is 'Castilla y León' ---------------------------------------------------------------------------------------------------------------- http://localhost:8080/geoserver/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAME=ad:AdminUnitName&FILTER=<Filter><PropertyIsEqualTo><ValueReference>ad:situatedWithin/ad:AdminUnitName/ad:name/gn:GeographicalName/gn:spelling/gn:SpellingOfName/gn:text</ValueReference><Literal>Castilla y León</Literal></PropertyIsEqualTo></Filter> Response when the datastore is a properties file ------------------------------------------------ <wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:gn="urn:x-inspire:specification:gmlas:GeographicalNames:3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:base="urn:x-inspire:specification:gmlas:BaseTypes:3.2" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ad="urn:x-inspire:specification:gmlas:Addresses:3.0" numberMatched="unknown" numberReturned="1" timeStamp="2013-03-14T09:05:26.612Z" xsi:schemaLocation="urn:x-inspire:specification:gmlas:Addresses:3.0 http://inspire.ec.europa.eu/schemas/ad/3.0/Addresses.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd"> <wfs:member> <ad:AdminUnitName gml:id="AUN_PRO_400000000000"> <ad:inspireId> <base:Identifier> <base:localId>PRO_400000000000</base:localId> <base:namespace>ES.CNIG.CARTOCIUDAD</base:namespace> </base:Identifier> </ad:inspireId> <ad:beginLifespanVersion>2012-07-05T14:13:16Z</ad:beginLifespanVersion> <ad:situatedWithin href="http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=ad:AdminUnitName&FEATUREID=AUN_COM_07"/> <ad:name> <gn:GeographicalName> <gn:spelling> <gn:SpellingOfName> <gn:text>Segovia</gn:text> </gn:SpellingOfName> </gn:spelling> </gn:GeographicalName> </ad:name> <ad:level codeSpace="urn:x-inspire:specification:gmlas:AdministrativeUnits:3.0/AdministrativeHierarchyLevel">3rdOrder</ad:level> </ad:AdminUnitName> </wfs:member> </wfs:FeatureCollection> The error with Oracle might be caused by a bug in 2.2.1 version. Try the latest 2.3 instead. Also I noticed you're not using joining. Turning joining on will improve performance if you have a large dataset (although it won't have much impact if you're only using up to 100 features for testing). More info: http://gridlock.opengeo.org/geoserver/2.3.x/doc/en/user/data/app-schema/joining.html#configuration Cheers Rini -----Original Message----- From: Caradoc-Davies, Ben (CESRE, Kensington) Sent: Monday, 18 March 2013 1:24 PM To: Julián González Cc: [email protected]; Angreani, Rini (CESRE, Kensington) Subject: Re: [Geoserver-users] App-Schema plugin, mapping the Address model of INSPIRE Julián, I had a look at your sample queries. app-schema does not support WFS 2.0.0 (the parts also in WFS 1.1.0 work by accident). In particular, app-schema does not yet support ValueReference. See here: http://osgeo-org.1560.n6.nabble.com/Some-GeoServer-2-3-x-app-schema-GeoSciML-v3-GML-3-2-application-schema-tests-td5035802.html I do not know why this appears to work for a property file. Rini? I am aware of a proposal to improve WFS 2.0.0 support, but it is not yet underway. Kind regards, Ben. On 14/03/13 18:17, Julián González wrote: > Sorry for this late reply. > > I was out of the project for months and now I'm working on it again. > > I've made some test and I'm getting very confused. > > First of all I've simplified my schema, now I'm using only one feature > type from the INSPIRE Address Schema which is AdminUnitName that has a > self relationship called situatedwithin. I think that the names are > descriptive enough. More info on: > http://inspire.jrc.ec.europa.eu/documents/Data_Specifications/INSPIRE_ > DataSpecification_AD_v3.0.1.pdf > > If the data store is a property file everything works fine, but if the > data store is an Oracle database nothing works fine. > > I've 'zipped', the geoserver data dir with the java property file, the > SQL script files to generate the table and populate it with the same > data contained in the property file, and the WFS queries that I'm > doing to the server to reproduce the errors. The log file in the > geoserver data dir contains the log generated by this process: > > 1.- Start the tomcat service > 2.- Do three WFS GetFeature queries. > 3.- Stop the server > Change the datastore to the Oracle Database > 4.- Start the tomcat service > 5.- Do three WFS GetFeature queries. > 6.- Stop the server > > The zip file can be dowloaded from: http://sdrv.ms/WpbxYW > > Could someone check what I'm doing bad? > > Thanks in advance. > > 2012/11/26 Ben Caradoc-Davies <[email protected] > <mailto:[email protected]>> > > On 19/11/12 19:44, Julián González wrote: > > Is it possible to add the referenced AdministrativeUnitName, > > PostalDescriptor and ThoroughfareName at the end of the xml response? > > No. The included features are specified by the Web Feature Service > standard: only those features matching a filter query are encoded, > and nested properties are encoded inside those features or by > reference. While it is possible to include additional types at the > top level, they will not be related to features of another type. > > Client applications should be able to use the xlink:href obtained > from a response to make a second query to resolve a nested feature. > > > > I've read that it's impossible to ask for a feature referenced by an > > xlink:href, then we can't ask the service for the addresses of a > certain > > thoroughfarename, can we? I suposse that the only way is to > change the > > type of the component property to a gml:AbstractFeature, isn't it? > > I am not quite sure what you are asking. Are you talking about a > filter query on xlink:href? This is possible where it is created > using feature chaining and you are querying a nested property (users > like this but I am not sure that it is valid use of WFS!). I am not > sure this is what you mean. Do you have an example? > > Kind regards, > Ben. > > > > On 19/11/12 19:44, Julián González wrote: > > Hi list. > > I'm trying to map a custom address model to the address model of > INSPIRE > using de app-schema plugin (version 2.2.1). > There is a relationship between two featuretypes, Address and > AddressComponent (an abstract feature), called component in the > first > featuretype. > > There are some subtypes of AddressComponent: AdministrativeUnitName, > PostalDescriptor, ThoroughfareName,... > In the xsd, the component property of the Address featuretype is > defined > like this: > > <element maxOccurs="unbounded" name="component"> > <annotation> > <documentation> > -- Definition -- Represents that the address component is > engaged as a part of the address. -- Description -- EXAMPLE For the > address designated "Calle Mayor 13, Cortijo del Marqués, 41037, > Écija, > Sevilla, España" the six address components "Calle Mayor", > "Cortijo del > Marqués", "41037", "Écija", "Sevilla" and "España" are engaged as > address components. > </documentation> > <appinfo> > <targetElement > xmlns="http://www.opengis.net/__gml/3.2 > > <http://www.opengis.net/gml/3.2>">ad:AddressComponent</__targetElement> > </appinfo> > </annotation> > <complexType> > <complexContent> > <extension base="gml:AbstractMemberType"> > <sequence/> > <attributeGroup ref="gml:__AssociationAttributeGroup"/> > </extension> > </complexContent> > </complexType> > </element> > > Then I've understood that: > > - An address must have one or more components. > - The xml element of the component property has no content but > it has an > xlink:href attribute pointing to an AdministrativeunitName or a > PostalDescriptor or a Thorougfarename > > The Attribue mapping of the component property for a > ThoroughfareName is: > > <AttributeMapping> > <targetAttribute>ad:component<__/targetAttribute> > <targetAttributeNode>ad:__ThoroughfareNameType</__targetAttributeNode> > <sourceExpression> > <OCQL>XLINK2COMPONENT</OCQL> > <linkElement>ad:__ThoroughfareName</linkElement> > <linkField>ad:inspireId/base:__Identifier/base:localId</__linkField> > </sourceExpression> > <isMultiple>true</isMultiple> > <ClientProperty> > <name>xlink:href</name> > > <value>strConcat('http://__localhost:8080/geoserver/wfs?__request=GetFeature&__version=2.0.0&typeName=ad:__ThoroughfareName&__FEATUREID= > > <http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=ad:ThoroughfareName&FEATUREID=> > > <http://localhost:8080/__geoserver/wfs?request=__GetFeature&version=2.0.0&__amp;typeName=ad:__ThoroughfareName&__FEATUREID= > > <http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=ad:ThoroughfareName&FEATUREID=>>', > GMLID)</value> > </ClientProperty> > </AttributeMapping> > > In this way, an Address served by the wfs service is: > > <ad:Address gml:id="AD_PPK_000000000001"> > ... a lot of xml elements ... > <ad:component > > href="http://localhost:8080/__geoserver/wfs?request=__GetFeature&version=2.0.0&__typeName=ad:ThoroughfareName&__FEATUREID=TH_VIA_000000000001 > > <http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=ad:ThoroughfareName&FEATUREID=TH_VIA_000000000001> > > <http://localhost:8080/__geoserver/wfs?request=__GetFeature&version=2.0.0&__typeName=ad:ThoroughfareName&__FEATUREID=TH_VIA_000000000001 > > <http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=ad:ThoroughfareName&FEATUREID=TH_VIA_000000000001>>__"/> > <ad:component > > href="http://localhost:8080/__geoserver/wfs?request=__GetFeature&version=2.0.0&__typeName=ad:AdminUnitName&__FEATUREID=AUN_MUN_000000040194 > > <http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=ad:AdminUnitName&FEATUREID=AUN_MUN_000000040194> > > <http://localhost:8080/__geoserver/wfs?request=__GetFeature&version=2.0.0&__typeName=ad:AdminUnitName&__FEATUREID=AUN_MUN_000000040194 > > <http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=ad:AdminUnitName&FEATUREID=AUN_MUN_000000040194>__>"/> > <ad:component > > href="http://localhost:8080/__geoserver/wfs?request=__GetFeature&version=2.0.0&__typeName=ad:PostalDescriptor&__FEATUREID=PD_CP_000000000001 > > <http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=ad:PostalDescriptor&FEATUREID=PD_CP_000000000001> > > <http://localhost:8080/__geoserver/wfs?request=__GetFeature&version=2.0.0&__typeName=ad:PostalDescriptor&__FEATUREID=PD_CP_000000000001 > > <http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=ad:PostalDescriptor&FEATUREID=PD_CP_000000000001>>"__/> > </ad:Address> > > My questions are: > > Is it possible to add the referenced AdministrativeUnitName, > PostalDescriptor and ThoroughfareName at the end of the xml > response? > > I've read that it's impossible to ask for a feature referenced by an > xlink:href, then we can't ask the service for the addresses of a > certain > thoroughfarename, can we? I suposse that the only way is to > change the > type of the component property to a gml:AbstractFeature, isn't it? > > Regards and thanks in advance. > > > -- > Ben Caradoc-Davies <[email protected]> > Software Engineer > CSIRO Earth Science and Resource Engineering > Australian Resources Research Centre > > -- Ben Caradoc-Davies <[email protected]> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
