[Geoserver-devel] Local and remote references in app-schema

Hi,
I’m wondering if anybody can shed some detail about how local and remote references
are handled in app-schema generated GML?

My impression is that the in memory model of app-schema uses pointers, so there are
no special containment vs reference nodes, but when encoding, the first element encountered
gets encoded as containment, and all the subsequent references to the same identifiable
object are encoded as references. Is this right?

I’m also wondering about remote references, does app-schema has any support for those?
Something like, cross feature type references, or references to GML hosted on remote
servers?

What effects do you see the app-schema implementation would have on implementing
the wfs valueOf() function, that is meant to resolve references and provide the values?
If the local references are implemented as I think they are, it would be a “no op” when
run against the in memory features (as in, no different than just using its argument
path)

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Hi Andrea,

On 27/11/13 19:09, Andrea Aime wrote:

Hi,
I'm wondering if anybody can shed some detail about how local and remote references
are handled in app-schema generated GML?

My impression is that the in memory model of app-schema uses pointers, so there are
no special containment vs reference nodes, but when encoding, the first element encountered
gets encoded as containment, and all the subsequent references to the same identifiable
object are encoded as references. Is this right?

This is right, however app-schema also supports the WFS 2.0 local resolve parameters such as resolve depth, which can be used to encode featured chained features as a reference from a certain level anyhow. And it is a full reference rather than a short same-page kind of reference. I implemented that last year. It can even be used to resolve a reference without feature chaining (in which case all types will be searched).

I'm also wondering about remote references, does app-schema has any support for those?
Something like, cross feature type references, or references to GML hosted on remote
servers?

Cross-feature types, yes, but remote, no.

What effects do you see the app-schema implementation would have on implementing
the wfs valueOf() function, that is meant to resolve references and provide the values?
If the local references are implemented as I think they are, it would be a "no op" when
run against the in memory features (as in, no different than just using its argument
path)

Not sure but I would think if you use feature chaining, it should work.

Regards
Niels

On 28/11/13 02:09, Andrea Aime wrote:

My impression is that the in memory model of app-schema uses pointers,
so there are
no special containment vs reference nodes, but when encoding, the first
element encountered
gets encoded as containment, and all the subsequent references to the
same identifiable
object are encoded as references. Is this right?

Andrea,

that is correct. GML 3.1 and GML 3.2 GMLConfiguration register a component instance of XSDIdRegistry to record ids seen in an instance document. If the encoder sees an id a second time, the element (typically a feature) is encoded as an xlink:href to the earlier id as an anchor (#earlierid). Note that filters work against the logical information model, not the encoded form (in most cases) so filters against nested properties work even for features encoded by reference to prevent duplication. Rini might be able to clarify/confirm.

I think Niels answered your questions on resolve, which he implemented.

Kind regards,

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

Re: filtering xlink:href. Ben is correct, however this only applies if the xlink:href is encoded automatically because an existing gml:id has been seen.
It used to also work if xlink:href is configured via app-schema ClientProperty with feature chaining, but this is not supported with joining.
I am not sure if it still works, but you don't want to turn off joining for performance reasons anyway.

http://docs.geoserver.org/stable/en/user/data/app-schema/joining.html#conditions
"XPaths specified inside Filters do not support handling referenced features (see Multi-valued properties by reference (xlink:href)) as if they were actual nested features, i.e. XPaths can only be evaluated when they can be evaluated against the actual XML code produced by WFS according to the XPath standard."

Cheers
Rini

-----Original Message-----
From: Caradoc-Davies, Ben (CESRE, Kensington)
Sent: Thursday, 28 November 2013 10:56 AM
To: Andrea Aime
Cc: Geoserver-devel; Angreani, Rini (CESRE, Kensington)
Subject: Re: [Geoserver-devel] Local and remote references in app-schema

On 28/11/13 02:09, Andrea Aime wrote:

My impression is that the in memory model of app-schema uses pointers,
so there are no special containment vs reference nodes, but when
encoding, the first element encountered gets encoded as containment,
and all the subsequent references to the same identifiable object are
encoded as references. Is this right?

Andrea,

that is correct. GML 3.1 and GML 3.2 GMLConfiguration register a component instance of XSDIdRegistry to record ids seen in an instance document. If the encoder sees an id a second time, the element (typically a feature) is encoded as an xlink:href to the earlier id as an anchor (#earlierid). Note that filters work against the logical information model, not the encoded form (in most cases) so filters against nested properties work even for features encoded by reference to prevent duplication. Rini might be able to clarify/confirm.

I think Niels answered your questions on resolve, which he implemented.

Kind regards,

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@...254...> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre

On Wed, Nov 27, 2013 at 7:59 PM, Niels Charlier <niels@anonymised.com> wrote:

Hi Andrea,

On 27/11/13 19:09, Andrea Aime wrote:
> Hi,
> I'm wondering if anybody can shed some detail about how local and
> remote references
> are handled in app-schema generated GML?
>
> My impression is that the in memory model of app-schema uses pointers,
> so there are
> no special containment vs reference nodes, but when encoding, the
> first element encountered
> gets encoded as containment, and all the subsequent references to the
> same identifiable
> object are encoded as references. Is this right?

This is right, however app-schema also supports the WFS 2.0 local
resolve parameters such as resolve depth, which can be used to encode
featured chained features as a reference from a certain level anyhow.
And it is a full reference rather than a short same-page kind of
reference. I implemented that last year. It can even be used to resolve
a reference without feature chaining (in which case all types will be
searched).

Very nice. I searched around but could not locate where the valueOf()
mandatory xpath function is managed. Do you have pointers?

>
> I'm also wondering about remote references, does app-schema has any
> support for those?
> Something like, cross feature type references, or references to GML
> hosted on remote
> servers?
Cross-feature types, yes, but remote, no.

I see. Have you ever seen usage of true remote usage in any official
application
schema?
Or when they say "remote", they really mean just out of page, but same
server?

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Ah, I don’t think this is implemented. I thought remote resolve meant another server. This has not been implemented. Regards Niels

···

Hi Andrea,

On 28/11/13 09:38, Andrea Aime wrote:

Very nice. I searched around but could not locate where the valueOf()
mandatory xpath function is managed. Do you have pointers?

I’m also wondering about remote references, does app-schema has any
support for those?
Something like, cross feature type references, or references to GML
hosted on remote
servers?

Cross-feature types, yes, but remote, no.

I see. Have you ever seen usage of true remote usage in any official application
schema?
Or when they say “remote”, they really mean just out of page, but same server?