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?

Clement Jonquet jonquet at lirmm.fr
Mon Mar 28 12:23:03 PDT 2016


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>
Cc : 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://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> 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://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> 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/skossynonym> "http://data.bioontology.org/metadata/sk ossynonym ",

*         "definition":  <http://data.bioontology.org/metadata/skosdefinition> "http://data.bioontology.org/metadata/skosdefinition",

*         "obsolete":  <http://data.bioontology.org/metadata/owlobsolet%20e> "http://data.bioontology.org/metadata/owlobsolete",

*         "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/001cf351/attachment-0001.html>


More information about the bioontology-support mailing list