52North/IlwisCore

Resource drops query string from Url

ridoo opened this issue · 2 comments

Problem Description:
Creating a Resource with a URL containing a query, it will be dropped so that it is not accessible anymore. This causes problems creating features from different remote services which may only be distinguished by these URL query parameters.

This is true for every remote service as an HTTP URL hides the actual type of service (which may invoke different types of connectors)! Connector implementations of the Ilwis framework rely on URL query parts to resolve a remote resource.

Take standardized OGC services for example. Each request has to declare the service type, e.g.

  http://ogi.state.ok.us/geoserver/wfs?request=GetCapabilities&service=WFS

With this a WfsCatalogConnector can directly tell it can handle that type of URL when Ilwis Core asks it via ConnectorInterface::canUse(Resource &resource).

Proposed Solution:
Resource class take the query parameters as private member and make it accessible via QUrlQuery Resource::getQuery() and adding an optional (but convenient) bool Resource::hasQuery().

The URL fragment is also removed by the Resource ... not sure if this would also need to store it somewhere similar to the query string.

For now I don't have a concrete example where this may become important though (perhaps when dealing with semantics, linked data, ... )

we will see. we need to take care that a selection on the datasource and an identification of datasource are handled correctly. A identification may never be stripped, a selection must be stripped ( at least that is my current line of thinking).