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] [BioPortal] Feedback from fawks

Jennifer Leigh Vendetti vendetti at stanford.edu
Wed Jul 18 15:47:15 PDT 2018


Hi Alex,

No, that wasn’t a dumb question at all.

It looks like I missed something in my initial reply to you. If you use the hasChildren include parameter when issuing a REST call for a single class, the data will get returned successfully, e.g.:

This call to get a MEDDRA class:

http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222?include=prefLabel,cui,hasChildren<http://data.bioontology.org/ontologies/MEDDRA/classes/http://purl.bioontology.org/ontology/MEDDRA/10028222?include=prefLabel,cui,hasChildren>

… returns the hasChildren boolean:

[cid:96167143-32FA-42F2-ADD3-958703D5A858 at stanford.edu]

However, if you issue a REST call to get all classes for MEDDRA, it appears that the hasChildren include parameter is ignored, i.e.:

This call to get all the classes:

http://data.bioontology.org/ontologies/MEDDRA/classes?include=prefLabel,cui,hasChildren

… results in a collection of classes that don’t have the hasChildren boolean (as you point out below):

[cid:8EF231CE-426F-4F83-9D03-0D53DABC01B5 at stanford.edu]


I think this is a bug in our software. We have code that checks the list of include parameters and returns an HTTP 422 status code for any parameters that aren’t allowed for a particular endpoint:

https://github.com/ncbo/ontologies_api/blob/master/controllers/classes_controller.rb#L233

The 422 response is only returned for the include parameters of all, descendants, and ancestors, e.g.:

[cid:D25CF51E-C8CB-40C5-B073-6E768874F68A at stanford.edu]

I’ve entered an issue in our tracker for this today:

https://github.com/ncbo/ontologies_api/issues/49

Apologies, but until we get that issue sorted out, I think you’ll need to ignore my suggestion to check this property before making calls to get children.

Kind regards,
Jennifer



On Jul 18, 2018, at 11:26 AM, Alex Fawksson <fawks14 at gmail.com<mailto:fawks14 at gmail.com>> wrote:

Ok, that may sound like a really dumb question but where exactly is hasChildren boolean in this?
{

  *   "prefLabel": "Multiple idiopathic hemorrhagic sarcoma",
  *
-
"cui": [
     *   "C0036220"
],
  *   "@id": "http://purl.bioontology.org/ontology/MEDDRA/10028222"<http://purl.bioontology.org/ontology/MEDDRA/10028222>,
  *   "@type": "http://www.w3.org/2002/07/owl#Class"<http://www.w3.org/2002/07/owl#Class>,
  *
-
"links": {
     *   "self": "http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222"<http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222>,
     *   "ontology": "http://data.bioontology.org/ontologies/MEDDRA"<http://data.bioontology.org/ontologies/MEDDRA>,
     *   "children": "http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/children"<http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/children>,
     *   "parents": "http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/parents"<http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/parents>,
     *   "descendants": "http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/descendants"<http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/descendants>,
     *   "ancestors": "http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/ancestors"<http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/ancestors>,
     *   "instances": "http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/instances"<http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/instances>,
     *   "tree": "http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/tree"<http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/tree>,
     *   "notes": "http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/notes"<http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/notes>,
     *   "mappings": "http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/mappings"<http://data.bioontology.org/ontologies/MEDDRA/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222/mappings>,
     *   "ui": "http://bioportal.bioontology.org/ontologies/MEDDRA?p=classes&conceptid=http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222"<http://bioportal.bioontology.org/ontologies/MEDDRA?p=classes&conceptid=http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FMEDDRA%2F10028222>,
     *
-
"@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>,
        *   "instances": "http://data.bioontology.org/metadata/Instance"<http://data.bioontology.org/metadata/Instance>,
        *   "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>
}
},
  *
-
"@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>,
     *   "cui": "http://data.bioontology.org/metadata/umlscui"<http://data.bioontology.org/metadata/umlscui>
}

}

2018-07-18 21:18 GMT+03:00 Jennifer Leigh Vendetti <vendetti at stanford.edu<mailto:vendetti at stanford.edu>>:
Hello Alex,


> On Jul 18, 2018, at 10:02 AM, Alex Fawksson <fawks14 at gmail.com<mailto:fawks14 at gmail.com>> wrote:
>
> Hello Jennifer, thank you for your advice. Using children instead of descandants is very sound idea. As for modified API calls I tried using it with parameters you recommended but encountered one problem. PrefLabel and Cui worked but hasChildren doesn't seem to work. If I understood correctly it should have only listed elements that have children but it still included childless elements into the list.


Apologies if I didn’t explain the hasChildren attribute in enough detail.

It’s a boolean attached to a class object that simply indicates whether or not a class has children. Including this property when using the classes endpoint won’t filter out classes with no children. You would still need to iterate over the collection of MEDDRA classes, checking the value of hasChildren for each class, and retrieving the children if hasChildren = true.

Let me know if that makes sense.

Kind regards,
Jennifer




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20180718/ec4cb48b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2018-07-18 15.05.26.png
Type: image/png
Size: 308422 bytes
Desc: Screenshot 2018-07-18 15.05.26.png
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20180718/ec4cb48b/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2018-07-18 15.09.02.png
Type: image/png
Size: 361078 bytes
Desc: Screenshot 2018-07-18 15.09.02.png
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20180718/ec4cb48b/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2018-07-18 15.20.52.png
Type: image/png
Size: 67715 bytes
Desc: Screenshot 2018-07-18 15.20.52.png
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20180718/ec4cb48b/attachment-0005.png>


More information about the bioontology-support mailing list