tibonto / aeon

The Academic Event Ontology (AEON) can be used to represent information regarding academic events.
https://tibonto.github.io/aeon/
Creative Commons Attribution 4.0 International
14 stars 4 forks source link

OBO URI resolution does not lead to RDF #73

Closed andrecastro0o closed 3 years ago

andrecastro0o commented 3 years ago

In https://github.com/TIBHannover/ontology2smw I am querying the ontology schemas used by aeon to get info such as title and description onto MediaWiki:Smw_import pages, ie. https://www.confident-conference.org/r/vanilla/index.php/MediaWiki:Smw_import_owl

And I noticed that rdflib is having producing errors when querying OBO/

in aeon.ttl the obo prefix has the URI https://github.com/tibonto/aeon/blob/273743d0c346dc829f90ca524e92f6d4fd5fac09/aeon.ttl#L6

However there is no OBO ontology RDF document and their server is not able to resolve correctly As you will be able to see in the next comment's curl commands http://purl.obolibrary.org/obo/ does not resolve to any ontology.

It seems to be a feature of their setup, where http://purl.obolibrary.org/obo/BFO_0000179 resolves to
http://www.ontobee.org/ontology/BFO?iri=http://purl.obolibrary.org/obo/BFO_0000179 which in turn has the RDF in http://www.ontobee.org/ontology/rdf/BFO?iri=http://purl.obolibrary.org/obo/BFO_0000179

There is probably nothing that can be changed, but I am just expressing my confusing and seeing if @StroemPhi & @clange have some thoughts on it.

andrecastro0o commented 3 years ago

When I try to get the OBO ontology the server responds with 303 FOUND

$ curl -I -H "Accept: application/rdf+xml" http://purl.oclc.org/obo/

Response:

HTTP/1.1 302 FOUND
Server: nginx/1.16.1 (Ubuntu)
Date: Sun, 11 Oct 2020 09:02:59 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 201
Connection: keep-alive
Location: http://www.berkeleybop.org/ontologies/
Access-Control-Allow-Origin: *

If I keep resolving the URLs to the current location document and run:

$ curl -I -H "Accept: application/rdf+xml" http://ontologies.berkeleybop.org

Response:

HTTP/1.1 200 OK
Content-Type: application/xml
Connection: keep-alive
Date: Sun, 11 Oct 2020 08:59:16 GMT
x-amz-bucket-region: us-east-1
Server: AmazonS3
X-Cache: Hit from cloudfront
Via: 1.1 292bf579bbf52fb581ef04e0d0f088e8.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: AMS50-C1
X-Amz-Cf-Id: wrzdMegzVrbQ10VTSD4W_-3IyqUoVukKVqAY9o26KRAwbEkhHxzyhg==
Age: 340

Now if I request the content: $ curl -H "Accept: application/rdf+xml" http://ontologies.berkeleybop.org The response and is a XML, but not RDF

<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>bbop-ontologies</Name><Prefix></Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>true</IsTruncated><Contents><Key>aeo.obo</Key><LastModified>2016-11-24T23:12:24.000Z</LastModified><ETag>&quot;f7a6a0717bd7ede5af05c87c4640e8f3&quot;</ETag><Size>73206</Size><StorageClass>REDUCED_REDUNDANCY</StorageClass></Contents><Contents><Key>aeo.obo.gz</Key><LastModified>2020-04-08T07:37:31.000Z</LastModified><ETag>&quot;cd1ce3a24373dfe81d482976d2d70b2f&quot;</ETag>

Which is the list in http://ontologies.berkeleybop.org/

andrecastro0o commented 3 years ago

https://github.com/tibonto/aeon/blob/273743d0c346dc829f90ca524e92f6d4fd5fac09/aeon.ttl#L4-L5 bfo and iao URIs, on the other hand, point to the OWL file, which is piece of cake for rdflib to parse.

StroemPhi commented 3 years ago

We decided upon the following workflow (which seems to be also the standard, right @clange?):

StroemPhi commented 3 years ago

@andrecastro0o today I stumbled across this: https://groups.google.com/forum/#!topic/bfo-discuss/nivJyw17Bfs, which is why in my current issue branch, I've refactored the imported terms to their standard IRIs. I think we need to talk about this, maybe within our TIB-Onto-Call on thrusday?

StroemPhi commented 3 years ago

@andrecastro0o here's how @mconlon17 did the renaming of prefixes although the terms are all in the OBO namespace using ROBOT templates: https://github.com/mconlon17/organization-ontology/blob/master/build.sh

andrecastro0o commented 3 years ago

@StroemPhi thank you for the links and examples. From what I gather OBO ontolotologies tend to define entities located in other namespaces. As described in https://owlready2.readthedocs.io/en/latest/namespace.html

Ontologies can define entities located in other namespaces . An example is Gene Ontology (GO): the ontology IRI is ‘http://purl.obolibrary.org/obo/go.owl’, but the IRI of GO entities are not of the form ‘http://purl.obolibrary.org/obo/go.owl#GO_entity’ but ‘http://purl.obolibrary.org/obo/GO_entity’ (note the missing ‘go.owl#’).

Which is followed by one example of how OWLReady gets from the ontology Namespace the entities namespace. Now for https://github.com/TIBHannover/ontology2smw would be nice if the could the inverse: from the terms' Namespace we could retrieve the ontology namespace, so that the application could query the ontology owl for metadata like author, data, version, etc. Perhaps @mconlon17 has a suggestion for this :) A simple way to go about it is to include a dictionary of all the OBO ontologies, with: terms NS: ontology NS

In any case I suggest that in AEON you follow the OBO standard of way of writing down the OBO prefix: <terms Namespace>.

andrecastro0o commented 3 years ago

Interesting finding Ontobee seems to have a different way to do content negotiation from how it is recommend in https://www.w3.org/TR/swbp-vocab-pub/ According to https://doi.org/10.1093/nar/gkw918 the RDF of a term can be requested with curl -L http://purl.obolibrary.org/obo/IAO_0000315 and the term definition and related terms will be returned in RDF.

It is unlike the W3C Best Practice Recipes for Publishing RDF Vocabularies in which the content negotiation is done by providing HTTP request headers. curl -H "Accept: application/rdf+xml" http://www.w3.org/ns/prov# OR curl -H "Accept: text/turtle" http://www.w3.org/ns/prov#

Yet it leaves unanswered the question of "how to finding ontology Namespace its entities namespace?" so that ontology metadata can be requested.

StroemPhi commented 3 years ago

We've decided to revert back to the OBO prefix standard in v0.3.0.

@andrecastro0o do we want to close this issue for now and reopen later, if needed?

andrecastro0o commented 3 years ago

sure lets close it for now @StroemPhi