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

Content Negotiation #124

Closed
marqh opened this issue Jun 29, 2021 · 12 comments
Closed

Content Negotiation #124

marqh opened this issue Jun 29, 2021 · 12 comments

Comments

@marqh
Copy link
Member

marqh commented Jun 29, 2021

Related to #123 but with some different nuance

i am struggling with content negotiation with the OGC registry

I expect

wget --header 'Accept:text/ttl' -O bald.ttl https://www.opengis.net/def/binary-array-ld

to return the turtle encoded Owl Ontology
this currently works using a hard coded redirect, as described in #123

i also expect this pattern to work for individual resources.
So, while

wget --header 'Accept:text/html' -O Reference.html https://www.opengis.net/def/binary-array-ld/Reference

successfully resolves to the html web page
I would expect

wget --header 'Accept:text/ttl' -O Reference.ttl https://www.opengis.net/def/binary-array-ld/Reference

to return the Owl definition of the owl:Class bald:Reference

but no, i get an `ERROR 404: Not Found' response

this is surprising and concerning

more experimentation unearths the pattern

wget --header 'Accept:text/turtle' -O Reference.ttl http://defs.opengis.net/vocprez/object?uri=https%3A//www.opengis.net/def/binary-array-ld/Reference

but this returns a payload of

@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
<https://www.opengis.net/def/binary-array-ld/Reference> a skos:Concept ;
    skos:broader <https://www.opengis.net/def/binary-array-ld/Resource> ;
    skos:definition "Reference"@en ;
    skos:prefLabel "Reference"@en .

This is also unexpected. The resource https://www.opengis.net/def/binary-array-ld/Reference is defined within https://www.opengis.net/def/binary-array-ld as

@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct:   <http://purl.org/dc/terms/> .
<https://www.opengis.net/def/binary-array-ld/Reference>
        a                owl:Class ;
        rdfs:label       "Reference" ;
        rdfs:subClassOf  <https://www.opengis.net/def/binary-array-ld/Resource> ;
        dct:description  "The definition of a reference from one Array to another." .

but I don't seem to be able to return this payload from the definitions server

Please may you help / advise on this behaviour and whether the requirement from me is clear?

thank you
mark

@marqh marqh mentioned this issue Jul 1, 2021
@ghobona
Copy link
Contributor

ghobona commented Jul 2, 2021

The PR #127 adds a section describing the role of Content Negotiation.

@rob-metalinkage
Copy link
Contributor

requirement is understood...

the wrinkle here is that is not so easy to define how to return an "OWL snippet" - because generally many different pieces of an ontology may refer to a class - such as rdfs:domain and range statements, statements about the properties of the class etc..

so generally we'll return an entire OWL file or an HTML rendering of OWL file with a fragment identifier etc.

stay tuned - working on this now - I've just completed a flexible automated entailment and SHACL validation environment in python which can be run on the desktop or as a github action - this is because the "whole repository" approach previously available was nearly impossible to debug. I now have to extend the scope of the processing to the incubation area for models such as this..

@ghobona
Copy link
Contributor

ghobona commented Jul 6, 2021

@rob-metalinkage How about simply running a DESCRIBE command on the subject you want to query?

For example, DESCRIBE <http://www.opengis.net/def/sensor-model/csmwg/csm> used in a SPARQL query with the Accept parameter set to the relevant media type.

See the output on the attached screenshot (using Postman).

Screenshot 2021-07-06 at 08 34 30

@dr-shorthair
Copy link

https://www.w3.org/Submission/CBD/ was a useful start. I'd add inverse links as well as outbound relations.

@dr-shorthair
Copy link

@ghobona I understand that DESCRIBE is implementation specific.

@ghobona
Copy link
Contributor

ghobona commented Jul 6, 2021

I presume that CBD was submitted to W3C in 2005 and never approved as a W3C Recommendation. Am I right?

@dr-shorthair
Copy link

That's correct.

@ghobona ghobona added this to Backlog in Definitions Server via automation Dec 1, 2021
@nicholascar
Copy link
Contributor

The query above demonstrating the deficinecy, wget --header 'Accept:text/ttl' -O Reference.ttl https://www.opengis.net/def/binary-array-ld/Reference still returns 404 but now also returns an Alternate Profiles Link header payload listing the profiles & formats that are available and the text "A profile for the requested URI base exists but no rules match for the requested format".

Content Negotiation by Profile suggests that the server should not respond with Not Found but instead with the default profile/format combo.

I suggest that the ConnegP instructions should be followed but that a note similar to "A profile for the requested URI base exists but no rules match for the requested format" be included in the response. This may clean up some perceptions of the Content Negotiation implementation.

CBD

It does appear, from multiple projects not just here, that we generally need a profile defined around the CBD definition which is then all data the system holds centered on the requested object. I expect such a profile is a "fundamental" profile, just as "Container Members" and "Container Annotations" (all info other than member listing) are such profiles. We - OGC and all of us - are missing a catalogue of such fundamental profiles.

@nicholascar
Copy link
Contributor

The "Container Annotations" fundamental profile is defined: https://w3id.org/profile/contanno.

I will:

@ghobona
Copy link
Contributor

ghobona commented Aug 2, 2022

Additional request for Content Negotiation to enable access to JSON and XML representations of Tile Matrix Sets.

#106 (comment)

Cc: @jerstlouis

@rob-metalinkage
Copy link
Contributor

Revisiting the original issue -

a) text/ttl not supported (its text/turtle) - an elegant response to be provided.
b) we have changed back end processes and now have the full turtle etc available, but exposing these and the redirect to this has not been made available to the production server yet (its using vocprez's limited internal graph view not the source material at the moment)

We'll sort these out.

@ghobona
Copy link
Contributor

ghobona commented Nov 17, 2023

Tested and confirmed to work through Postman.

Screenshot 2023-11-17 at 18 36 34

Closing the GitHub Issue.

@ghobona ghobona closed this as completed Nov 17, 2023
Definitions Server automation moved this from Backlog to Done Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

5 participants