<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hello Lorenz,
<div class=""><br class="">
</div>
<div class="">The /ontologies/:ontology/classes/:cls/tree call returns the tree structure for the given :cls object.  In other words, you’ll get a path to the root from the :cls object you designate (as well as sibling classes in the structure).</div>
<div class=""><br class="">
</div>
<div class="">In your examples below, you used the “Physical object” (ID: <a href="http://purl.bioontology.org/ontology/SNOMEDCT/260787004" class="">
http://purl.bioontology.org/ontology/SNOMEDCT/260787004</a>) and “Clinical finding” (ID:
<a href="http://purl.bioontology.org/ontology/SNOMEDCT/404684003" class="">http://purl.bioontology.org/ontology/SNOMEDCT/404684003</a>) classes.  Both of these classes are top-level classes in the SNOMEDCT hierarchy.  So, there isn’t any tree structure to return
 here, other than the sibling classes at the root of the ontology, i.e. for Physical object the structure is:</div>
<div class=""><br class="">
</div>
<div class="">|-- Body structure</div>
<div class="">|-- Clinical finding</div>
<div class="">|-- Environment or geographical location</div>
<div class="">|-- Event</div>
<div class="">|-- Observable entity</div>
<div class="">|-- Organism</div>
<div class="">|-- Pharmaceutical / biologic product</div>
<div class="">|-- Physical force</div>
<div class="">|-- Physical object</div>
<div class="">|-- etc…</div>
<div class=""><br class="">
</div>
<div class="">If your example had used a class further down the hierarchy such as “Industrial transport vehicle” (ID:
<a href="http://purl.bioontology.org/ontology/SNOMEDCT/705447007" class="">http://purl.bioontology.org/ontology/SNOMEDCT/705447007</a>), e.g.:</div>
<div class=""><br class="">
</div>
<div class=""><a href="http://data.bioontology.org/ontologies/SNOMEDCT/classes/http://purl.bioontology.org/ontology/SNOMEDCT/705447007/tree" class="">http://data.bioontology.org/ontologies/SNOMEDCT/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSNOMEDCT%2F705447007/tree</a></div>
<div class=""><br class="">
</div>
<div class="">… the results contain the tree structure for this class, i.e., the path to root and sibling classes:</div>
<div class=""><br class="">
</div>
<div class="">|-- Physical object</div>
<div class="">    |-- Floor mat</div>
<div class="">    |-- Device</div>
<div class="">    |-- Instrument of aggression</div>
<div class="">    |-- Vehicle</div>
<div class="">        |-- Nontraffic vehicle</div>
<div class="">        |-- Mobile medical facility</div>
<div class="">        |-- <b class="">Industrial transport vehicle</b></div>
<div class=""><b class="">        </b>|-- Transport vehicle</div>
<div class="">        |-- Pedestrian conveyance</div>
<div class="">    |-- Printed material</div>
<div class="">    |-- etc…</div>
<div class="">|-- etc…</div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class="">Jennifer</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On Mar 11, 2016, at 3:56 AM, Lorenz buehmann <<a href="mailto:buehmann@informatik.uni-leipzig.de" class="">buehmann@informatik.uni-leipzig.de</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div text="#000000" bgcolor="#FFFFFF" class="">Hello Jennifer,<br class="">
<br class="">
thank you, that's quite helpful. I will try the inclusion of properties via REST parameters.<br class="">
<br class="">
But can you clarify the meaning of<br class="">
<br class="">
/ontologies/:ontology/classes/:cls/tree<br class="">
<br class="">
For me it seems like it returns the root classes of the ontology, but then I'm wondering why :cls is sued as parameter.<br class="">
<br class="">
<br class="">
Kind regards,<br class="">
Lorenz<br class="">
<br class="">
<div class="moz-cite-prefix">On 10.03.2016 22:38, Jennifer Leigh Vendetti wrote:<br class="">
</div>
<blockquote cite="mid:5AC98B63-6AB8-488A-8D2D-D1963B610721@stanford.edu" type="cite" class="">
Hello Lorenz,
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Mar 9, 2016, at 2:15 AM, Lorenz B. <<a moz-do-not-send="true" href="mailto:buehmann@informatik.uni-leipzig.de" class=""></a><a class="moz-txt-link-abbreviated" href="mailto:buehmann@informatik.uni-leipzig.de">buehmann@informatik.uni-leipzig.de</a>>
 wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div smarttemplateinserted="true" bgcolor="#FFFFFF" text="#000000" class="">
<div id="smartTemplate4-template" class="">Hello,<br class="">
<br class="">
I'm wondering whether it's possible to get children of a given class via the REST interface.
</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Yes, you can either get direct children, or all children.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><b class="">Direct Children</b></div>
<div class=""><br class="">
</div>
<div class="">Uses this format:</div>
<div class=""><br class="">
</div>
<div class="">/ontologies/:ontology/classes/:cls/children</div>
<div class=""><br class="">
</div>
<div class="">Using your class as an example:</div>
<div class=""><br class="">
</div>
<div class=""><a moz-do-not-send="true" href="http://data.bioontology.org/ontologies/SNOMEDCT/classes/http://purl.bioontology.org/ontology/SNOMEDCT/260787004/children" class="">http://data.bioontology.org/ontologies/SNOMEDCT/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSNOMEDCT%2F260787004/children</a></div>
<div class=""><br class="">
</div>
<div class=""><b class=""><br class="">
</b></div>
<div class=""><b class="">All Children</b></div>
<div class=""><br class="">
</div>
<div class="">Uses this format:</div>
<div class=""><br class="">
</div>
<div class="">/ontologies/:ontology/classes/:cls/descendants</div>
<div class=""><br class="">
</div>
<div class="">Using your class as an example:</div>
<div class=""><br class="">
</div>
<div class=""><a moz-do-not-send="true" href="http://data.bioontology.org/ontologies/SNOMEDCT/classes/http://purl.bioontology.org/ontology/SNOMEDCT/260787004/descendants" class="">http://data.bioontology.org/ontologies/SNOMEDCT/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSNOMEDCT%2F260787004/descendants</a></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div smarttemplateinserted="true" bgcolor="#FFFFFF" text="#000000" class="">
<div id="smartTemplate4-template" class="">I know that there is one request<br class="">
<br class="">
/ontologies/:ontology/classes/:cls/tree<br class="">
<br class="">
but it looks like it always returns the root classes only, and not the subclasses of the given class. see for example both links below:<br class="">
<br class="">
<a moz-do-not-send="true" href="http://data.bioontology.org/ontologies/SNOMEDCT/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSNOMEDCT%2F260787004/tree" style="font-family: monospace; font-size: 14.3px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">"http://data.bioontology.org/ontologies/SNOMEDCT/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSNOMEDCT%2F260787004/tree"</a><br class="">
<br class="">
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://data.bioontology.org/ontologies/SNOMEDCT/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSNOMEDCT%2F404684003/tree">http://data.bioontology.org/ontologies/SNOMEDCT/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSNOMEDCT%2F404684003/tree</a><br class="">
<br class="">
For me this looks like a bug because otherwise there would be no need to have this for each class, but only for the ontology itself. Moreover, the
<br class="">
"children" property is always an empty array here.<br class="">
<br class="">
Indeed I could use as REST request <br class="">
<br class="">
/ontologies/:ontology/classes/:cls/children<br class="">
<br class="">
but this does not return information like "hasChildren" which is quite useful when building the class tree, like it's done in the public BioPortal UI.<br class="">
</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">If you want to get information about whether a class has children, or the child count, you can use the “include” parameter, e.g.:</div>
<div class=""><br class="">
</div>
<div class=""><a moz-do-not-send="true" href="http://data.bioontology.org/ontologies/SNOMEDCT/classes/http://purl.bioontology.org/ontology/SNOMEDCT/260787004?include=hasChildren,childrenCount" class="">http://data.bioontology.org/ontologies/SNOMEDCT/classes/http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSNOMEDCT%2F260787004?include=hasChildren,childrenCount</a></div>
<div class=""><br class="">
</div>
<div class="">Hope that helps.</div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class="">Jennifer</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
</div>
</blockquote>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>