[Geoserver-devel] ListStoredQueries & DescribeStoredQueries

Hi,

I was wondering if anyone had given thought as to what would be the appropriate time in the lifecycle of a WFS DataSource to discover what stored queries are available?

Would it make sense to run both (or just DescribeStoredQueries without a query id filter) at the same time the capabilities are loaded? Or should the client retrieve the list of possible queries only after the UI asks for the list of feature types available for a particular WFS Data Source?

This has probably been thought through when designing the database data sources and it would make sense to use the same pattern here.

Thanks,
Sampo

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

Hi Jody (& the list),

Sorry, I should have framed my question better. My question was regarding to the WFS DataStore work I’m currently doing, which is writing WFS 2.0 Stored Query support to WFS-NG.

At least for the time being, I’m adding the stored queries as special feature types the WFS DataStore reports along with the usual feature types. For these special feature types, the data store will then use stored queries instead of filter queries. As this model requires the data store to enumerate all available “feature types” at once, it requires ListStoredQueries to happen as GeoServer requests the list of feature types. This will then happen immediately as a new wfs-ng DataStore is registered and henceforth every time a GeoServer with such a DataStore is started. As for the DescribeStoredQuery, I expect that will happen only when that “feature type” (or information regarding it) is actually requested through the DataStore API. From where I’m sitting, this seem acceptable, but feedback and comments are always appreciated.

Fitting the Stored Queries as feature types feels quite crufty though. I’d love to get a conversation going if there’s a better way to model the stored queries.

Sampo

···

On Thu, Apr 10, 2014 at 1:17 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

When the GetCapabilities document is produced? Since the stored queries are listed in the WFS 2.0 GetCapabilities document right? There is no guarantee that a client will use the GeoServer user interface (since that is just for configuration).

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

Jody Garnett

On Mon, Apr 7, 2014 at 10:13 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi,

I was wondering if anyone had given thought as to what would be the appropriate time in the lifecycle of a WFS DataSource to discover what stored queries are available?

Would it make sense to run both (or just DescribeStoredQueries without a query id filter) at the same time the capabilities are loaded? Or should the client retrieve the list of possible queries only after the UI asks for the list of feature types available for a particular WFS Data Source?

This has probably been thought through when designing the database data sources and it would make sense to use the same pattern here.

Thanks,
Sampo

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hey Sampo,

I think what you propose sounds perfectly reasonable. I agree that stuffing stored queries into a feature type might prove tricky but I am not sure I see a better way. It is also kind of consistent with the way that jdbc datastores handle sql views.

Btw, I am assuming that the wfs client will check the capabilities doc to see whether stored queries are supported before querying?

-Justin

···

On Wed, Apr 9, 2014 at 11:49 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi Jody (& the list),

Sorry, I should have framed my question better. My question was regarding to the WFS DataStore work I’m currently doing, which is writing WFS 2.0 Stored Query support to WFS-NG.

At least for the time being, I’m adding the stored queries as special feature types the WFS DataStore reports along with the usual feature types. For these special feature types, the data store will then use stored queries instead of filter queries. As this model requires the data store to enumerate all available “feature types” at once, it requires ListStoredQueries to happen as GeoServer requests the list of feature types. This will then happen immediately as a new wfs-ng DataStore is registered and henceforth every time a GeoServer with such a DataStore is started. As for the DescribeStoredQuery, I expect that will happen only when that “feature type” (or information regarding it) is actually requested through the DataStore API. From where I’m sitting, this seem acceptable, but feedback and comments are always appreciated.

Fitting the Stored Queries as feature types feels quite crufty though. I’d love to get a conversation going if there’s a better way to model the stored queries.

Sampo


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Thu, Apr 10, 2014 at 1:17 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

When the GetCapabilities document is produced? Since the stored queries are listed in the WFS 2.0 GetCapabilities document right? There is no guarantee that a client will use the GeoServer user interface (since that is just for configuration).

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

Jody Garnett

On Mon, Apr 7, 2014 at 10:13 PM, Sampo Savolainen <sampo.savolainen@anonymised.com3889…> wrote:

Hi,

I was wondering if anyone had given thought as to what would be the appropriate time in the lifecycle of a WFS DataSource to discover what stored queries are available?

Would it make sense to run both (or just DescribeStoredQueries without a query id filter) at the same time the capabilities are loaded? Or should the client retrieve the list of possible queries only after the UI asks for the list of feature types available for a particular WFS Data Source?

This has probably been thought through when designing the database data sources and it would make sense to use the same pattern here.

Thanks,
Sampo

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hi justin,

Maybe stored queries might be represented as a dimension for the layer. The default dimension would be to use no stored query, while stored queries returning values for that particular feature type would be values for that dimension. What do you think?

And yes, I am checking that the the WFS supports stored queries before doing anything. Which actually brings up a small question regarding the WFS spec: when does a WFS service support executing stored queries? Does it have to support ListStoredQueries or DescribeStoredQueris or both

Sampo

···

On Fri, Apr 11, 2014 at 2:24 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hey Sampo,

I think what you propose sounds perfectly reasonable. I agree that stuffing stored queries into a feature type might prove tricky but I am not sure I see a better way. It is also kind of consistent with the way that jdbc datastores handle sql views.

Btw, I am assuming that the wfs client will check the capabilities doc to see whether stored queries are supported before querying?

-Justin

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Wed, Apr 9, 2014 at 11:49 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi Jody (& the list),

Sorry, I should have framed my question better. My question was regarding to the WFS DataStore work I’m currently doing, which is writing WFS 2.0 Stored Query support to WFS-NG.

At least for the time being, I’m adding the stored queries as special feature types the WFS DataStore reports along with the usual feature types. For these special feature types, the data store will then use stored queries instead of filter queries. As this model requires the data store to enumerate all available “feature types” at once, it requires ListStoredQueries to happen as GeoServer requests the list of feature types. This will then happen immediately as a new wfs-ng DataStore is registered and henceforth every time a GeoServer with such a DataStore is started. As for the DescribeStoredQuery, I expect that will happen only when that “feature type” (or information regarding it) is actually requested through the DataStore API. From where I’m sitting, this seem acceptable, but feedback and comments are always appreciated.

Fitting the Stored Queries as feature types feels quite crufty though. I’d love to get a conversation going if there’s a better way to model the stored queries.

Sampo


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Thu, Apr 10, 2014 at 1:17 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

When the GetCapabilities document is produced? Since the stored queries are listed in the WFS 2.0 GetCapabilities document right? There is no guarantee that a client will use the GeoServer user interface (since that is just for configuration).

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

Jody Garnett

On Mon, Apr 7, 2014 at 10:13 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi,

I was wondering if anyone had given thought as to what would be the appropriate time in the lifecycle of a WFS DataSource to discover what stored queries are available?

Would it make sense to run both (or just DescribeStoredQueries without a query id filter) at the same time the capabilities are loaded? Or should the client retrieve the list of possible queries only after the UI asks for the list of feature types available for a particular WFS Data Source?

This has probably been thought through when designing the database data sources and it would make sense to use the same pattern here.

Thanks,
Sampo

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Fri, Apr 11, 2014 at 1:54 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

And yes, I am checking that the the WFS supports stored queries before
doing anything. Which actually brings up a small question regarding the WFS
spec: when does a WFS service support executing stored queries? Does it
have to support ListStoredQueries or DescribeStoredQueris or both

See OGC 09-025r1, "Table 1 -- Conformance classes" (page 2):

Simple WFS conformance class:

"The server shall implement the following operations: GetCapabilities,
DescribeFeatureType, ListStoredQueries, DescribeStoredQueries, GetFeature
operation with only the StoredQuery action.
One stored query, that fetches a feature using its id, shall be available
but the server may also offer additional stored queries.
Additionally the server shall conform to at least one of the HTTP GET, HTTP
POST or SOAP conformance classes."

I'm guessing that in theory you could have a WFS 2.0 that does not fill the
Simple WFS conformance class, but I do not see much relevance for such a
service.

The conformance classes complied to should be indicated as flags in the
capabilities document, see "Table 13 -- Service constraints". The
"ImplementsSimpleWFS" is not there, so that also seems to indicate that the
SimpleWFS in the basic requirement for a WFS 2.0 service. Note though, that
the only mandatory stored query for SimpleWFS is the one with a fixed name
"urn:ogc:def:query:OGC-WFS::GetFeatureById" returning a feature with a
given featureId.

Ilkka Rinne

Sampo

On Fri, Apr 11, 2014 at 2:24 PM, Justin Deoliveira <
jdeolive@anonymised.com> wrote:

Hey Sampo,

I think what you propose sounds perfectly reasonable. I agree that
stuffing stored queries into a feature type might prove tricky but I am not
sure I see a better way. It is also kind of consistent with the way that
jdbc datastores handle sql views.

Btw, I am assuming that the wfs client will check the capabilities doc to
see whether stored queries are supported before querying?

-Justin

On Wed, Apr 9, 2014 at 11:49 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi Jody (& the list),

Sorry, I should have framed my question better. My question was
regarding to the WFS DataStore work I'm currently doing, which is writing
WFS 2.0 Stored Query support to WFS-NG.

At least for the time being, I'm adding the stored queries as special
feature types the WFS DataStore reports along with the usual feature types.
For these special feature types, the data store will then use stored
queries instead of filter queries. As this model requires the data store to
enumerate all available "feature types" at once, it requires
ListStoredQueries to happen as GeoServer requests the list of feature
types. This will then happen immediately as a new wfs-ng DataStore is
registered and henceforth every time a GeoServer with such a DataStore is
started. As for the DescribeStoredQuery, I expect that will happen only
when that "feature type" (or information regarding it) is actually
requested through the DataStore API. From where I'm sitting, this seem
acceptable, but feedback and comments are always appreciated.

Fitting the Stored Queries as feature types feels quite crufty though.
I'd love to get a conversation going if there's a better way to model the
stored queries.

Sampo

On Thu, Apr 10, 2014 at 1:17 AM, Jody Garnett <jody.garnett@anonymised.com>wrote:

When the GetCapabilities document is produced? Since the stored queries
are listed in the WFS 2.0 GetCapabilities document right? There is no
guarantee that a client will use the GeoServer user interface (since that
is just for configuration).

Jody Garnett

On Mon, Apr 7, 2014 at 10:13 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi,

I was wondering if anyone had given thought as to what would be the
appropriate time in the lifecycle of a WFS DataSource to discover what
stored queries are available?

Would it make sense to run both (or just DescribeStoredQueries without
a query id filter) at the same time the capabilities are loaded? Or should
the client retrieve the list of possible queries only after the UI asks for
the list of feature types available for a particular WFS Data Source?

This has probably been thought through when designing the database
data sources and it would make sense to use the same pattern here.

Thanks,
  Sampo

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information.
If you
have received this e-mail in error or are not the intended recipient,
you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the
sender
promptly by e-mail that you have done so.

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If
you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
*Justin Deoliveira*
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive <https://twitter.com/j_deolive&gt;

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Ilkka Rinne
Founder, Chief Technology Officer, Spatineo Oy
Email: ilkka.rinne@anonymised.com
Skype: ilkka.o.rinne, phone: +358 50 523 8974
Linnankoskenkatu 16 A 17, FI-00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
Google+ google.com/+Spatineo
www.linkedin.com/company/spatineo-inc

On Fri, Apr 11, 2014 at 5:54 AM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi justin,

Maybe stored queries might be represented as a dimension for the layer.
The default dimension would be to use no stored query, while stored queries
returning values for that particular feature type would be values for that
dimension. What do you think?

I am not exactly sure what this woudl look like. Can you elaborate?

I wonder if trying to represent it as a filter function makes more sense.
The same way that jdbc datastores map filter functions to native functions
the wfs datastore could map filter functions to stored query calls? Problem
is I don't believe there is any api that would expose such functions...
aside from having the wfs datastore product an implementation of
FilterFunctionFactory. Anyways, just a thought.

And yes, I am checking that the the WFS supports stored queries before
doing anything. Which actually brings up a small question regarding the WFS
spec: when does a WFS service support executing stored queries? Does it
have to support ListStoredQueries or DescribeStoredQueris or both

As Ilkka mentions in his reply these are supposed to be part of the lowest
level of conformance (which surprised me) but I do still think it would be
a good idea to check the OperationsMetadata of the capabilities document as
the authoritative source. Which we will probably want to do anyways in
order to check whether we can create new stored queries, etc...

Sampo

On Fri, Apr 11, 2014 at 2:24 PM, Justin Deoliveira <
jdeolive@anonymised.com> wrote:

Hey Sampo,

I think what you propose sounds perfectly reasonable. I agree that
stuffing stored queries into a feature type might prove tricky but I am not
sure I see a better way. It is also kind of consistent with the way that
jdbc datastores handle sql views.

Btw, I am assuming that the wfs client will check the capabilities doc to
see whether stored queries are supported before querying?

-Justin

On Wed, Apr 9, 2014 at 11:49 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi Jody (& the list),

Sorry, I should have framed my question better. My question was
regarding to the WFS DataStore work I'm currently doing, which is writing
WFS 2.0 Stored Query support to WFS-NG.

At least for the time being, I'm adding the stored queries as special
feature types the WFS DataStore reports along with the usual feature types.
For these special feature types, the data store will then use stored
queries instead of filter queries. As this model requires the data store to
enumerate all available "feature types" at once, it requires
ListStoredQueries to happen as GeoServer requests the list of feature
types. This will then happen immediately as a new wfs-ng DataStore is
registered and henceforth every time a GeoServer with such a DataStore is
started. As for the DescribeStoredQuery, I expect that will happen only
when that "feature type" (or information regarding it) is actually
requested through the DataStore API. From where I'm sitting, this seem
acceptable, but feedback and comments are always appreciated.

Fitting the Stored Queries as feature types feels quite crufty though.
I'd love to get a conversation going if there's a better way to model the
stored queries.

Sampo

On Thu, Apr 10, 2014 at 1:17 AM, Jody Garnett <jody.garnett@anonymised.com>wrote:

When the GetCapabilities document is produced? Since the stored queries
are listed in the WFS 2.0 GetCapabilities document right? There is no
guarantee that a client will use the GeoServer user interface (since that
is just for configuration).

Jody Garnett

On Mon, Apr 7, 2014 at 10:13 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi,

I was wondering if anyone had given thought as to what would be the
appropriate time in the lifecycle of a WFS DataSource to discover what
stored queries are available?

Would it make sense to run both (or just DescribeStoredQueries without
a query id filter) at the same time the capabilities are loaded? Or should
the client retrieve the list of possible queries only after the UI asks for
the list of feature types available for a particular WFS Data Source?

This has probably been thought through when designing the database
data sources and it would make sense to use the same pattern here.

Thanks,
  Sampo

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information.
If you
have received this e-mail in error or are not the intended recipient,
you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the
sender
promptly by e-mail that you have done so.

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If
you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
*Justin Deoliveira*
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive <https://twitter.com/j_deolive&gt;

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

--
*Justin Deoliveira*
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive <https://twitter.com/j_deolive&gt;

On Mon, Apr 14, 2014 at 3:53 PM, Justin Deoliveira <
jdeolive@anonymised.com> wrote:

On Fri, Apr 11, 2014 at 5:54 AM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi justin,

Maybe stored queries might be represented as a dimension for the layer.
The default dimension would be to use no stored query, while stored queries
returning values for that particular feature type would be values for that
dimension. What do you think?

I thought we agreed that the stored queries params had a best fit with
viewparams of a sql view. What changed?

And yes, I am checking that the the WFS supports stored queries before

doing anything. Which actually brings up a small question regarding the WFS
spec: when does a WFS service support executing stored queries? Does it
have to support ListStoredQueries or DescribeStoredQueris or both

As Ilkka mentions in his reply these are supposed to be part of the
lowest level of conformance (which surprised me) but I do still think it
would be a good idea to check the OperationsMetadata of the capabilities
document as the authoritative source. Which we will probably want to do
anyways in order to check whether we can create new stored queries, etc...

Hum... as far as I remember the server Sampo is trying to cascade only
supports stored queries (and not regular GetFeature access)
But is such a server even a valid WFS server?

Maybe this case should get special treatment top to bottom, like a special
flag in the config telling the store to not even
attempt to make a GetFeature, and GeoServer to disallow the publication of
layers along the normal path, since
if you don't configure the stored query params and their default values,
you cannot even fetch data from it.

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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

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

I like your thinking Justin.

So if stored queries are sufficiently whacky enough we can create a new interface:

public class FeatureQuery {
FunctionName getFunctionNames();
FeatureCollection storedQuery( Function );
}

public class SimpleFeatureQuery extends FeatureQuery{
SimpleFeatureCollection storedQuery( Function );
}

The above depends FunctionName which describes both the name of the query and the available parameters.

···

Jody Garnett

On Mon, Apr 14, 2014 at 11:53 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

On Fri, Apr 11, 2014 at 5:54 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi justin,

Maybe stored queries might be represented as a dimension for the layer. The default dimension would be to use no stored query, while stored queries returning values for that particular feature type would be values for that dimension. What do you think?

I am not exactly sure what this woudl look like. Can you elaborate?

I wonder if trying to represent it as a filter function makes more sense. The same way that jdbc datastores map filter functions to native functions the wfs datastore could map filter functions to stored query calls? Problem is I don’t believe there is any api that would expose such functions… aside from having the wfs datastore product an implementation of FilterFunctionFactory. Anyways, just a thought.

And yes, I am checking that the the WFS supports stored queries before doing anything. Which actually brings up a small question regarding the WFS spec: when does a WFS service support executing stored queries? Does it have to support ListStoredQueries or DescribeStoredQueris or both

As Ilkka mentions in his reply these are supposed to be part of the lowest level of conformance (which surprised me) but I do still think it would be a good idea to check the OperationsMetadata of the capabilities document as the authoritative source. Which we will probably want to do anyways in order to check whether we can create new stored queries, etc…

Sampo

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Fri, Apr 11, 2014 at 2:24 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hey Sampo,

I think what you propose sounds perfectly reasonable. I agree that stuffing stored queries into a feature type might prove tricky but I am not sure I see a better way. It is also kind of consistent with the way that jdbc datastores handle sql views.

Btw, I am assuming that the wfs client will check the capabilities doc to see whether stored queries are supported before querying?

-Justin

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Wed, Apr 9, 2014 at 11:49 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi Jody (& the list),

Sorry, I should have framed my question better. My question was regarding to the WFS DataStore work I’m currently doing, which is writing WFS 2.0 Stored Query support to WFS-NG.

At least for the time being, I’m adding the stored queries as special feature types the WFS DataStore reports along with the usual feature types. For these special feature types, the data store will then use stored queries instead of filter queries. As this model requires the data store to enumerate all available “feature types” at once, it requires ListStoredQueries to happen as GeoServer requests the list of feature types. This will then happen immediately as a new wfs-ng DataStore is registered and henceforth every time a GeoServer with such a DataStore is started. As for the DescribeStoredQuery, I expect that will happen only when that “feature type” (or information regarding it) is actually requested through the DataStore API. From where I’m sitting, this seem acceptable, but feedback and comments are always appreciated.

Fitting the Stored Queries as feature types feels quite crufty though. I’d love to get a conversation going if there’s a better way to model the stored queries.

Sampo


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Thu, Apr 10, 2014 at 1:17 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

When the GetCapabilities document is produced? Since the stored queries are listed in the WFS 2.0 GetCapabilities document right? There is no guarantee that a client will use the GeoServer user interface (since that is just for configuration).

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

Jody Garnett

On Mon, Apr 7, 2014 at 10:13 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi,

I was wondering if anyone had given thought as to what would be the appropriate time in the lifecycle of a WFS DataSource to discover what stored queries are available?

Would it make sense to run both (or just DescribeStoredQueries without a query id filter) at the same time the capabilities are loaded? Or should the client retrieve the list of possible queries only after the UI asks for the list of feature types available for a particular WFS Data Source?

This has probably been thought through when designing the database data sources and it would make sense to use the same pattern here.

Thanks,
Sampo

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hi Andrea & Justin

···

On Mon, Apr 14, 2014 at 5:05 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Oh, nothing changed. This idea was not related to the parameter passed to the stored query. The crazy thought that popped into my head was that we could model FeatureTypes as having N dimensions where the first one is accessible using filter encoding queries and the rest are accessible through stored queries.

I was just thinking of ways on how to present the stored queries in the web UI for the user and this option came to mind. I’m not sure it makes much sense.

You remember correctly. As Ilkka pointed out, the lowest level of conformance requires stored queries but not filter encodings. It is a bit wacky as opposed to how WFS has historically worked.

This is a good point. It would make sense for such stores to not advertise the basic FeatureTypes. I’ll look into that.

A quick progress update:

  • wfs-ng can register 2.0 servers
  • stored queries are listed as special feature types
  • stored queries are handled by a specialized Content Feature Source
  • StrictWFS_2_0_Strategy handles stored queries
  • View params are passed into the strategy for handling

So basically the whole stack is working: I can make WMS queries to the feature type created from the WFS-NG stored query data source.

The major hurdle now is mapping the relevant parts of the filter as stored query parameters. I’ve hard coded a Filter envelope → stored query parameter conversion, but that’s specific to the use case I’m working on here. We need a more generic approach for this.

Is there a good, fast, expression language in use in GeoServer that I could use for this? I’m thinking that we could us expressions to let users map parts of the filter, feature type information, along with literals etc. into the stored query parameters. This way we’ll probably be able to make this generic enough to be more universally useful. Plus the expression language model should be extensible so we can cover future cases (new requirements for the parameter mapping) by just adding more data to the expression scope.

Sampo

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Mon, Apr 14, 2014 at 3:53 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

I thought we agreed that the stored queries params had a best fit with viewparams of a sql view. What changed?

On Fri, Apr 11, 2014 at 5:54 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi justin,

Maybe stored queries might be represented as a dimension for the layer. The default dimension would be to use no stored query, while stored queries returning values for that particular feature type would be values for that dimension. What do you think?

Hum… as far as I remember the server Sampo is trying to cascade only supports stored queries (and not regular GetFeature access)
But is such a server even a valid WFS server?

And yes, I am checking that the the WFS supports stored queries before doing anything. Which actually brings up a small question regarding the WFS spec: when does a WFS service support executing stored queries? Does it have to support ListStoredQueries or DescribeStoredQueris or both

As Ilkka mentions in his reply these are supposed to be part of the lowest level of conformance (which surprised me) but I do still think it would be a good idea to check the OperationsMetadata of the capabilities document as the authoritative source. Which we will probably want to do anyways in order to check whether we can create new stored queries, etc…

Maybe this case should get special treatment top to bottom, like a special flag in the config telling the store to not even
attempt to make a GetFeature, and GeoServer to disallow the publication of layers along the normal path, since
if you don’t configure the stored query params and their default values, you cannot even fetch data from it.

Hi Jody & Justin,

This is an interesting idea. Are you thinking that this filter would be representable as CQL or even as an extension to filter encoding queries and thus the client could make the choice between normal filter encoding and stored queries? Or would a cascaded FeatureTypes in GeoServer be configured to target either normal filter encoding GetFeature requests or a specified stored query?

Sampo

···

On Mon, Apr 14, 2014 at 5:49 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

I like your thinking Justin.

So if stored queries are sufficiently whacky enough we can create a new interface:

public class FeatureQuery {
FunctionName getFunctionNames();
FeatureCollection storedQuery( Function );
}

public class SimpleFeatureQuery extends FeatureQuery{
SimpleFeatureCollection storedQuery( Function );
}

The above depends FunctionName which describes both the name of the query and the available parameters.

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

Jody Garnett

On Mon, Apr 14, 2014 at 11:53 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

On Fri, Apr 11, 2014 at 5:54 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi justin,

Maybe stored queries might be represented as a dimension for the layer. The default dimension would be to use no stored query, while stored queries returning values for that particular feature type would be values for that dimension. What do you think?

I am not exactly sure what this woudl look like. Can you elaborate?

I wonder if trying to represent it as a filter function makes more sense. The same way that jdbc datastores map filter functions to native functions the wfs datastore could map filter functions to stored query calls? Problem is I don’t believe there is any api that would expose such functions… aside from having the wfs datastore product an implementation of FilterFunctionFactory. Anyways, just a thought.

And yes, I am checking that the the WFS supports stored queries before doing anything. Which actually brings up a small question regarding the WFS spec: when does a WFS service support executing stored queries? Does it have to support ListStoredQueries or DescribeStoredQueris or both

As Ilkka mentions in his reply these are supposed to be part of the lowest level of conformance (which surprised me) but I do still think it would be a good idea to check the OperationsMetadata of the capabilities document as the authoritative source. Which we will probably want to do anyways in order to check whether we can create new stored queries, etc…

Sampo

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Fri, Apr 11, 2014 at 2:24 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hey Sampo,

I think what you propose sounds perfectly reasonable. I agree that stuffing stored queries into a feature type might prove tricky but I am not sure I see a better way. It is also kind of consistent with the way that jdbc datastores handle sql views.

Btw, I am assuming that the wfs client will check the capabilities doc to see whether stored queries are supported before querying?

-Justin

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Wed, Apr 9, 2014 at 11:49 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi Jody (& the list),

Sorry, I should have framed my question better. My question was regarding to the WFS DataStore work I’m currently doing, which is writing WFS 2.0 Stored Query support to WFS-NG.

At least for the time being, I’m adding the stored queries as special feature types the WFS DataStore reports along with the usual feature types. For these special feature types, the data store will then use stored queries instead of filter queries. As this model requires the data store to enumerate all available “feature types” at once, it requires ListStoredQueries to happen as GeoServer requests the list of feature types. This will then happen immediately as a new wfs-ng DataStore is registered and henceforth every time a GeoServer with such a DataStore is started. As for the DescribeStoredQuery, I expect that will happen only when that “feature type” (or information regarding it) is actually requested through the DataStore API. From where I’m sitting, this seem acceptable, but feedback and comments are always appreciated.

Fitting the Stored Queries as feature types feels quite crufty though. I’d love to get a conversation going if there’s a better way to model the stored queries.

Sampo


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Thu, Apr 10, 2014 at 1:17 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

When the GetCapabilities document is produced? Since the stored queries are listed in the WFS 2.0 GetCapabilities document right? There is no guarantee that a client will use the GeoServer user interface (since that is just for configuration).

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

Jody Garnett

On Mon, Apr 7, 2014 at 10:13 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi,

I was wondering if anyone had given thought as to what would be the appropriate time in the lifecycle of a WFS DataSource to discover what stored queries are available?

Would it make sense to run both (or just DescribeStoredQueries without a query id filter) at the same time the capabilities are loaded? Or should the client retrieve the list of possible queries only after the UI asks for the list of feature types available for a particular WFS Data Source?

This has probably been thought through when designing the database data sources and it would make sense to use the same pattern here.

Thanks,
Sampo

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Mon, Apr 14, 2014 at 4:53 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Is there a good, fast, expression language in use in GeoServer that I
could use for this? I'm thinking that we could us expressions to let users
map parts of the filter, feature type information, along with literals etc.
into the stored query parameters. This way we'll probably be able to make
this generic enough to be more universally useful. Plus the expression
language model should be extensible so we can cover future cases (new
requirements for the parameter mapping) by just adding more data to the
expression scope.

Hum... maybe CQL, and then you do pattern matching?

In CQL a bbox can be expressed as:

BBOX(geom, x1, y1, x2, y2)

which you'd have to match as the value to the parameter, using another CQL
expression to be run, something like:

Concatenate(x1, ",", y1, ",", x2, ",", y2)

The bbox case is kind of funky, because there is no way in CQL to just say
BBOX(geom, myEnvelope), but other
cases should work.
Say you have a parameter that is a time dimension, you could have as the
pattern:

timeAttribute = theTime

and your parameter value would simply be "theTime" (as in, the value of
that expression)

There is a few hurdles that you have to handle though, like, what if there
is more than one time filter in your request,
or what if the expressions you're extracting from the pattern match are not
literals?
Also, the bbox example above is not exactly going to work, as the in memory
representation of that thing is likely
going to break, so you probably have to do a pre-parse of some kind before
enabling the cql parser...

Just throwing some random ideas in...

Cheers
Andrea

Sampo

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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,

CQL looks like a definite contender. The standard FilterFactory expects to get properties from SimpleFeatures and does not understand Java Beans notation. To get around this, I created a FilterFactory that extends the basic impl and returns a different PropertyName implementation for properties. This implementation simply uses commons-beans to access the java bean properties. This works well, but I was wondering if it would make sense to create an “official” PropertyAccessorFactory capable of retrieving data from any java bean? This might pose some security issues and I trust you to be a better judge at this.

Another thing I’m missing is that I can’t find a CQL function to convert numbers into strings. As I’m using the expression language to produce values to put in the stored query parameters, such a function would be invaluable. Is there such a function or should I add one as an extension? I would first just add it to my use case but you can later figure out if it’s needed in the main CQL toolkit. I’m thinking “toString(expr)”, any thoughts?

Sampo

···

On Mon, Apr 14, 2014 at 6:17 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Mon, Apr 14, 2014 at 4:53 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hum… maybe CQL, and then you do pattern matching?

In CQL a bbox can be expressed as:

BBOX(geom, x1, y1, x2, y2)

which you’d have to match as the value to the parameter, using another CQL expression to be run, something like:

Concatenate(x1, “,”, y1, “,”, x2, “,”, y2)

The bbox case is kind of funky, because there is no way in CQL to just say BBOX(geom, myEnvelope), but other
cases should work.
Say you have a parameter that is a time dimension, you could have as the pattern:

timeAttribute = theTime

and your parameter value would simply be “theTime” (as in, the value of that expression)

There is a few hurdles that you have to handle though, like, what if there is more than one time filter in your request,
or what if the expressions you’re extracting from the pattern match are not literals?
Also, the bbox example above is not exactly going to work, as the in memory representation of that thing is likely
going to break, so you probably have to do a pre-parse of some kind before enabling the cql parser…

Just throwing some random ideas in…

Cheers

Andrea

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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


Is there a good, fast, expression language in use in GeoServer that I could use for this? I’m thinking that we could us expressions to let users map parts of the filter, feature type information, along with literals etc. into the stored query parameters. This way we’ll probably be able to make this generic enough to be more universally useful. Plus the expression language model should be extensible so we can cover future cases (new requirements for the parameter mapping) by just adding more data to the expression scope.

Sampo

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Tue, Apr 15, 2014 at 9:50 AM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi Andrea,

CQL looks like a definite contender. The standard FilterFactory expects to
get properties from SimpleFeatures and does not understand Java Beans
notation. To get around this, I created a FilterFactory that extends the
basic impl and returns a different PropertyName implementation for
properties. This implementation simply uses commons-beans to access the
java bean properties. This works well, but I was wondering if it would make
sense to create an "official" PropertyAccessorFactory capable of retrieving
data from any java bean? This might pose some security issues and I trust
you to be a better judge at this.

Wondering, do you really have the evaluate filters against beans?
But yes, I don't think there is any issue adding a javabean based property
accessor (maybe check if you need to add dependencies though, like
commons-beanutils, to make it run, or if the stuff you need is already
there)

Another thing I'm missing is that I can't find a CQL function to convert
numbers into strings. As I'm using the expression language to produce
values to put in the stored query parameters, such a function would be
invaluable. Is there such a function or should I add one as an extension? I
would first just add it to my use case but you can later figure out if it's
needed in the main CQL toolkit. I'm thinking "toString(expr)", any thoughts?

numberFormat:
http://docs.geoserver.org/stable/en/user/filter/function_reference.html#parsing-and-formatting-functions

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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

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

On Tue, Apr 15, 2014 at 10:54 AM, Andrea Aime
<andrea.aime@anonymised.com>wrote:

On Tue, Apr 15, 2014 at 9:50 AM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi Andrea,

CQL looks like a definite contender. The standard FilterFactory expects
to get properties from SimpleFeatures and does not understand Java Beans
notation. To get around this, I created a FilterFactory that extends the
basic impl and returns a different PropertyName implementation for
properties. This implementation simply uses commons-beans to access the
java bean properties. This works well, but I was wondering if it would make
sense to create an "official" PropertyAccessorFactory capable of retrieving
data from any java bean? This might pose some security issues and I trust
you to be a better judge at this.

Wondering, do you really have the evaluate filters against beans?

My idea was to build a context for the stored query parameter evaluation
which would contain the following information:
- Values passed as view parameters
- Filter envelope
- Feature type info

The admin could then configure the layer to map these values to the stored
query parameters in the layer configuration like so:

<StoredQueryConfiguration storedQueryId="urn::whatever..">
  <ParameterMapping>
    <ParameterName>bbox</ParameterName>
    <ExpressionValue
language="MysticEL">${envelope.minx},${envelope.miny},${envelope.maxy},${envelope.maxy},${featureType.defaultCRS}</ExpressionValue>
  </ParameterMapping>
  <ParameterMapping>
    <ParameterName>xyz</ParameterName>
    <ExpressionValue language="MysticEL">${viewparam.xyz[0] * 60 *
1000}</ExpressionValue>
  </ParameterMapping>
  <ParameterMapping>
    <ParameterName>timestep</ParameterName>
    <DefaultValue>720</DefaultValue>
  </ParameterMapping>
</StoredQueryConfiguration>

I'm using a hypothetical EL here to provide readability. The above xml
structure is raw, not much though has been put into it yet. Comments are
always appreciated.

As in the example above, the same configuration could be used to provide
sane defaults to be used when no value is provided in the request.

But yes, I don't think there is any issue adding a javabean based property
accessor (maybe check if you need to add dependencies though, like
commons-beanutils, to make it run, or if the stuff you need is already
there)

Ok. I'll look into that once we get settled if I really need beans or not.

Do you see a way to achieve what I proposed above without using beans? I
could always synthesize a simple feature type and use that as the CQL
context, but that seems like an awful amount of work (and kludges) to get
something pretty simple achieved.

Another thing I'm missing is that I can't find a CQL function to convert

numbers into strings. As I'm using the expression language to produce
values to put in the stored query parameters, such a function would be
invaluable. Is there such a function or should I add one as an extension? I
would first just add it to my use case but you can later figure out if it's
needed in the main CQL toolkit. I'm thinking "toString(expr)", any thoughts?

numberFormat:
http://docs.geoserver.org/stable/en/user/filter/function_reference.html#parsing-and-formatting-functions

Brilliant. I knew I must've missed it. Thanks.

Sampo

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Tue, Apr 15, 2014 at 10:16 AM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Wondering, do you really have the evaluate filters against beans?

My idea was to build a context for the stored query parameter evaluation
which would contain the following information:
- Values passed as view parameters
- Filter envelope

Have a look at ExtractBoundsFilterVisitor to extracts a bbox out of any
random filter (assuming it's possible,
otherwise no bounds will be extracted), you will not get just the bbox in
the Query object

- Feature type info

The admin could then configure the layer to map these values to the stored
query parameters in the layer configuration like so:

<StoredQueryConfiguration storedQueryId="urn::whatever..">
  <ParameterMapping>
    <ParameterName>bbox</ParameterName>
    <ExpressionValue
language="MysticEL">${envelope.minx},${envelope.miny},${envelope.maxy},${envelope.maxy},${featureType.defaultCRS}</ExpressionValue>
  </ParameterMapping>
  <ParameterMapping>
    <ParameterName>xyz</ParameterName>
    <ExpressionValue language="MysticEL">${viewparam.xyz[0] * 60 *
1000}</ExpressionValue>
  </ParameterMapping>
  <ParameterMapping>
    <ParameterName>timestep</ParameterName>
    <DefaultValue>720</DefaultValue>
  </ParameterMapping>
</StoredQueryConfiguration>

I'm using a hypothetical EL here to provide readability. The above xml
structure is raw, not much though has been put into it yet. Comments are
always appreciated.

As in the example above, the same configuration could be used to provide
sane defaults to be used when no value is provided in the request.

But yes, I don't think there is any issue adding a javabean based
property accessor (maybe check if you need to add dependencies though, like
commons-beanutils, to make it run, or if the stuff you need is already
there)

Ok. I'll look into that once we get settled if I really need beans or not.

Do you see a way to achieve what I proposed above without using beans? I
could always synthesize a simple feature type and use that as the CQL
context, but that seems like an awful amount of work (and kludges) to get
something pretty simple achieved.

The thing is, to parse a CQL expression you don't need a feature type, the
parser just extracts the variable names you're providing
as is, it's only at evaluation time that we try to use them, and discover
if the feature has them, or not (well, we actually have some
tools to compare the attributes required with the feature type, but that's
something we do in order to provide nice error messages,
in your case you can compare the variable values with whatever value you
have in your context

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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

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

On Tue, Apr 15, 2014 at 12:09 PM, Andrea Aime
<andrea.aime@anonymised.com>wrote:

On Tue, Apr 15, 2014 at 10:16 AM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Wondering, do you really have the evaluate filters against beans?

My idea was to build a context for the stored query parameter evaluation
which would contain the following information:
- Values passed as view parameters
- Filter envelope

Have a look at ExtractBoundsFilterVisitor to extracts a bbox out of any
random filter (assuming it's possible,
otherwise no bounds will be extracted), you will not get just the bbox in
the Query object

Yep. This is how I'm doing it.

- Feature type info

The admin could then configure the layer to map these values to the
stored query parameters in the layer configuration like so:

<StoredQueryConfiguration storedQueryId="urn::whatever..">
  <ParameterMapping>
    <ParameterName>bbox</ParameterName>
    <ExpressionValue
language="MysticEL">${envelope.minx},${envelope.miny},${envelope.maxy},${envelope.maxy},${featureType.defaultCRS}</ExpressionValue>
  </ParameterMapping>
  <ParameterMapping>
    <ParameterName>xyz</ParameterName>
    <ExpressionValue language="MysticEL">${viewparam.xyz[0] * 60 *
1000}</ExpressionValue>
  </ParameterMapping>
  <ParameterMapping>
    <ParameterName>timestep</ParameterName>
    <DefaultValue>720</DefaultValue>
  </ParameterMapping>
</StoredQueryConfiguration>

I'm using a hypothetical EL here to provide readability. The above xml
structure is raw, not much though has been put into it yet. Comments are
always appreciated.

As in the example above, the same configuration could be used to provide
sane defaults to be used when no value is provided in the request.

But yes, I don't think there is any issue adding a javabean based
property accessor (maybe check if you need to add dependencies though, like
commons-beanutils, to make it run, or if the stuff you need is already
there)

Ok. I'll look into that once we get settled if I really need beans or not.

Do you see a way to achieve what I proposed above without using beans? I
could always synthesize a simple feature type and use that as the CQL
context, but that seems like an awful amount of work (and kludges) to get
something pretty simple achieved.

The thing is, to parse a CQL expression you don't need a feature type, the
parser just extracts the variable names you're providing
as is, it's only at evaluation time that we try to use them, and discover
if the feature has them, or not (well, we actually have some
tools to compare the attributes required with the feature type, but that's
something we do in order to provide nice error messages,
in your case you can compare the variable values with whatever value you
have in your context

True about parsing the expression. But when evaluating it, the context
object seems to have be a SimpleType. This is because the existing
accessors only support properties as they are encoded into SimpleType
objects, and for the accessor to access the properties, there must be a
schema that describes these properties. This is why I was looking into
creating a Java Beans based property accessor.

But you might be right that it could be simpler to just test against the
property names and directly return the correct values. This actually has
the upside that it would make it easy to lazily calculate the bbox envelope
so it's not done if the values are not required by the query. I'll look
into this as my first option.

  Sampo

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.