Difference between revisions of "App/API/Ontology/ontology class"

From mx Help Wiki
Jump to: navigation, search
m (Example)
m (Example)
Line 31: Line 31:
 
Redirects to the '''/public/ontology_class/show-expanded/ID''' action.
 
Redirects to the '''/public/ontology_class/show-expanded/ID''' action.
  
== Example ==
+
== Example (JSON) ==
  
 
Request:
 
Request:

Revision as of 15:45, 22 February 2011

Back to ontology API home

Contents

Description

http://base_url/api/ontology/ontology_class/<CLASS_ID>

Defaults to returning HTML. Pass an OBO formatted ID with colon translated to underscore. API returns the possible labels (and associated references), and relationships for the class.

Response (JSON)

CLASS_ID:
 definition: definition
 label: name
 relationships: 
   [
    {  subject: 
         id: CLASS_ID1
         label: name
       predicate: 
         id: ID
         name: name
       object: 
         id: CLASS_ID2
         label: name
    }
    ... 
   ]

Response (HTML)

Redirects to the /public/ontology_class/show-expanded/ID action.

Example (JSON)

Request:

http://api.hymao.org/api/ontology/ontology_class/HAO_0000397.json

Response:

{"HAO:0000397":
  {"label":"head",
   "relationships":
      [
        {"predicate":"is_a",
         "subject":{"label":"head","id":"HAO:0000397"},
         "object":{"label":"tagma","id":"HAO:0000988"}
        },
        {"predicate":"part_of",
         "subject": {"label":"head","id":"HAO:0000397"},
         "object":{"label":"body","id":"HAO:0000182"}
        }
      ],
  "definition":"The tagma that is located anterior to the thorax."}
}
Personal tools