This API is comprised of a set of resources (Ontologies, Classes, etc) and related endpoints (Search, Annotator, Recommender) that are connected together via links, much like webpages. We recommend that you try browsing the API using a web browser (Chrome and Firefox work very well while IE does not) before you start writing code. For more information, please see the documentation on Media Types and Hypermedia Links or view our sample code , available in Java, Python, Ruby and other languages (please email support@bioontology.org if you would like examples in another language).
Parameter | Possible Values | Description |
---|---|---|
apikey | {your api key} |
An API Key is required to access any API call. It can be provided in three ways:
|
include |
all {comma-separated list of attributes, EX: attr1,attr2} |
By default, the API will show a subset of the available attributes for a given media type.
This behavior can be overridden by providing
The
The |
format |
json jsonp xml |
The API returns JSON as the default content type. This can be overridden by using the format
query string parameter. The API also respects Accept header entries, with precedence given
to the format parameter.
|
page | {integer representing the page number} |
For calls that are paged, this will indicate which page number you want to retrieve.
You can follow hypermedia links for nextPage and prevPage as well.
|
pagesize | {integer representing the size of the returned page} | For calls that are paged, this will indicate the size of the page you want to retrieve. |
include_views | {boolean representing whether or not to include ontology views (default is false)} | For calls that involve ontologies, include_views='true' will include ontology views. |
display_context | {true|false} (defaults to true) | Turn off the JSON-LD context serialization. This will reduce the response size significantly for some calls, speeding up transmission and parse time. |
display_links | {true|false} (defaults to true) | Turn off the hypermedia link serialization. This will reduce the response size significantly for some calls, speeding up transmission and parse time. |
download_format | {csv|rdf} (defaults to user-uploaded file format) | Allows you to specify alternative formats for ontology file downloads for ontology and ontology submission download endpoints. CSV is only available for the most recent submission. |
Several endpoints are available for performing lookups for classes, annotations, and annotated resources. These endpoints are not strictly RESTful, but do return objects with links where relevant.
An endpoint for searching terms and their properties is available
/search?q={search query}
The same endpoint also allows limiting a search to a given subtree/branch. The root of the subtree is defined using a combination of parameters "ontology" and "subtree_root_id". Both are required when performing a subtree search.
The same endpoint allows limiting a search to root classes only.
An endpoint for searching ontology properties by their labels and IDs (URIs)
/property_search?q={search query}
The Annotator endpoint will examine text input and return relevant classes.
/annotator?text={input text}
The Recommender endpoint receives a text or a list of keywords and suggests appropriate ontologies for them.
/recommender?input={input text or keywords}
The Resource Index contains a collection of annotated resources that can be searched by providing ontology acronyms with a corresponding class id or set of ids.
expand_class_hierarchy={true|false}
Search for all of the descendants of the given classboolean_operator={or|and}
When searching for multiple classes, should documents include all classes (AND) or any class (OR)Requests to the counts endpoint will retrieve the number of documents in which the given classes are found.
/resource_index/counts?classes[ontology_id1]=class_id1
/resource_index/counts?classes[ontology_id1]=class_id1,class_id2
/resource_index/counts?classes[ontology_id1]=class_id1&classes[ontology_id2]=class_id1,class_id2
Requests to the search endpoint will retrieve the documents in which given classes are found. The response is paged.
/resource_index/resources/{resource_id}/search?classes[ontology_id1]=class_id1
/resource_index/resources/{resource_id}/search?classes[ontology_id1]=class_id1,class_id2
/resource_index/resources/{resource_id}/search?classes[ontology_id1]=class_id1&classes[ontology_id2]=class_id1,class_id2
/resource_index/resources
/resource_index/resources/{resource_id1}
In order to reduce the number of HTTP requests required to obtain information about resources, we are exploring the use of batch endpoints that will use one request/response cycle for multiple resources. Currently, only classes are supported.
POST /batch
The batch service takes input in the BODY of a POST request. The input should be a JSON document with the following structure:
{ "http://www.w3.org/2002/07/owl#Class": { "collection": [ { "class": "http://example.org/ontology1/class1", "ontology": "http://example.org/ontology1" }, { "class": "http://example.org/ontology2/class1", "ontology": "http://example.org/ontology2" }, { "class": "http://example.org/ontologyN/classN", "ontology": "http://example.org/ontologyN" } ], "display": "prefLabel,synonym,semanticTypes" } }
Example:
{ "http://www.w3.org/2002/07/owl#Class": { "collection": [ { "class": "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Ontology_Development_and_Management", "ontology": "http://data.bioontology.org/ontologies/BRO" }, { "class": "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Modular_Component", "ontology": "http://data.bioontology.org/ontologies/BRO" }, { "class": "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Stimulator", "ontology": "http://data.bioontology.org/ontologies/BRO" } ], "display": "prefLabel,synonym,semanticTypes" } }
An endpoint for retrieving ontology visitor stats provided by Google Analytics.
Allows to retrieve analytics for all ontologies for a specific month/year combination
/analytics
/analytics?month={month number}&year={year}
Allows to retrieve ALL analytics data for a single ontology
/ontologies/{acronym}/analytics
Endpoints for RESTful resources can be found below, specifically in the list of Media Types. Using the provided hypermedia links, you can navigate from resource to resource. Each Media Type has a corresponding collection URL (when available), a list of HTTP verbs that can be used to operate on the resources, a description of the resource (including available attributes), and a list of hypermedia links that can be found on each resource.
The documentation below describes the media types that available in the API and the hypermedia links that connect them. Media types describe the types of resources available, including the HTTP verbs that may be used with them and the attributes that each resource contains.
This programming interface comprises HTTP commands that return objects that themselves contain links to other locations in the form of a URL. In addition to the actual return values, the returned objects contain a set of links to related information. You can access these links using HTTP commands, typically GET. Thus, it is possible to traverse BioPortal's information for an ontology, including classes, notes, and reviews, by starting from the list of ontologies and traversing the available links - either programmatically or in a browser. The different resources are described below, including information about their available attributes, links, and the HTTP verbs that can be used to interact with them.
The API uses different verbs to support processing of resources. This includes things like creating or deleting individual resources or something more specific searching or annotating. Typically, the verbs will be used in conjunciton with the URL that represents the id for a given resource. Here is how we interpret the verbs:
HTTP Verb | Path |
---|---|
GET | /ontologies/:acronym/categories |
GET | /categories |
GET | /categories/:acronym |
POST | /categories |
PATCH | /categories/:acronym |
DELETE | /categories/:acronym |
PUT | /categories/:acronym |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
acronym | true | true | true | ||
name | true | true | |||
description | true | ||||
created | true | ||||
parentCategory | true | http://data.bioontology.org/metadata/Category | |||
ontologies | true | http://data.bioontology.org/metadata/Ontology |
HTTP Verb | Path |
---|---|
GET | /ontologies/:ontology/classes |
GET | /ontologies/:ontology/classes/roots_paged |
GET | /ontologies/:ontology/classes/roots |
GET | /ontologies/:ontology/classes/:cls |
GET | /ontologies/:ontology/classes/:cls/paths_to_root |
GET | /ontologies/:ontology/classes/:cls/tree |
GET | /ontologies/:ontology/classes/:cls/ancestors |
GET | /ontologies/:ontology/classes/:cls/descendants |
GET | /ontologies/:ontology/classes/:cls/children |
GET | /ontologies/:ontology/classes/:cls/parents |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
prefLabel | true | true | |||
synonym | true | true | |||
definition | true | true | |||
obsolete | true | ||||
semanticType | true | true | |||
cui | true | true | |||
label | true | ||||
notation | |||||
prefixIRI | |||||
parents | true | http://www.w3.org/2002/07/owl#Class | |||
ancestors | http://www.w3.org/2002/07/owl#Class | ||||
children | http://www.w3.org/2002/07/owl#Class | ||||
subClassOf | true | ||||
xref | |||||
notes | http://data.bioontology.org/metadata/Note | ||||
properties | |||||
childrenCount | |||||
hasChildren |
HTTP Verb | Path |
---|---|
GET | /ontologies/:acronym/groups |
GET | /groups |
GET | /groups/:acronym |
POST | /groups |
PATCH | /groups/:acronym |
DELETE | /groups/:acronym |
PUT | /groups/:acronym |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
acronym | true | true | true | ||
name | true | true | |||
description | true | ||||
created | true | ||||
ontologies | true | http://data.bioontology.org/metadata/Ontology |
HTTP Verb | Path |
---|---|
GET | /ontologies/:ontology/classes/:cls/instances |
GET | /ontologies/:ontology/instances |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
label | |||||
id | |||||
properties | |||||
label= | |||||
add_property_value |
HTTP Verb | Path |
---|---|
GET | /ontologies/:ontology/classes/:cls/mappings |
GET | /ontologies/:ontology/mappings |
GET | /mappings |
GET | /mappings/recent |
GET | /mappings/:mapping |
GET | /mappings/statistics/ontologies |
GET | /mappings/statistics/ontologies/:ontology |
POST | /mappings |
DELETE | /mappings/:mapping |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
source | |||||
id | |||||
process | |||||
classes |
HTTP Verb | Path |
---|---|
GET | /metrics |
GET | /metrics/missing |
GET | /ontologies/:ontology/metrics |
GET | /ontologies/:ontology/submissions/:submissionId/metrics |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
submission | true | http://data.bioontology.org/metadata/OntologySubmission | |||
created | true | ||||
classes | true | true | |||
individuals | true | true | |||
properties | true | true | |||
maxDepth | true | true | |||
maxChildCount | true | true | |||
averageChildCount | true | true | |||
classesWithOneChild | true | true | |||
classesWithMoreThan25Children | true | true | |||
classesWithNoDefinition | true | true |
HTTP Verb | Path |
---|---|
GET | /ontologies/:ontology/notes?:include_threads? |
GET | /ontologies/:ontology/classes/:cls/notes?:include_threads? |
GET | /notes?:include_threads? |
GET | /notes/:noteid?:include_threads? |
POST | /notes |
PATCH | /notes/:noteid |
DELETE | /notes/:noteid |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
subject | true | ||||
body | true | ||||
creator | true | true | http://data.bioontology.org/metadata/User | ||
created | true | ||||
archived | true | ||||
createdInSubmission | true | http://data.bioontology.org/metadata/OntologySubmission | |||
reply | true | true | http://data.bioontology.org/metadata/Reply | ||
relatedOntology | true | true | true | http://data.bioontology.org/metadata/Ontology | |
relatedClass | true | true | http://www.w3.org/2002/07/owl#Class | ||
proposal | true | http://data.bioontology.org/metadata/Base |
HTTP Verb | Path |
---|---|
GET | /notes/:noteid/replies |
GET | /replies?:include_threads? |
GET | /replies/:replyid |
POST | /replies |
PATCH | /replies/:replyid |
DELETE | /replies/:replyid |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
body | true | true | |||
creator | true | true | http://data.bioontology.org/metadata/User | ||
created | true | ||||
children | true | http://data.bioontology.org/metadata/Reply | |||
parent | http://data.bioontology.org/metadata/Reply |
HTTP Verb | Path |
---|---|
GET | /ontologies/:ontology/properties |
GET | /ontologies/:ontology/properties/roots |
GET | /ontologies/:ontology/properties/:property |
GET | /ontologies/:ontology/properties/:property/label |
GET | /ontologies/:ontology/properties/:property/tree |
GET | /ontologies/:ontology/properties/:property/ancestors |
GET | /ontologies/:ontology/properties/:property/descendants |
GET | /ontologies/:ontology/properties/:property/parents |
GET | /ontologies/:ontology/properties/:property/children |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
label | true | true | |||
definition | true | true | |||
parents | true | true | http://www.w3.org/2002/07/owl#ObjectProperty | ||
children | true | http://www.w3.org/2002/07/owl#ObjectProperty | |||
submission | |||||
ancestors | |||||
descendants |
HTTP Verb | Path |
---|---|
GET | /ontologies |
GET | /ontologies/:acronym |
GET | /ontologies/:acronym/latest_submission |
GET | /ontologies/:acronym/download |
GET | /ontologies_full |
POST | /ontologies |
PATCH | /ontologies/:acronym |
DELETE | /ontologies/:acronym |
PUT | /ontologies/:acronym |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
acronym | true | true | true | ||
name | true | true | true | ||
administeredBy | true | true | true | http://data.bioontology.org/metadata/User | |
flat | true | ||||
summaryOnly | true | ||||
ontologyType | true | http://data.bioontology.org/metadata/OntologyType | |||
submissions | http://data.bioontology.org/metadata/OntologySubmission | ||||
projects | http://data.bioontology.org/metadata/Project | ||||
notes | http://data.bioontology.org/metadata/Note | ||||
reviews | http://data.bioontology.org/metadata/Review | ||||
provisionalClasses | http://data.bioontology.org/metadata/ProvisionalClass | ||||
subscriptions | http://data.bioontology.org/metadata/Subscription | ||||
group | true | http://data.bioontology.org/metadata/Group | |||
viewingRestriction | |||||
doNotUpdate | |||||
hasDomain | true | http://data.bioontology.org/metadata/Category | |||
acl | true | http://data.bioontology.org/metadata/User | |||
viewOf | http://data.bioontology.org/metadata/Ontology | ||||
views | http://data.bioontology.org/metadata/Ontology |
HTTP Verb | Path |
---|---|
GET | /submissions |
GET | /ontologies/:acronym/submissions |
GET | /ontologies/:acronym/submissions/:ontology_submission_id |
GET | /ontologies/:acronym/submissions/:ontology_submission_id/download |
GET | /ontologies/:acronym/submissions/:ontology_submission_id/download_diff |
POST | /submissions |
POST | /ontologies/:acronym/submissions |
PATCH | /ontologies/:acronym/submissions/:ontology_submission_id |
DELETE | /ontologies/:acronym/submissions/:ontology_submission_id |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
submissionId | true | true | |||
hasOntologyLanguage | true | true | http://data.bioontology.org/metadata/OntologyFormat | ||
homepage | true | ||||
publication | true | ||||
documentation | true | ||||
version | true | ||||
creationDate | true | ||||
description | true | ||||
status | true | ||||
contact | true | true | true | http://data.bioontology.org/metadata/Contact | |
released | true | true | |||
ontology | true | true | http://data.bioontology.org/metadata/Ontology | ||
prefLabelProperty | |||||
definitionProperty | |||||
synonymProperty | |||||
authorProperty | |||||
classType | |||||
hierarchyProperty | |||||
obsoleteProperty | |||||
obsoleteParent | |||||
uri | |||||
naturalLanguage | |||||
uploadFilePath | |||||
diffFilePath | |||||
masterFileName | |||||
submissionStatus | true | http://data.bioontology.org/metadata/SubmissionStatus | |||
missingImports | true | ||||
pullLocation | |||||
metrics | http://data.bioontology.org/metadata/Metrics |
HTTP Verb | Path |
---|---|
GET | /ontologies/:acronym/projects |
GET | /projects |
GET | /projects/:acronym |
POST | /projects |
PATCH | /projects/:acronym |
DELETE | /projects/:acronym |
PUT | /projects/:acronym |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
acronym | true | true | true | ||
creator | true | true | true | http://data.bioontology.org/metadata/User | |
created | true | ||||
updated | true | ||||
name | true | true | |||
homePage | true | true | |||
description | true | true | |||
contacts | true | ||||
institution | true | ||||
ontologyUsed | true | true | http://data.bioontology.org/metadata/Ontology |
HTTP Verb | Path |
---|---|
GET | /ontologies/:ontology/provisional_classes |
GET | /users/:user/provisional_classes |
GET | /provisional_classes |
GET | /provisional_classes/:provisional_class_id |
POST | /provisional_classes |
PATCH | /provisional_classes/:provisional_class_id |
DELETE | /provisional_classes/:provisional_class_id |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
label | true | true | |||
synonym | true | true | |||
definition | true | true | |||
subclassOf | true | ||||
creator | true | true | http://data.bioontology.org/metadata/User | ||
created | true | ||||
permanentId | true | ||||
noteId | true | ||||
ontology | true | http://data.bioontology.org/metadata/Ontology | |||
relations | true | http://data.bioontology.org/metadata/ProvisionalRelation |
HTTP Verb | Path |
---|---|
GET | /provisional_relations |
GET | /provisional_relations/:provisional_relation_id |
POST | /provisional_relations |
DELETE | /provisional_relations/:provisional_relation_id |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
source | true | true | http://data.bioontology.org/metadata/ProvisionalClass | ||
relationType | true | true | |||
targetClassId | true | true | |||
targetClassOntology | true | true | http://data.bioontology.org/metadata/Ontology | ||
creator | true | true | http://data.bioontology.org/metadata/User | ||
created | true |
HTTP Verb | Path |
---|---|
GET | /ontologies/:acronym/reviews |
GET | /reviews |
GET | /reviews/:review_id |
POST | /reviews |
PATCH | /reviews/:review_id |
DELETE | /reviews/:review_id |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
creator | true | true | http://data.bioontology.org/metadata/User | ||
created | true | ||||
updated | true | ||||
body | true | true | |||
ontologyReviewed | true | true | http://data.bioontology.org/metadata/Ontology | ||
usabilityRating | true | ||||
coverageRating | true | ||||
qualityRating | true | ||||
formalityRating | true | ||||
correctnessRating | true | ||||
documentationRating | true |
HTTP Verb | Path |
---|---|
GET | /slices |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
acronym | true | true | true | ||
name | true | true | |||
description | true | ||||
created | true | ||||
ontologies | true | true | true | http://data.bioontology.org/metadata/Ontology |
HTTP Verb | Path |
---|---|
GET | /users |
GET | /users/:username |
POST | /users/authenticate |
POST | /users/create_reset_password_token |
POST | /users/reset_password |
POST | /users |
PATCH | /users/:username |
DELETE | /users/:username |
PUT | /users/:username |
Attribute | Default | Unique | Required | List | Type |
---|---|---|---|---|---|
username | true | true | true | ||
true | true | ||||
role | true | true | http://data.bioontology.org/metadata/Role | ||
apikey | true | true | |||
firstName | |||||
lastName | |||||
created | |||||
subscription | true | http://data.bioontology.org/metadata/Subscription | |||
customOntology | true | http://data.bioontology.org/metadata/Ontology | |||
provisionalClasses | http://data.bioontology.org/metadata/ProvisionalClass |
The API returns JSON as the default content type. This can be overridden by using the format
query string parameter with the value json
, jsonp
, or xml
. The API also respects Accept
header entries
(EX: application/json
, application/xml
), with precedence given to the format
parameter.
The default content type is JSON, specifically a variant called JSON-LD,
or JSON Linked Data. You can treat this variant like normal JSON. All JSON parsers will be able
to parse the output normally. The benefit of JSON-LD is that it enables hypermedia links, and you
will find these links exposed as URLs in attributes labeled @id
, which correspond to the id of the
parent resource, or in an array called links
, which contains a hash of link types with corresponding URLs.
Here is a sample output of the JSON response format:
{ "administeredBy": [ "http://data.bioontology.org/user/nevada" ], "acronym": "ABA-API-TST", "name": "ABA Adult Mouse Brain", "@id": "http://data.bioontology.org/ontology/ABA-API-TST", "@type": "http://data.bioontology.org/metadata/Ontology", "links": { "metrics": "http://data.bioontology.org/ontologies/ABA-API-TST/metrics", "submissions": "http://data.bioontology.org/ontologies/ABA-API-TST/submissions", "classes": "http://data.bioontology.org/ontologies/ABA-API-TST/classes", "roots": "http://data.bioontology.org/ontologies/ABA-API-TST/classes/roots", "reviews": "http://data.bioontology.org/ontologies/ABA-API-TST/reviews" }, "@context": { "@vocab": "http://data.bioontology.org/metadata/", "acronym": "http://omv.ontoware.org/2005/05/ontology#acronym", "name": "http://omv.ontoware.org/2005/05/ontology#name", "administeredBy": { "@id": "http://data.bioontology.org/metadata/User", "@type": "@id" } } }
administeredBy
attribute
in the @context
hash.@context
hash or by appending the value of @vocab
(line 17) to an attribute name in cases where
the attribute isn't listed specifically in the @context
.XML is also available as an alternative content type.
Here is sample output for the XML format:
<ontology> <administeredByCollection> <administeredBy>http://data.bioontology.org/user/nevada</administeredBy> </administeredByCollection> <acronym>ABA-API-TST</acronym> <name>ABA Adult Mouse Brain</name> <id>http://data.bioontology.org/ontology/ABA-API-TST</id> <links> <self href="http://data.bioontology.org/ontology/ABA-API-TST" rel="http://data.bioontology.org/metadata/Ontology"/> <metrics href="/ontologies/ABA-API-TST/metrics"/> <submissions href="/ontologies/ABA-API-TST/submissions" rel="http://data.bioontology.org/metadata/OntologySubmission"/> <classes href="/ontologies/ABA-API-TST/classes" rel="http://www.w3.org/2002/07/owl#Class"/> <roots href="/ontologies/ABA-API-TST/classes/roots" rel="http://www.w3.org/2002/07/owl#Class"/> <reviews href="/ontologies/ABA-API-TST/reviews" rel="http://data.bioontology.org/metadata/Review"/> </links> </ontology>
href
attribute contains the link location and the rel
attribute defines the type
of resource that will be found at that location.href
and rel
attributes (coming soon...)