Difference between revisions of "BioPortal REST services"

From NCBO Wiki
Jump to navigation Jump to search
 
(96 intermediate revisions by 9 users not shown)
Line 1: Line 1:
The list below documents the NCBO Web services. For questions on how to use these Web services or to request features, contact [mailto:support@bioontology.org Support].
+
NCBO BioPortal v4.0 REST services are documented at: http://data.bioontology.org/documentation
 
 
The '''prefix''' for all production service URLs in the table below is http://rest.bioontology.org/
 
 
 
* '''<font color='red'>Note</font>''': All NCBO Web services will be required to contain the parameter "apikey=YourApiKey" starting June 2011. The parameter will be added to all Web service calls for the April 27, 2011 release but will not be required until June 2011. To obtain an API key, login to BioPortal and go to "Account" where your API key will be displayed. The addition of the API key replaces the use of the email parameter.
 
 
 
* '''''Note for Application Developers''''': Application developers will also need to include the apikey parameter on all NCBO Web service calls. This allows us to track usage of our system at the level of an application. To obtain an API key, login to BioPortal and go to "Account" where your API key will be displayed. The addition of the API key replaces the use of the email parameter.
 
 
 
* '''Note''': ''Signatures for BioPortal services have changed in BioPortal 2.0.4 release on January 13th, 2009. This page has the new service URLs.
 
 
 
= Overview - Using NCBO Technology in Your Project =
 
See [http://www.bioontology.org/wiki/index.php/Using_NCBO_Technology_In_Your_Project Using NCBO Technology in your Project] for general information and widgets available for use.
 
 
 
= Sample Code Cookbook =
 
*Examples of using the Web services in sample code can be found [http://www.bioontology.org/wiki/index.php/Sample_Code_Cookbook here]
 
**Sample code is located within the [https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2F NCBO Gforge repository] and can be checked out via anonymous SVN access
 
 
 
*Code examples for the [http://bioontology.org/wiki/index.php/Annotator_Web_service Annotator] and [http://www.bioontology.org/wiki/index.php/Resource_Index Resource Index] are located on the pages documenting these Web services
 
 
 
*Code examples for the ontology web services, developed in FlexViz, is available at: https://bmir-gforge.stanford.edu/gf/project/flexviz/frs/?action=index. To see the code in action, visit the [http://keg.cs.uvic.ca/ncbo/restservicestest/TestUI.html Test User Interface] that has been set-up using the FlexViz code.
 
 
 
= BioPortal Announce Mailing List =
 
To receive notices of new BioPortal releases, changes to web services, or planned downtime subscribe to the [https://mailman.stanford.edu/mailman/listinfo/bioportal-announce bioportal-annouce] list.
 
 
 
= Services to access ontologies and ontology versions =
 
 
 
== List all the latest version of ontologies ==
 
 
 
* '''Signature''': ./ontologies?apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/ontologies?apikey=YourAPIKey
 
 
 
==  Get a specific ontology based on a version id ==
 
* '''Signature''':  ./ontologies/{ontology version id}?apikey={YourAPIKey}
 
* '''Example''':  http://rest.bioontology.org/bioportal/ontologies/39002?apikey=YourAPIKey
 
 
 
==  Download an ontology file ==
 
* '''Description''': Download the file (.obo, .owl) corresponding to the given ontology version id.
 
* '''Signature''':  ./ontologies/download/{ontology version id}?email={email_address}
 
* '''Example''': http://rest.bioontology.org/bioportal/ontologies/download/39002?apikey=YourAPIKey
 
 
 
==  Download the latest ontology file ==
 
* '''Description''': Download the file (.obo, .owl) corresponding to the given virtual ontology id.
 
* '''Signature''':  ./virtual/download/{ontology id}?email={email_address}
 
* '''Example''': http://rest.bioontology.org/bioportal/virtual/download/1090?apikey=YourAPIKey
 
 
 
==  Get all versions of an ontology from a virtual ontology id ==
 
* '''Signature''': ./ontologies/versions/{ontology id}?apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/ontologies/versions/1104?apikey=YourAPIKey
 
 
 
==  Get latest version of an ontology id ==
 
* '''Signature''': ./virtual/ontology/{ontology_id}?apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/virtual/ontology/1104?apikey=YourAPIKey
 
 
 
==  List all ontology categories ==
 
'''NOTE''': ''To be released in BioPortal version 2.2''
 
* '''Signature''':  ./categories?email={email_address}
 
* '''Example''': http://rest.bioontology.org/bioportal/categories
 
 
 
==  List all ontology groups ==
 
'''NOTE''': ''To be released in BioPortal version 2.2''
 
* '''Signature''':  ./groups?email={email_address}
 
* '''Example''': http://rest.bioontology.org/bioportal/groups
 
 
 
= Services to access ontology views and ontology view versions =
 
 
 
Since all the views on ontologies are ontologies themselves all the services that work on ontologies do work for ontology views also with the same signature.
 
 
 
== Download a specific ontology view based on the ontology view version id ==
 
* '''Signature''': ./ontologies/download/{ontology version id}?apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/ontologies/download/43072?apikey=YourAPIKey
 
 
 
== Get all view versions of a virtual view ==
 
 
 
* '''Signature''': ./ontologies/versions/{ontology id}?apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/ontologies/versions/2070?apikey=YourAPIKey
 
 
 
 
 
However, there are a few Web services that are distinct for views.
 
 
 
== List all the latest version of views ==
 
* '''Signature''': ./views?apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/views?apikey=YourAPIKey
 
 
 
== Get all versions of views from a virtual ontology id ==
 
* '''Description''': Returns all versions of views defined on the latest version a virtual ontology, grouped by virtual view ids.
 
* '''Signature''': ./views/versions/{ontology id}?apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/views/versions/1104?apikey=YourAPIKey
 
 
 
= Search services =
 
 
 
==  Search BioPortal ==
 
* '''Signature''': ./search/{query}[?{optional args}]&apikey={YourAPIKey}
 
* '''Alt Signature''': ./search/?query={uri-encoded query}[&{optional args}]&apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/search/Gene?apikey=YourAPIKey
 
* '''Optional arguments:'''
 
** ontologyids=<ontologyid>,<ontologyid>… - limits the search to specific ontologies (default: all ontologies)
 
** isexactmatch=[1/0] – match the entire concept name (default: 0)
 
** includeproperties=[1/0] – include attributes in the search (default: 0)
 
** pagesize=<pagesize> - the number of results to display in a single request (default: all)
 
** pagenum=<pagenum> - the page number to display (pages are calculated using <total results>/<pagesize>) (default: 1)
 
** maxnumhits=<maxnumhits> - the maximum number of top matching results to return (default: 1000)
 
** subtreerootconceptid=<uri-encoded conceptid> - narrow the search to concepts residing in a sub-tree, where the "subtreerootconceptid" is the root node. This feature requires a SINGLE <ontologyid> passed in using the "onotlogyids" parameter.
 
** objecttypes=<class,individual,property> - limits the results returned to these types, multitple types can be included in the parameter, e.g. class,individual.
 
** includedefinitions={true} - if a search result is a hit for a term, adding this parameter will include the definition in the search result xml. '''Note''': Including the definition results in a slight performance hit.
 
* '''Description:'''
 
The search attempts to match both partial and exact queries, giving more weight to exact matches. In single-word searches, the wildcard character (*) is automatically appended to the end of the word. For example, searching for "lun" would return all concepts whose name contains a word that begins with "lun" (i.e. "Lung", "Murine Lunate Bone", "Base of the Lung", etc).
 
 
 
In phrase searches (multiple words), the wildcard character is appended to the end of each word. For example, searching for "cut mela" would return all concepts whose name contains a word starting with "cut", followed by any word that begins with "mela" (i.e. "Cutaneous Melanoma", "Metastatic Non-Cutaneous Melanoma", "Cutaneous Melanoma Clinical TNM Finding", etc).
 
 
 
* '''Example''': http://rest.bioontology.org/bioportal/search/software/?ontologyids=1104&isexactmatch=1&apikey=YourAPIKey
 
* '''Sample Output''':
 
<pre>
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<success>
 
<accessedResource>
 
/bioportal/search/cutaneous%20mela
 
</accessedResource>
 
<accessDate>2009-05-07 16:17:46.182 PDT</accessDate>
 
<data>
 
<page>
 
<pageNum>1</pageNum>
 
<numPages>1</numPages>
 
<pageSize>3</pageSize>
 
<numResultsPage>3</numResultsPage>
 
<numResultsTotal>3</numResultsTotal>
 
<contents
 
class="org.ncbo.stanford.bean.search.SearchResultListBean">
 
<searchResultList>
 
<searchBean>
 
<ontologyVersionId>39715</ontologyVersionId>
 
<ontologyId>1136</ontologyId>
 
<ontologyDisplayLabel>
 
Experimental Factor Ontology
 
</ontologyDisplayLabel>
 
<recordType>
 
RECORD_TYPE_PREFERRED_NAME
 
</recordType>
 
<conceptId>
 
http://www.ebi.ac.uk/efo/EFO_0000389
 
</conceptId>
 
<conceptIdShort>EFO_0000389</conceptIdShort>
 
<preferredName>
 
cutaneous melanoma
 
</preferredName>
 
<contents>cutaneous melanoma</contents>
 
</searchBean>
 
<searchBean>
 
<ontologyVersionId>39478</ontologyVersionId>
 
<ontologyId>1032</ontologyId>
 
<ontologyDisplayLabel>
 
NCI Thesaurus
 
</ontologyDisplayLabel>
 
<recordType>
 
RECORD_TYPE_PREFERRED_NAME
 
</recordType>
 
<conceptId>
 
http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#Cutaneous_Melanoma
 
</conceptId>
 
<conceptIdShort>
 
Cutaneous_Melanoma
 
</conceptIdShort>
 
<preferredName>
 
Cutaneous Melanoma
 
</preferredName>
 
<contents>Cutaneous Melanoma</contents>
 
</searchBean>
 
<searchBean>
 
<ontologyVersionId>39833</ontologyVersionId>
 
<ontologyId>1009</ontologyId>
 
<ontologyDisplayLabel>
 
Human disease
 
</ontologyDisplayLabel>
 
<recordType>
 
RECORD_TYPE_PREFERRED_NAME
 
</recordType>
 
<conceptId>DOID:2418</conceptId>
 
<conceptIdShort>DOID:2418</conceptIdShort>
 
<preferredName>
 
Cutaneous Melanocytic Neoplasm
 
</preferredName>
 
<contents>
 
Cutaneous Melanocytic Neoplasm
 
</contents>
 
</searchBean>
 
</searchResultList>
 
<ontologyHitList>
 
<ontologyHitBean>
 
<ontologyVersionId>39715</ontologyVersionId>
 
<ontologyId>1136</ontologyId>
 
<ontologyDisplayLabel>
 
Experimental Factor Ontology
 
</ontologyDisplayLabel>
 
<numHits>1</numHits>
 
</ontologyHitBean>
 
<ontologyHitBean>
 
<ontologyVersionId>39833</ontologyVersionId>
 
<ontologyId>1009</ontologyId>
 
<ontologyDisplayLabel>
 
Human disease
 
</ontologyDisplayLabel>
 
<numHits>1</numHits>
 
</ontologyHitBean>
 
<ontologyHitBean>
 
<ontologyVersionId>39478</ontologyVersionId>
 
<ontologyId>1032</ontologyId>
 
<ontologyDisplayLabel>
 
NCI Thesaurus
 
</ontologyDisplayLabel>
 
<numHits>1</numHits>
 
</ontologyHitBean>
 
</ontologyHitList>
 
</contents>
 
</page>
 
</data>
 
</success>
 
</pre>
 
 
 
= Term services =
 
(formerly referred to as Concept services)
 
 
 
==  Get term, including its properties, subclasses, and superclasses ==
 
* '''Signature''': ./concepts/{ontology version id}/{concept id}?apikey={YourAPIKey}
 
* '''Alt Signature''': ./concepts/{ontology version id}?conceptid={uri-encoded concept id}&apikey={YourAPIKey}
 
* '''Virtual Signature''' (always uses most recent version of the ontology): ./virtual/ontology/{ontology virtual id}/{concept id}
 
* '''Alt Virtual Signature''' (always uses most recent version of the ontology): ./virtual/ontology/{ontology virtual id}?conceptid={uri-encoded concept id}
 
**To ensure that the Web service works within your application, use the Alt signature as some ontologies may contain terms where the concept id is a URI.
 
* '''Optional arguments:'''
 
** light=[1/0] - when set to 1, returns the "light" version of XML with only a basic info for the concept and its immediate children
 
** norelations=[1/0] - when set to 1, returns only the requested term information (id, label, fullid, type, synonyms, definitions) without the "relations" map. This is useful when you need to quickly retrieve just the base information about a term.
 
** maxnumchildren - an integer that sets threshold on the number of children in the SubClass relation for a term. If a term contains more children than the "maxnumchildren", the SubClass relation returns an empty list. The ChildCount relation still contains the correct number of children.
 
 
 
* '''Example''': http://rest.bioontology.org/bioportal/concepts/44103?conceptid=O80-O84.9&apikey=YourAPIKey
 
* '''Example''': http://rest.bioontology.org/bioportal/concepts/44450?conceptid=BRO:Software&apikey=YourAPIKey
 
 
 
* '''Example''': http://rest.bioontology.org/bioportal/virtual/ontology/1516?conceptid=O80-O84.9&apikey=YourAPIKey
 
* '''Example''': http://rest.bioontology.org/bioportal/virtual/ontology/1104?conceptid=BRO:Software&apikey=YourAPIKey
 
 
 
 
 
* '''Sample Output''':
 
<pre>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<success>
 
  <accessedResource>/bioportal/concepts/44103</accessedResource>
 
  <accessDate>2010-12-08 16:57:43.763 PST</accessDate>
 
  <data>
 
    <classBean>
 
      <id>O80-O84.9</id>
 
      <fullId>http://purl.bioontology.org/ontology/ICD10/O80-O84.9</fullId>
 
 
 
      <label>Delivery</label>
 
      <type>Class</type>
 
      <relations>
 
        <entry>
 
          <string>SubClass</string>
 
          <list>
 
            <classBean>
 
 
 
              <id>O84</id>
 
              <fullId>http://purl.bioontology.org/ontology/ICD10/O84</fullId>
 
              <label>Multiple delivery</label>
 
              <type>Class</type>
 
              <relations>
 
                <entry>
 
                  <string>ChildCount</string>
 
 
 
                  <int>5</int>
 
                </entry>
 
              </relations>
 
            </classBean>
 
            <classBean>
 
              <id>O83</id>
 
              <fullId>http://purl.bioontology.org/ontology/ICD10/O83</fullId>
 
 
 
              <label>Other assisted single delivery</label>
 
              <type>Class</type>
 
              <relations>
 
                <entry>
 
                  <string>ChildCount</string>
 
                  <int>7</int>
 
                </entry>
 
 
 
              </relations>
 
            </classBean>
 
            <classBean>
 
              <id>O82</id>
 
              <fullId>http://purl.bioontology.org/ontology/ICD10/O82</fullId>
 
              <label>Single delivery by caesarean section</label>
 
              <type>Class</type>
 
 
 
              <relations>
 
                <entry>
 
                  <string>ChildCount</string>
 
                  <int>5</int>
 
                </entry>
 
              </relations>
 
            </classBean>
 
            <classBean>
 
 
 
              <id>O81</id>
 
              <fullId>http://purl.bioontology.org/ontology/ICD10/O81</fullId>
 
              <label>Single delivery by forceps and vacuum extractor</label>
 
              <type>Class</type>
 
              <relations>
 
                <entry>
 
                  <string>ChildCount</string>
 
 
 
                  <int>6</int>
 
                </entry>
 
              </relations>
 
            </classBean>
 
            <classBean>
 
              <id>O80</id>
 
              <fullId>http://purl.bioontology.org/ontology/ICD10/O80</fullId>
 
 
 
              <label>Single spontaneous delivery</label>
 
              <type>Class</type>
 
              <relations>
 
                <entry>
 
                  <string>ChildCount</string>
 
                  <int>4</int>
 
                </entry>
 
 
 
              </relations>
 
            </classBean>
 
          </list>
 
        </entry>
 
        <entry>
 
          <string>PAR</string>
 
          <list>
 
            <classBean>
 
 
 
              <id>O00-O99.9</id>
 
              <fullId>http://purl.bioontology.org/ontology/ICD10/O00-O99.9</fullId>
 
              <label>Pregnancy, childbirth and the puerperium</label>
 
              <type>Class</type>
 
              <relations>
 
                <entry>
 
                  <string>ChildCount</string>
 
 
 
                  <int>8</int>
 
                </entry>
 
              </relations>
 
            </classBean>
 
          </list>
 
        </entry>
 
        <entry>
 
          <string>ChildCount</string>
 
 
 
          <int>5</int>
 
        </entry>
 
        <entry>
 
          <string>Semantic_Type</string>
 
          <list>
 
            <string>Therapeutic or Preventive Procedure</string>
 
          </list>
 
 
 
        </entry>
 
        <entry>
 
          <string>TUI</string>
 
          <list>
 
            <string>T061</string>
 
          </list>
 
        </entry>
 
        <entry>
 
 
 
          <string>UMLS_CUI</string>
 
          <list>
 
            <string>C0011209</string>
 
          </list>
 
        </entry>
 
        <entry>
 
          <string>SuperClass</string>
 
 
 
          <list>
 
            <classBean>
 
              <id>O00-O99.9</id>
 
              <fullId>http://purl.bioontology.org/ontology/ICD10/O00-O99.9</fullId>
 
              <label>Pregnancy, childbirth and the puerperium</label>
 
              <type>Class</type>
 
              <relations>
 
 
 
                <entry>
 
                  <string>ChildCount</string>
 
                  <int>8</int>
 
                </entry>
 
              </relations>
 
            </classBean>
 
          </list>
 
        </entry>
 
 
 
      </relations>
 
    </classBean>
 
  </data>
 
</success>
 
</pre>
 
 
 
==  Get all root terms for an ontology version id ==
 
* '''Signature''': ./concepts/{ontology version id}/root?apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/concepts/39002/root?apikey=YourAPIKey
 
 
 
== Get a path between a term and the root ==
 
 
 
* '''Signature''': ./path/{ontology_version_id}/?source={concept1_id}&target=root&apikey=YourAPIKey
 
 
 
* '''Example''': http://rest.bioontology.org/bioportal/path/42838/?source=Transitional_Epithelium&target=root&apikey=YourAPIKey
 
* Note: If there is no path between the specified term and the set of nodes designated as "roots" then this method just returns the root node. Note that "root" here is defined as a set of classes which have been designated as "roots". It is not defined as a node which as no parents.
 
 
 
==  Get all terms using the specific ontology version id ==
 
 
 
'''NOTE:''' 'Get all terms' service has changed. The new signature and examples are reflected below. See [[#Changes_to_the_Get_all_terms_service]] for more information.
 
 
 
* '''Signature''': ./concepts/{ontology version id}/all?pagesize={pagesize}&pagenum={pagenum}&apikey={YourAPIKey}
 
* '''Examples''':
 
** http://rest.bioontology.org/bioportal/concepts/40644/all?pagesize=50&pagenum=1&apikey=YourAPIKey
 
** http://rest.bioontology.org/bioportal/concepts/42431/all?pagesize=50&pagenum=500&apikey=YourAPIKey
 
* '''Arguments:'''
 
** '''pagesize:''' An integer limiting how many results will be returned on a single page (a 'page' is equivalent to a single call to the REST service)
 
** '''pagenum:''' An integer indicating which page of results to return.
 
** '''maxnumchildren:''' An integer that sets threshold on the number of children in the SubClass relation for a term. If a term contains more children than the "maxnumchildren", the SubClass relation returns an empty list. The ChildCount relation still contains the correct number of children.
 
 
 
==  Get all terms using the virtual ontology id ==
 
 
 
'''NOTE:''' 'Get all terms' service has changed. The new signature and examples are reflected below. See [[#Changes_to_the_Get_all_terms_service]] for more information.
 
 
 
* '''Signature''': ./virtual/ontology/{ontology id}/all?pagesize={pagesize}&pagenum={pagenum}&apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/virtual/ontology/1104/all?&pagesize=50&pagenum=1&apikey=YourAPIKey
 
* '''Arguments:'''
 
** '''pagesize:''' An integer limiting how many results will be returned on a single page (a 'page' is equivalent to a single call to the REST service)
 
** '''pagenum:''' An integer indicating which page of results to return.
 
** '''maxnumchildren:''' An integer that sets threshold on the number of children in the SubClass relation for a term. If a term contains more children than the "maxnumchildren", the SubClass relation returns an empty list. The ChildCount relation still contains the correct number of children.
 
 
 
== Changes to the Get all terms service ==
 
 
 
Starting in BioPortal 2.3.1 (released March 15, 2010), the 'Get all terms' service has changed to support speedier and more complete term retrieval. To support this, several changes to the response XML and service signature are being made. Please see the following notes to update your existing applications to support these changes.
 
 
 
* '''Examples''': A preview of the new service can be seen on the NCBO staging site:
 
** http://rest.bioontology.org/bioportal/concepts/40644/all?pagesize=50&pagenum=1
 
** http://rest.bioontology.org/bioportal/concepts/42431/all?pagesize=50&pagenum=500
 
 
 
* '''Signature'''
 
** '''New parameters:''' Previously, offset and limit were used to control pagination of results. These parameters have been replaced as follows:
 
*** '''pagesize:''' An integer limiting how many results will be returned on a single page (a 'page' is equivalent to a single call to the REST service)
 
*** '''pagenum:''' An integer indicating which page of results to return.
 
*** '''maxnumchildren:''' An integer that sets threshold on the number of children in the SubClass relation for a term. If a term contains more children than the "maxnumchildren", the SubClass relation returns an empty list. The ChildCount relation still contains the correct number of children.
 
 
 
* '''Response''': The structure of the new 'Get all terms' response XML has been brought into line with other BioPortal REST term services. In addition, to assist in paging through result sets, 'page' metadata is provided. A list of classBeans is provided in the classBeanResultList element, which includes each classes' set of relations (examples of relations include SuperClass, SubClass, and rdfs:label). Please see the example below for a full demonstration of the new response.
 
 
 
= View Extraction Service =
 
* This web service can be used to extract a subtree from an ontology. See [http://www.bioontology.org/wiki/index.php/View_Extraction View Extraction] for usage details.
 
 
 
= Property Services =
 
''To be released October 2011''
 
 
 
=  Instance Services =
 
 
 
== Get all direct instances for a given term ==
 
* '''Signature''': ./concepts/instances/{ontlogyVersionId}[?conceptid={uri-encoded concept id}[&{optional args}]&apikey={YourAPIKey}
 
* '''Optional arguments:'''
 
** pagesize=<pagesize> - the number of results to display in a single request (default: all)
 
** pagenum=<pagenum> - the page number to display (pages are calculated using <total results>/<pagesize>) (default: 1)
 
 
 
* '''Example''': http://rest.bioontology.org/bioportal/concepts/instances/38801?conceptid=SubstrateType&pagesize=10&pagenum=1&apikey=YourAPIKey
 
* '''Description''': returns all direct instances for a given term.
 
* '''Sample Output:'''
 
<pre>
 
<?xml version="1.0" encoding="UTF8" ?>
 
<success>
 
<accessedResource>/bioportal/concepts/instances/38801
 
</accessedResource>
 
<accessDate>20100408 18:17:21.226 PDT</accessDate>
 
<data>
 
<page>
 
<pageNum>1</pageNum>
 
<numPages>5</numPages>
 
<pageSize>1</pageSize>
 
<numResultsPage>1</numResultsPage>
 
<numResultsTotal>5</numResultsTotal>
 
<contents class="org.ncbo.stanford.bean.concept.InstanceBeanResultListBean">
 
<list>
 
<instanceBean>
 
<id>unknown_substrate_type</id>
 
<fullId>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#unknown_substrate_type
 
</fullId>
 
<label>unknown_substrate_type</label>
 
<relations>
 
<entry>
 
<propertyBean>
 
<id>rdf:type</id>
 
<fullId>http://www.w3.org/1999/02/22rdfsyntaxns#type
 
</fullId>
 
<label>rdf:type</label>
 
<relations />
 
</propertyBean>
 
<list>
 
<instanceBean>
 
<id>SubstrateType</id>
 
<fullId>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#SubstrateType
 
</fullId>
 
<label>SubstrateType</label>
 
<relations />
 
<instanceType>
 
<list>
 
<classBean>
 
<id>owl:Class</id>
 
<fullId>http://www.w3.org/2002/07/owl#Class
 
</fullId>
 
<label>owl:Class</label>
 
<type>Class</type>
 
<relations />
 
</classBean>
 
</list>
 
</instanceType>
 
</instanceBean>
 
</list>
 
</entry>
 
<entry>
 
<propertyBean>
 
<id>:NAME</id>
 
<fullId>:NAME</fullId>
 
<label>:NAME</label>
 
<relations />
 
</propertyBean>
 
<list>
 
<string>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#unknown_substrate_type
 
</string>
 
</list>
 
</entry>
 
<entry>
 
<propertyBean>
 
<id>unique_identifier</id>
 
 
 
<fullId>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#unique_identifier
 
</fullId>
 
<label>unique_identifier</label>
 
<relations />
 
</propertyBean>
 
<list>
 
<string>MO_484</string>
 
</list>
 
</entry>
 
<entry>
 
<propertyBean>
 
<id>:DIRECTTYPE</id>
 
<fullId>:DIRECTTYPE</fullId>
 
<label>:DIRECTTYPE</label>
 
<relations />
 
</propertyBean>
 
<list>
 
<instanceBean>
 
<id>SubstrateType</id>
 
<fullId>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#SubstrateType
 
</fullId>
 
<label>SubstrateType</label>
 
<relations />
 
<instanceType>
 
<list>
 
<classBean>
 
<id>owl:Class</id>
 
<fullId>http://www.w3.org/2002/07/owl#Class
 
</fullId>
 
<label>owl:Class</label>
 
<type>Class</type>
 
<relations />
 
</classBean>
 
</list>
 
</instanceType>
 
</instanceBean>
 
</list>
 
</entry>
 
<entry>
 
<propertyBean>
 
<id>rdfs:comment</id>
 
<fullId>http://www.w3.org/2000/01/rdfschema#comment
 
</fullId>
 
<label>rdfs:comment</label>
 
<relations />
 
</propertyBean>
 
 
 
<list>
 
<string>SubstrateType of unknown type.</string>
 
</list>
 
</entry>
 
</relations>
 
<instanceType>
 
<list>
 
<classBean>
 
<id>SubstrateType</id>
 
<fullId>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#SubstrateType
 
</fullId>
 
<label>SubstrateType</label>
 
<type>Class</type>
 
<relations />
 
</classBean>
 
</list>
 
</instanceType>
 
</instanceBean>
 
</list>
 
</contents>
 
</page>
 
</data>
 
</success>
 
</pre>
 
 
 
== Get an instance and its property/value pairs ==
 
* '''Signature''': ./instance/{ontlogyVersionId}[?instanceid={instanceid}&apikey={YourAPIKey}]
 
 
 
* '''Example''': http://rest.bioontology.org/bioportal/instance/38801?instanceid=glass&apikey=YourAPIKey
 
* '''Description''': returns information about an instance and a list of property/value pairs.
 
* '''Sample Output:'''
 
<pre>
 
<?xml version="1.0" encoding="UTF8" ?>
 
<success>
 
<accessedResource>/bioportal/instance/38801
 
</accessedResource>
 
<accessDate>20100408 18:10:48.760 PDT</accessDate>
 
<data>
 
<instanceBean>
 
<id>glass</id>
 
<fullId>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#glass
 
</fullId>
 
<label>glass</label>
 
<relations>
 
<entry>
 
<propertyBean>
 
<id>:NAME</id>
 
<fullId>:NAME</fullId>
 
<label>:NAME</label>
 
<relations />
 
</propertyBean>
 
<list>
 
<string>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#glass
 
</string>
 
</list>
 
</entry>
 
<entry>
 
<propertyBean>
 
<id>unique_identifier</id>
 
<fullId>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#unique_identifier
 
</fullId>
 
<label>unique_identifier</label>
 
<relations />
 
</propertyBean>
 
<list>
 
<string>MO_742</string>
 
</list>
 
</entry>
 
<entry>
 
<propertyBean>
 
<id>rdfs:comment</id>
 
<fullId>http://www.w3.org/2000/01/rdfschema#comment
 
</fullId>
 
<label>rdfs:comment</label>
 
<relations />
 
</propertyBean>
 
<list>
 
<string>The array is made on a glass slide.</string>
 
</list>
 
</entry>
 
<entry>
 
<propertyBean>
 
<id>:DIRECTTYPE</id>
 
<fullId>:DIRECTTYPE</fullId>
 
<label>:DIRECTTYPE</label>
 
<relations />
 
</propertyBean>
 
<list>
 
<instanceBean>
 
<id>SubstrateType</id>
 
<fullId>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#SubstrateType
 
</fullId>
 
<label>SubstrateType</label>
 
<relations />
 
<instanceType>
 
<list>
 
<classBean>
 
<id>owl:Class</id>
 
<fullId>http://www.w3.org/2002/07/owl#Class
 
</fullId>
 
<label>owl:Class</label>
 
<type>Class</type>
 
<relations />
 
</classBean>
 
</list>
 
</instanceType>
 
</instanceBean>
 
</list>
 
</entry>
 
<entry>
 
<propertyBean>
 
<id>rdf:type</id>
 
<fullId>http://www.w3.org/1999/02/22rdfsyntaxns#type
 
</fullId>
 
<label>rdf:type</label>
 
<relations />
 
</propertyBean>
 
<list>
 
<instanceBean>
 
<id>SubstrateType</id>
 
<fullId>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#SubstrateType
 
</fullId>
 
<label>SubstrateType</label>
 
<relations />
 
<instanceType>
 
<list>
 
<classBean>
 
<id>owl:Class</id>
 
<fullId>http://www.w3.org/2002/07/owl#Class
 
</fullId>
 
<label>owl:Class</label>
 
<type>Class</type>
 
<relations />
 
</classBean>
 
</list>
 
</instanceType>
 
</instanceBean>
 
</list>
 
</entry>
 
</relations>
 
<instanceType>
 
<list>
 
<classBean>
 
<id>SubstrateType</id>
 
<fullId>
 
http://mged.sourceforge.net/ontologies/MGEDOntology.owl#SubstrateType
 
</fullId>
 
<label>SubstrateType</label>
 
<type>Class</type>
 
<relations />
 
</classBean>
 
</list>
 
</instanceType>
 
</instanceBean>
 
</data>
 
</success>
 
</pre>
 
 
 
=  Hierarchy Services =
 
 
 
The Hierarchy Services provide access to pre-computed term hierarchy information via a single web service call. The pre-computed hierarchy data is generated for only one version of an ontology and is periodically updated. Therefore, if using the Hierarchy Web services, it is best to use the form of the call with the virtual ontology id. To get hierarchy information for any version of an ontology, use the Term Web service to traverse the ontology structure. 
 
 
 
'''<font color='red'>NOTE: </font>To see which ontology versions have been processed for use with the Hierarchy Services, check http://rest.bioontology.org/obs/ontologies for ontologies with STATUS=28.'''
 
 
 
==  Get paths to root/leaves from a concept in the latest version of a given ontology  ==
 
* '''Signature''': ./virtual/[rootpath|leafpath]/{ontologyId}/{conceptId}[?apikey={YourAPIKey}&{optional args}]
 
* '''Example''': http://rest.bioontology.org/bioportal/virtual/rootpath/1032/Melanoma?apikey=YourAPIKey
 
* '''Example''': http://rest.bioontology.org/bioportal/virtual/leafpath/1032/Melanoma?apikey=YourAPIKey
 
* '''Optional arguments:'''
 
** offset=<integer> – results offset (used for pagination)
 
** limit=<integer> – limits the number of results
 
** delim=<string> – use a custom delimiter between returned terms. Default is a period (.).
 
* '''Description''': The same as the previous services, but takes an ontology id and returns parents from the latest version of that ontology.
 
 
 
==  Get siblings of a given concept in the latest version of a given ontology ==
 
* '''Signature''': ./virtual/siblings/{ontlogyId}/{conceptId}?level=<level>&apikey={YourAPIKey}&[&{optional args}]
 
* '''Example''': http://rest.bioontology.org/bioportal/virtual/siblings/1032/Melanoma?level=1&apikey=YourAPIKey
 
* '''Required arguments:'''
 
** level=<integer> - limits results to a given level in the hierarchy
 
* '''Optional arguments:'''
 
** offset=<integer> – results offset (used for pagination)
 
* '''Description''': The same as the previous service, but takes an ontology id and returns parents from the latest version of that ontology.
 
 
 
= Bio2RDF Dump Service =
 
 
 
This service allows you to output a given ontology from BioPortal in the form of a N3 RDF file conforming to the requirements for integrating into the [http://sourceforge.net/projects/bio2rdf/ Bio2RDF] collection.
 
 
 
* '''Signature''': ./ontology/dump_n3/{ontlogyVersionId}?apikey={YourAPIKey}
 
* '''Example''': http://rest.bioontology.org/bioportal/ontology/dump_n3/40865?apikey=YourAPIKey
 
 
 
= Annotator Service =
 
 
 
The NCBO Annotator is a Web service that can be used to annotate text metadata with biomedical ontology concepts. The concepts are from ontologies in BioPortal and includes the Unified Medical Language System (UMLS) Metathesaurus, OBO Foundry candidate ontologies and many others.
 
 
 
The Annotator can be tested via a Web interface available through [http://bioportal.bioontology.org/annotate BioPortal]. For more information on using the Annotator Web service, see: http://bioontology.org/wiki/index.php/Annotator_Web_service.
 
 
 
= Ontology Recommender =
 
The Ontology Recommender is a Web service that provides information on what ontology is best covered by your text metadata. An in-depth description and links to the Web service documentation and sample clients can be found at: http://www.bioontology.org/wiki/index.php/Ontology_Recommender_Web_service.
 
 
 
= Resource Index Service =
 
 
 
The Resource Index provides a mechanism to search for biomedical data based on ontology concepts. For more information on using the Resource Index service, see http://www.bioontology.org/wiki/index.php/Resource_Index.
 
 
 
 
 
 
 
= RDF Term Service =
 
 
* '''Signature''': ./bioportal/rdf/{ontology version id}/{concept id}?apikey=YourAPIKey
 
* '''Alt Signature''': ./bioportal/virtual/rdf/{ontology id}/{concept id}?apikey=YourAPIKey
 
* '''Alt Signature''': ./bioportal/virtual/rdf/{ontology id}/{concept id},{concept id},...,{concept id}?apikey=YourAPIKey
 
* '''Examples''':
 
** http://rest.bioontology.org/bioportal/virtual/rdf/1321/NEMO_0000024?apikey=YourAPIKey
 
** http://rest.bioontology.org/bioportal/rdf/42743/NEMO_0000023?apikey=YourAPIKey
 
* '''Required arguments:'''
 
** ontology version id
 
** concept id
 
* '''Description''': returns a BioPortal concept as RDF/XML ontology snippet. This is a prototype web service, for updates subscribe to [https://mailman.stanford.edu/mailman/listinfo/bioportal-announce bioportal-announce].
 
** The RDF dump will use URIs that are based on which format the ontology is in:
 
*** '''OWL/RDF(S)''': preserve original URIs
 
*** '''Protégé & RRF''': <nowiki>http://purl.bioontology.org/ontology/{ACRONYM}/{ID}</nowiki>
 
*** '''OBO''': <nowiki>http://purl.obolibrary.org/{IDSPACE}_{LOCALID}</nowiki>
 
* '''Sample Output:'''
 
<pre>
 
<?xml version="1.0"?>
 
<rdf:RDF xmlns="http://purl.bioontology.org/ontology/NEMO#"
 
    xml:base="http://purl.bioontology.org/ontology/NEMO"
 
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
 
    xmlns:BPMetadata="http://purl.bioontology.org/ontology/BPMetadata#"
 
    xmlns:owl="http://www.w3.org/2002/07/owl#"
 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
 
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 
    xmlns:NEMO="http://purl.bioontology.org/NEMO/ontology/NEMO.owl#"
 
    xmlns:ontology="http://omv.ontoware.org/2005/05/ontology/"
 
    xmlns:skos="http://www.w3.org/2004/02/skos/core#"
 
    xmlns:ontology2="http://purl.bioontology.org/NEMO/ontology#">
 
    <owl:Ontology rdf:about="http://purl.bioontology.org/ontology/NEMO">
 
        <ontology:name>Neural ElectroMagnetic Ontologies</ontology:name>
 
        <ontology:acronym>NEMO</ontology:acronym>
 
        <ontology:description>Neural ElectroMagnetic Ontologies (NEMO) describe classes of event-related brain potentials (ERP) and their properties, including spatial, temporal, functional (cognitive/behavioral) attributes, and data-level attributes (acquisition and analysis parameters).</ontology:description>
 
        <BPMetadata:id>45141</BPMetadata:id>
 
        <ontology:hasOntologyLanguage rdf:resource="http://omv.ontoware.org/2005/05/ontology#owl"/>
 
    </owl:Ontology>
 
   
 
 
 
 
 
    <!--
 
    ///////////////////////////////////////////////////////////////////////////////////////
 
    //
 
    // Annotation properties
 
    //
 
    ///////////////////////////////////////////////////////////////////////////////////////
 
    -->
 
 
 
    <owl:AnnotationProperty rdf:about="http://omv.ontoware.org/2005/05/ontology/name"/>
 
    <owl:AnnotationProperty rdf:about="http://purl.bioontology.org/NEMO/ontology#NEMO_synonym">
 
        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2004/02/skos/core#altLabel"/>
 
    </owl:AnnotationProperty>
 
    <owl:AnnotationProperty rdf:about="http://www.w3.org/2004/02/skos/core#prefLabel">
 
        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
 
    </owl:AnnotationProperty>
 
    <owl:AnnotationProperty rdf:about="http://purl.bioontology.org/NEMO/ontology#NEMO_definition">
 
        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2004/02/skos/core#definition"/>
 
    </owl:AnnotationProperty>
 
    <owl:AnnotationProperty rdf:about="http://www.w3.org/2000/01/rdf-schema#label"/>
 
    <owl:AnnotationProperty rdf:about="http://purl.bioontology.org/ontology/BPMetadata#id"/>
 
    <owl:AnnotationProperty rdf:about="http://www.w3.org/2004/02/skos/core#broader"/>
 
    <owl:AnnotationProperty rdf:about="http://www.w3.org/2000/01/rdf-schema#subClassOf"/>
 
    <owl:AnnotationProperty rdf:about="http://purl.bioontology.org/NEMO/ontology#NEMO_pref_label">
 
        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2004/02/skos/core#prefLabel"/>
 
    </owl:AnnotationProperty>
 
    <owl:AnnotationProperty rdf:about="http://omv.ontoware.org/2005/05/ontology/acronym"/>
 
    <owl:AnnotationProperty rdf:about="http://www.w3.org/2004/02/skos/core#notation"/>
 
    <owl:AnnotationProperty rdf:about="http://omv.ontoware.org/2005/05/ontology/description"/>
 
    <owl:AnnotationProperty rdf:about="http://www.w3.org/2004/02/skos/core#definition"/>
 
    <owl:AnnotationProperty rdf:about="http://omv.ontoware.org/2005/05/ontology/hasOntologyLanguage"/>
 
    <owl:AnnotationProperty rdf:about="http://www.w3.org/2000/01/rdf-schema#subPropertyOf"/>
 
    <owl:AnnotationProperty rdf:about="http://www.w3.org/2004/02/skos/core#altLabel"/>
 
   
 
 
 
 
 
    <!--
 
    ///////////////////////////////////////////////////////////////////////////////////////
 
    //
 
    // Classes
 
    //
 
    ///////////////////////////////////////////////////////////////////////////////////////
 
    -->
 
 
 
   
 
 
 
 
 
    <!-- http://purl.bioontology.org/NEMO/ontology/NEMO.owl#NEMO_0000010 -->
 
 
 
    <owl:Class rdf:about="http://purl.bioontology.org/NEMO/ontology/NEMO.owl#NEMO_0000010"/>
 
   
 
 
 
 
 
    <!-- http://purl.bioontology.org/NEMO/ontology/NEMO.owl#NEMO_0000024 -->
 
 
 
    <owl:Class rdf:about="http://purl.bioontology.org/NEMO/ontology/NEMO.owl#NEMO_0000024">
 
        <rdfs:label>left_posterotemporal_scalp_surface_region</rdfs:label>
 
        <rdfs:subClassOf rdf:resource="http://purl.bioontology.org/NEMO/ontology/NEMO.owl#NEMO_0000010"/>
 
        <skos:prefLabel>left_posterotemporal_scalp_surface_region</skos:prefLabel>
 
        <skos:notation>NEMO_0000024</skos:notation>
 
        <ontology2:NEMO_pref_label>left_posterotemporal_scalp_surface_region</ontology2:NEMO_pref_label>
 
        <skos:broader rdf:resource="http://purl.bioontology.org/NEMO/ontology/NEMO.owl#NEMO_0000010"/>
 
    </owl:Class>
 
</rdf:RDF>
 
 
 
 
 
 
 
<!-- Generated by the OWL API (version 3.0.0.1451) http://owlapi.sourceforge.net -->
 
 
 
 
 
</pre>
 
 
 
= RDF Download Service =
 
 
 
* '''Signature''': ./bioportal/ontologies/rdf/download/{ontology version id}?apikey=YourAPIKey
 
* '''Alt Signature''': ./bioportal/virtual/ontology/rdf/download/{ontology id}?apikey=YourAPIKey
 
* '''Examples''':
 
** http://rest.bioontology.org/bioportal/ontologies/rdf/download/44016?apikey=YourAPIKey
 
** http://rest.bioontology.org/bioportal/virtual/ontology/rdf/download/1054?apikey=YourAPIKey
 
''NOTE:'' If using the Web service calls from Firefox, disable the Tabulator Add-on in order to download the files.
 
* '''Required arguments:'''
 
** ontology version id
 
* '''Description''': returns a BioPortal ontology as RDF/XML. This is a prototype web service, for updates subscribe to [https://mailman.stanford.edu/mailman/listinfo/bioportal-announce bioportal-announce].
 
** The RDF dump will use URIs that are based on which format the ontology is in:
 
*** '''OWL/RDF(S)''': preserve original URIs
 
*** '''Protégé & RRF''': http://purl.bioontology.org/ontology/{abbreviation}/{concept_id}
 
*** '''OBO''': http://purl.obolibrary.org/{idspace}_{localid}
 
 
 
= Notes Service =
 
* The Notes Web service is described here: http://www.bioontology.org/wiki/index.php/Ontology_Notes.
 
 
 
= Mapping Service =
 
* The Mapping Web service is described here: http://www.bioontology.org/wiki/index.php/BioPortal_Mappings_Service. 
 
 
 
 
 
<!--
 
= Usage Logging =
 
* '''Signature''': ./usage?{args}
 
* '''Example''': http://rest.bioontology.org/bioportal/usage?requesturl=ontologies&resourceparameters=13578&email=example@example.org
 
* '''Required arguments:'''
 
** none specifically, but at least one optional argument is required
 
* '''Optional arguments:'''
 
** requesturl=<string contained in request url> – limit results to a given string contained in REST service request url. Unique values for the requesturl are:
 
<pre>
 
  /categories
 
  /concepts/{ontology version id}/{concept id}
 
  /concepts/{children or leafpath or parents or siblings}/{ontology version id}/{concept id}
 
  /diffs/{virtual id}
 
  /ontologies/{ontology version id}
 
  /ontologies/download/{ontology version id}
 
  /ontologies/versions/{ontology virtual id}
 
  /path/{ontology version id}/{concept id}
 
  /search/{search terms}
 
  /virtual/{virtual id}
 
  /virtual/ontology/{virtual id}/{concept id}
 
  /virtual/rootpath/{virtual id}/{concept id}
 
  /virtual/siblings/{virtual id}/{concept id}
 
</pre>
 
** resourceparameters=<string contained in resource parameters> – limit results to a given string contained in resource parameters. For example, in the URL http://rest.bioontology.org/bioportal/search/melanoma, the word "melanoma" is considered a "resource parameter".
 
** startdateaccessed=<date in format mm/dd/yyyy> – limit results to the given starting date (default: no starting date)
 
** startdateaccessed=<date in format mm/dd/yyyy> – limit results to the given ending date (default: today's date)
 
* '''Description''': returns BioPortal REST services usage data as XML.
 
* '''Sample Output:'''
 
<pre>
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<success>
 
<accessedResource>/bioportal/usage</accessedResource>
 
<accessDate>2009-07-27 14:21:19.728 PDT</accessDate>
 
<data>
 
<list>
 
<usageLoggingBean>
 
<requestUrl>
 
/search/Certain infectious and parasitic diseases/
 
</requestUrl>
 
<httpMethod>GET</httpMethod>
 
<resourceParameters>
 
query=Certain%20infectious%20and%20parasitic%20diseases
 
</resourceParameters>
 
<requestParameters>
 
pagenum=1&ontologyids=1265&pagesize=20
 
</requestParameters>
 
<hitCount>1</hitCount>
 
<dateAccessed class="sql-timestamp">
 
2009-07-27 00:00:00.0
 
</dateAccessed>
 
</usageLoggingBean>
 
<usageLoggingBean>
 
<requestUrl>/search/Hypertension/</requestUrl>
 
<httpMethod>GET</httpMethod>
 
<resourceParameters>
 
query=Hypertension
 
</resourceParameters>
 
<requestParameters>
 
pagenum=1&ontologyids=1265&pagesize=20
 
</requestParameters>
 
<hitCount>2</hitCount>
 
<dateAccessed class="sql-timestamp">
 
2009-07-27 00:00:00.0
 
</dateAccessed>
 
</usageLoggingBean>
 
<usageLoggingBean>
 
<requestUrl>/search/Melanoma/</requestUrl>
 
<httpMethod>GET</httpMethod>
 
<resourceParameters>query=Melanoma</resourceParameters>
 
<requestParameters>
 
pagenum=1&ontologyids=1265&pagesize=20
 
</requestParameters>
 
<hitCount>3</hitCount>
 
<dateAccessed class="sql-timestamp">
 
2009-07-27 00:00:00.0
 
</dateAccessed>
 
</usageLoggingBean>
 
</list>
 
</data>
 
</success>
 
</pre>
 
-->
 
 
 
= XML Schema Definitions for the REST services =
 
 
 
XML Schema for [[#Term_services|Term]] and [[#Hierarchy_Services|Hierarchy]] services have been provided courtesy Eamonn Maguire. An updated XML Schema document will be posted shortly.
 

Latest revision as of 22:00, 16 July 2016

NCBO BioPortal v4.0 REST services are documented at: http://data.bioontology.org/documentation