Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable filtering of featureType in /location/contains #35

Open
jyucsiro opened this issue Nov 20, 2019 · 9 comments
Open

enable filtering of featureType in /location/contains #35

jyucsiro opened this issue Nov 20, 2019 · 9 comments

Comments

@jyucsiro
Copy link
Contributor

jyucsiro commented Nov 20, 2019

The current behaviour of /location/contains is that it returns all features that is contained within it.

It would be good to have an input flag, i.e. output_featuretype_uri, to enable users to specify which FeatureType instances are returned.

Example:

This would be useful for IDerdown for crosswalking.

@dr-shorthair
Copy link

Where is the API documented? Is this a HTTP GET or POST?

@jyucsiro
Copy link
Contributor Author

At the moment, it's deployed at https://api2.loci.cat/ and it's documented in the swagger/openapi doc at https://api2.loci.cat/api/v1/doc

This is a HTTP GET currently.

@dr-shorthair
Copy link

dr-shorthair commented Nov 20, 2019

OK - so an example query might be

https://api2.loci.cat/api/v1/location/contains?uri=http://linked.data.gov.au/dataset/asgs2016/statisticalarealevel3/80106

I wonder if it should also be implemented via

http://linked.data.gov.au/dataset/asgs2016/statisticalarealevel3/80106/contains

(probably as a redirect to the first version of course)

@dr-shorthair
Copy link

BTW - could example calls be added to the Swagger?

@jyucsiro
Copy link
Contributor Author

OK - so an example query might be

https://api2.loci.cat/api/v1/location/contains?uri=http://linked.data.gov.au/dataset/asgs2016/statisticalarealevel3/80106

yes

I wonder if it should also be implemented via
http://linked.data.gov.au/dataset/asgs2016/statisticalarealevel3/80106/contains
(probably as a redirect to the first version of course)

the integration-api (api2.loci.cat) and the LD APIs (where http://linked.data.gov.au/dataset/asgs2016/statisticalarealevel3/80106 resolves to) are two different components.

what you are suggesting sounds like a feature for the LD API to extend it with spatial REST operators?

@dr-shorthair
Copy link

Yes, I realise it requires ops on a different server, which may not be available.
But to my eyes the API is a traditional RPC, merely dressed up as a URI.
The actual 'resource' is a 'contains-service' that takes arguments.

I'm suggesting a more RESTful pattern might be possible: where http://yadayada/contains identifies a resource composed of the set of features contained in the base resource.

However, if a contains-service with arguments is what the market expects, then that is probably what we should provide.

@jyucsiro
Copy link
Contributor Author

agree, but lets separate concerns on the components.

for the integration-api (which interfaces with a cache of those LD resources) - agree
https://api2.loci.cat/api/v1/location/contains?uri=http://linked.data.gov.au/dataset/asgs2016/statisticalarealevel3/80106
... is more rpc style

the team did discuss an alternative when we were designing the APIs (more RESTful api endpoint for the call), which would be
https://api2.loci.cat/api/v1/location/{uri}/contains

e.g. for uri http://linked.data.gov.au/dataset/asgs2016/statisticalarealevel3/80106
the call would be:
https://api2.loci.cat/api/v1/location/http%3A%2F%2Flinked.data.gov.au%2Fdataset%2Fasgs2016%2Fstatisticalarealevel3%2F80106/contains

where the URI is url-encoded. it is an option that the team has discussed previously. the reluctance was on the url-encoding of the URI which is an extra step...

note: some doco here - https://github.com/CSIRO-enviro-informatics/loci-integration-api/wiki

@dr-shorthair
Copy link

url-encoded is ugly if you do it manually.
https://www.url-encode-decode.com/

@jyucsiro
Copy link
Contributor Author

even if done automatically, it's an extra step a developer has to make (maybe not a big step). there are benefits to having it more RESTful and worth exploring.

@jyucsiro jyucsiro added this to the Loc-I Phase 2 (2020-2021) milestone May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants