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] get tree of a given class via REST interface

Jennifer Leigh Vendetti vendetti at
Mon Mar 14 15:10:46 PDT 2016

Hello Lorenz,

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).

In your examples below, you used the “Physical object” (ID: and “Clinical finding” (ID: 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:

|-- Body structure
|-- Clinical finding
|-- Environment or geographical location
|-- Event
|-- Observable entity
|-- Organism
|-- Pharmaceutical / biologic product
|-- Physical force
|-- Physical object
|-- etc…

If your example had used a class further down the hierarchy such as “Industrial transport vehicle” (ID:, e.g.:<>

… the results contain the tree structure for this class, i.e., the path to root and sibling classes:

|-- Physical object
    |-- Floor mat
    |-- Device
    |-- Instrument of aggression
    |-- Vehicle
        |-- Nontraffic vehicle
        |-- Mobile medical facility
        |-- Industrial transport vehicle
        |-- Transport vehicle
        |-- Pedestrian conveyance
    |-- Printed material
    |-- etc…
|-- etc…


On Mar 11, 2016, at 3:56 AM, Lorenz buehmann <buehmann at<mailto:buehmann at>> wrote:

Hello Jennifer,

thank you, that's quite helpful. I will try the inclusion of properties via REST parameters.

But can you clarify the meaning of


For me it seems like it returns the root classes of the ontology, but then I'm wondering why :cls is sued as parameter.

Kind regards,

On 10.03.2016 22:38, Jennifer Leigh Vendetti wrote:
Hello Lorenz,

On Mar 9, 2016, at 2:15 AM, Lorenz B. <<mailto:buehmann at>buehmann at<mailto:buehmann at>> wrote:


I'm wondering whether it's possible to get children of a given class via the REST interface.

Yes, you can either get direct children, or all children.

Direct Children

Uses this format:


Using your class as an example:<>

All Children

Uses this format:


Using your class as an example:<>

I know that there is one request


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:


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
"children" property is always an empty array here.

Indeed I could use as REST request


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.

If you want to get information about whether a class has children, or the child count, you can use the “include” parameter, e.g.:,childrenCount<,childrenCount>

Hope that helps.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the bioontology-support mailing list