Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[bioontology-support] Error in JSON-LD links context?

Paul R Alexander palexand at stanford.edu
Mon Mar 28 13:48:25 PDT 2016


There is no property information that exists in the underlying RDF that can be used for hypermedia links. As you suggest, we could have created link types (http://data.bioontology.org/metadata/ChildrenLink) and a whole RDF schema to handle the hypermedia linking, but from a developer perspective when writing a hypermedia client I want to know at a minimum 1) the name of the link, 2) the type of object I can expect at that link.

That allows me to write a client that understands that there is a thing typed as owl#Class and it should be handled in a certain way (deserialized, serialized, created, deleted, etc). To get to that minimum level of information using a RDF approach that includes typing the links was seen as a barrier to usage.

Even now, the RDF model isn't broken in my opinion. For example, the links for a class look like this in RDF:
<http://purl.obolibrary.org/obo/ICO_0000071> <http://data.bioontology.org/metadata/links> _:b0 .
_:b0 <http://data.bioontology.org/metadata/Instance> "http://data.bioontology.org/ontologies/ICO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FICO_0000071/instances" .
_:b0 <http://data.bioontology.org/metadata/Mapping> "http://data.bioontology.org/ontologies/ICO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FICO_0000071/mappings" .
_:b0 <http://data.bioontology.org/metadata/Note> "http://data.bioontology.org/ontologies/ICO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FICO_0000071/notes" .

So class http://purl.obolibrary.org/obo/ICO_0000071 has links represented by _:b0. Link _:b0 connects to http://data.bioontology.org/metadata/Instance objects at URL http://data.bioontology.org/ontologies/ICO/classes/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FICO_0000071/instances<http://data.bioontology.org/ontologies/ICO/classes/http://purl.obolibrary.org/obo/ICO_0000071/instances>. It's not super intuitive but it also doesn't seem broken to me.

Again, I would defer to the current BioPortal team on any of this. I'm just providing my perspective.

Best,
Paul


On Mar 28, 2016, at 12:23 PM, Clement Jonquet <jonquet at lirmm.fr<mailto:jonquet at lirmm.fr>> wrote:

I understand design choices and the compromise is necessary certainly…  but I don’t see how having the type information e.g., owl#Class rather than the property information e.g., metadata/children actually make the hypermedia API more useful?

Clement

De : bioontology-support [mailto:bioontology-support-bounces at lists.stanford.edu] De la part de Paul R Alexander
Envoyé : mardi 22 mars 2016 02:46
À : Emonet <vincent.emonet at lirmm.fr<mailto:vincent.emonet at lirmm.fr>>
Cc : bioontology-support at lists.stanford.edu<mailto:bioontology-support at lists.stanford.edu>
Objet : Re: [bioontology-support] Error in JSON-LD links context?

Vincent,

Just a little history as to why it's done this way. We chose JSON-LD for the REST API because it provided a good compromise between proper RDF and developer usability. When we decided to make the API hypermedia-based we knew that it could clash a bit with the RDF in JSON-LD and this is the exact area where the clash occurs.

Exposing the links using the proper RDF would cause a usability problem for developers, the vast majority of whom don't care about the underlying RDF semantics and would be very confused by having to learn RDF to traverse the data we expose. When we designed the API there weren't great standards for using JSON-LD to expose hypermedia links, so that may have changed and there may be better solutions out there.

We also felt that the links weren't a part of the underlying data model we are exposing but something we were layering on top, IE if you put all of the data as RDF into a triplestore, the links would not be represented and would not be traversable because they aren't actually data within the system (there is no RDF object that corresponds to an ontology's roots, for example, even though there is a REST endpoint for that data).

I'll leave it to the current BioPortal team to offer an official recommendation here, but my sense is that it's just a quirk of trying to adhere to standards where we can while also trying to make the system usable by as many people as possible.

Best,
Paul


On Mar 21, 2016, at 8:53 AM, Emonet <vincent.emonet at lirmm.fr<mailto:vincent.emonet at lirmm.fr>> wrote:

Hi,
It seems like there is an error in the JSON-LD @context for Links
The context should provide the properties URI. e.g.: " name": "http://data.bioontology.org/metadata/omvname"<http://data.bioontology.org/metadata/omvname>,"
But instead it is providing the object type: " children": "http://www.w3.org/2002/07/owl#Class"<http://www.w3.org/2002/07/owl#Class>,"

@context should be "traducing" the property terms used in the JSON as an IRI. For instance in
http://data.bioontology.org/ontologies/STY/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSTY%2FT057
The @context defines that the predicate "obsolete" has http://data.bioontology.org/metadata/owlobsolete as property
So it is representing the following triple: < http://purl.bioontology.org/ontology/STY/T057"> <http://data.bioontology.org/metadata/owlobsolete> false .

But the @context generated for "links" is it:
@context": {
•         "self": "http://www.w3.org/2002/07/owl#Class"<http://www.w3.org/2002/07/owl#Class>,
•         "ontology": "http://data.bioontology.org/metadata/Ontology"<http://data.bioontology.org/metadata/Ontology>,
•         "children": "http://www.w3.org/2002/07/owl#Class"<http://www.w3.org/2002/07/owl#Class>,
•         "parents": "http://www.w3.org/2002/07/owl#Class"<http://www.w3.org/2002/07/owl#Class>,
•         "descendants": "http://www.w3.org/2002/07/owl#Class"<http://www.w3.org/2002/07/owl#Class>,
•         "ancestors": "http://www.w3.org/2002/07/owl#Class"<http://www.w3.org/2002/07/owl#Class>,
•         "tree": "http://www.w3.org/2002/07/owl#Class"<http://www.w3.org/2002/07/owl#Class>,
•         "notes": "http://data.bioontology.org/metadata/Note"<http://data.bioontology.org/metadata/Note>,
•         "mappings": "http://data.bioontology.org/metadata/Mapping"<http://data.bioontology.org/metadata/Mapping>,
•         "ui": "http://www.w3.org/2002/07/owl#Class"<http://www.w3.org/2002/07/owl#Class>
}


These are not the properties that are defined here, but the types of the objects
This JSON is defining the following triple:
<node "links" of http://purl.bioontology.org/ontology/STY/T057> <http://www.w3.org/2002/07/owl#Class> <http://data.bioontology.org/ontologies/STY/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSTY%2FT057/parents> .

When it should define the following one:
<node "links" of http://purl.bioontology.org/ontology/STY/T057> <http://data.bioontology.org/metadata/parents<http://data.bioontology.org/metadata/Mapping>> <http://data.bioontology.org/ontologies/STY/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSTY%2FT057/parents> .

If we want to define types we would have to do the following:
@context": {
•         "parents": {@type: "http://www.w3.org/2002/07/owl#Class"<http://www.w3.org/2002/07/owl#Class>},
}

This error is only in @context of link. If we look at how you define the context for the class, we have the following (that respects the w3c recommendation):


"@context": {
•         "@vocab": "http://data.bioontology.org/metadata/"<http://data.bioontology.org/metadata/>,
•         "prefLabel": "http://data.bioontology.org/metadata/skosprefLabel"<http://data.bioontology.org/metadata/skosprefLabel>,
•         "synonym": "http://data.bioontology.org/metadata/sk ossynonym "<http://data.bioontology.org/metadata/skossynonym>,
•         "definition": "http://data.bioontology.org/metadata/skosdefinition"<http://data.bioontology.org/metadata/skosdefinition>,
•         "obsolete": "http://data.bioontology.org/metadata/owlobsolete"<http://data.bioontology.org/metadata/owlobsolet%20e>,
•         "semanticType": "http://data.bioontology.org/metadata/umlssemanticType"<http://data.bioontology.org/metadata/umlssemanticType>,
•         "cui": "http://data.bioontology.org/metadata/umlscui"<http://data.bioontology.org/metadata/umlscui>
}


It seems the Links context are generated here : https://github.com/ncbo/ontologies_linked_data/blob/master/lib/ontologies_linked_data/serializers/json.rb#L71

Note that to understand the use of @context I used the w3c recommendation : http://www.w3.org/TR/json-ld/#base-iri


Is it an expected behavior? Or is there a problem when generating the links context?


Have a good day,

Vincent Emonet



_______________________________________________
bioontology-support mailing list
bioontology-support at lists.stanford.edu<mailto:bioontology-support at lists.stanford.edu>
https://mailman.stanford.edu/mailman/listinfo/bioontology-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20160328/ff7d843c/attachment-0001.html>


More information about the bioontology-support mailing list