Stefano, tl;dr third solution is workspace-scoped namespaces
I think you have identified the two workable solutions. The first (aggregating features) must be regarded as the correct use of WFS as designed (as explained to me in person by a voting member of the WFS committee when I complained about this problem). The second (wrapper schema) is a workaround that will reduce interoperability and works against the reason for application schemas. WFS permits each type to be published once for each service endpoint. The idea is that all features are aggregated and a client selects the feature using a filter query. This works fine for simple features where each type has no relationships and new types are created as required. However, it is a pain in the arse when the type is a complex type that has very different structure and relationships for data from two sources; for example, laboratory assay observations on microscopic geological samples and observations on river flow level. It is ludicrous to combine them, so perhaps a wrapper schema is less bad? There is a third solution: use another service URL. This is a great way of separating data sets while enabling WFS access. The current implementation requires a new GeoServer instance to achieve this. GeoServer supports workspace local services since GSIP 66 (November 2011), but because workspaces are still tied to namespaces, they are inadequate for app-schema types. See the discussion around GSIP 66: <http://sourceforge.net/p/geoserver/mailman/message/28362605/> See also this user enquiry: <http://sourceforge.net/p/geoserver/mailman/message/28774087/> See also "GSIP 66 - Workspace Local Services": <https://github.com/geoserver/geoserver/wiki/GSIP-66---Workspace-Local-Services> If GeoServer had workspaces that each had their own service URL and own set of namespaces, you could publish each om:OM_Observation in its own workspace and your problem would be solved. As Andrea wrote back in November 2011: "Ben, it's the model we can get funding for, so it's the model we can afford.": <http://sourceforge.net/p/geoserver/mailman/message/28363389/> In my view, workspace-scoped namespaces would be a great improvement for app-schema. Kind regards, Ben. On 12/11/15 03:07, Stefano Costa wrote: > Dear all, > reading GeoServer's documentation > <http://docs.geoserver.org/latest/en/user/data/app-schema/feature-chaining.html#multiple-mappings-of-the-same-type>, > it is my understanding that it is not possible in app-schema to map the > same type multiple times, from different sources, AND have all the types > accessible as top level features. > > At times, this may pose some challenges. For example, let's consider a case > where multiple sets of observations should be published: each set sits in > its own DB table, but they should all be mapped to the om:OM_Observation > type from OGC's Observation & Measurements schema > <http://schemas.opengis.net/om/2.0/observation.xsd>. > > I can see only two possible ways to work around this limitation: > > 1. Define a view in the database as the union of the source tables, and use > that as sourceType in the FeatureTypeMapping > 2. Create a custom application schema and define there one specialised > observation type (derived from om:OM_Observation) for each source type that > needs publishing, something along the lines of: > > <complexType name="MyFirstObservationType"> > <complexContent> > <extension base="om:OM_ObservationType"> > <sequence /> > </extension> > </complexContent> > </complexType> > > <element name="MyFirstObservation" type="myns:MyFirstObservationType" > substitutionGroup="om:OM_Observation" /> > > <complexType name="MySecondObservationType"> > <complexContent> > <extension base="om:OM_ObservationType"> > <sequence /> > </extension> > </complexContent> > </complexType> > > <element name="MySecondObservation" type="myns:MySecondObservationType" > substitutionGroup="om:OM_Observation" /> > > > Am I interpreting the docs correctly? Does anybody have any further > suggestion? > > Thanks in advance. > > > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Geoserver-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geoserver-users > -- Ben Caradoc-Davies <[email protected]> Director Transient Software Limited <http://transient.nz/> New Zealand ------------------------------------------------------------------------------ _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
