opendata-swiss / dcat_ap_ch

Examples for geocat and DCAT data-catalogs are given here
5 stars 3 forks source link

Dereferencable access to Controlled Vocabularies #186

Closed l00mi closed 2 years ago

l00mi commented 2 years ago

Please be aware of the following used and automatically created Controlled Vocabularies:

Organisations: https://register.ld.admin.ch/opendataswiss/org Category: https://register.ld.admin.ch/opendataswiss/category Licences: https://ld.admin.ch/vocabulary/TermsOfUse

They were created and used because of the lack of any missing list so far.

Please make sure that the CV are accessible through dereferencing in the final version.

See http://dcat-ap.ch/vocabulary/licenses/terms_by, vs. https://ld.admin.ch/vocabulary/TermsOfUse/Provide-the-Source while using the Content Header: Accept: text/turtle

sabinem commented 2 years ago

@l00mi Thanks so much for pointing this out. I found this guide here: https://www.w3.org/TR/swbp-vocab-pub/ and we will fix this, so that dereferencing will be possible.

Juan-Juan-1 commented 2 years ago

@sabinem "ready" or "done"...?

sabinem commented 2 years ago

@Juan-Juan-1: "Ready" is correct: it has not yet been done, since I was waiting about the decision where the vocabulary will be managed. So this should be implemented now?

Juan-Juan-1 commented 2 years ago

@sabinem yeah I think so. Thank you!

sabinem commented 2 years ago

@l00mi This was already implemented using recipe 4 from the linked w3.org page. When checking, we noticed that TTL redirects were not set up correctly and were redirecting to the HTML pages. This is now fixed.

Testing the dereferencing according to the instructions on the w3.org page

Example: text/turtle (application/rdf+xml works similar)

curl -X GET https://www.dcat-ap.ch/vocabulary/licenses/ -H 'Accept: text/turtle' -v

Requesting a vocabulary in text/turtle format should return a response with the following lines in the response header:

HTTP/1.x 303 See Other
Location: https://www.dcat-ap.ch/vocabulary/licenses/20210623.ttl

Requesting the URL returned above should return the entire vocabulary in text/turtle format.

curl -X GET https://www.dcat-ap.ch/vocabulary/licenses/20210623.ttl
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dc11: <http://purl.org/dc/elements/1.1/> .
@prefix skosxl: <http://www.w3.org/2008/05/skos-xl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<http://dcat-ap.ch/vocabulary/licenses>
  a owl:Ontology, skos:ConceptScheme ;
  owl:versionInfo "202100623" ;
  owl:versionIRI <http://dcat-ap.ch/vocabulary/licenses/20210623/> ;
  rdfs:comment "Liste der Lizenzen, die im Feld dct:license einer DCAT-AP CH-konformen dcat:distribution für die 
                          Zulieferung an   opendata.swiss erlaubt sind."@de ,
                        "List of licenses that are allowed in the field dct:license for delivering a dcat:Distribution
                         in a way that conforms to DCAT-AP CH"@en ;
  rdfs:label "Liste der Lizenzen"@de, "List of Licenses"@en;
  skos:prefLabel "Liste der Lizenzen"@de ;
  dct:identifier "http://dcat-ap.ch/vocabulary/licenses" .

  ...

The expected behaviour is the same for HTML requests, except that requesting a specific item from a vocabulary will receive a redirect to the #anchor for that vocabulary on the HTML page.

curl -X GET https://www.dcat-ap.ch/vocabulary/licenses/terms_by -H 'Accept: text/html' -v
HTTP/1.x 303 See Other
Location: https://www.dcat-ap.ch/vocabulary/licenses/20210623.html#terms_by

Requesting the URL returned above should return the entire vocabulary in HTML format. Open the link with a browser to be directed to the #anchor point.

l00mi commented 2 years ago

Thank you for fixing this, much better.

The solution with redirects is a bit 2008ish, but it is valid and good enough for a vocabulary. We might discuss how to improve this with direct dereferencing in the future. Especially for the CVs, which might be queried often, this might be a necessary improvement in the future.

I like to have a discussion in general how the CV is maintained after the end of this eCH effort, next year if possible.