Resource Index REST Web Service User Guide
Introduction
The Resource Index API is available through a REST web services interface.
This documentation describes the current version of the API. Some changes may append in the future.
The Resource index API is based on the web service that returns annotations from the Resource Index (called via a REST post). Additionally some simplified REST get services returned simplified results.
Sample HTTP Client for the Resource Index REST Web Service
Test HTML Page : http://rest.bioontology.org/resource_index/test
Resources Service Page : http://rest.bioontology.org/resource_index/resources/list/
Service endpoint
http://rest.bioontology.org/resource_index/
POST calls
POST your requests at the service endpoint.
Parameters
The Resource Index web service offers a set of parameters that allows a user to customize the annotations returned according to his specific requirements. For example, the annotations returned can be limited to a specific set of ontology and a specific set of semantic types. Plus, the expanded annotations can be filtered.
Please see below for the list of parameters and the possible values.
localOntologyIDs | {localOntology1,...,localOntologyN} | default: empty (i.e. all ontologies) | Specifies the list of ontologies you want to filter in the result from the annotation process. The list of ontologies that can be used is available in the sample HTML page. The values are separated with comma (without spaces)
|
semanticTypes | {semanticType1,...,semanticTypeN} | default: empty (i.e. all semanticTypes) | Specifies the list of semantic types to use in the annotation process. The list of semantic types that can be used is available at the /obs/semanticTypes URL. Note that the restriction to semantic types is also applied during the semantic expansion steps.
|
levelMin and levelMax | {integer} | default: 0 | Specifies the minimum (resp. maximum) level a parent concept must have to be considered for the is_a semantic closure expansion step.
|
mappingTypes | {null,mappingType1,...,mappingTypeN} | default: empty (i.e. all mappingTypes) | Specifies the list of mapping type to use during the mapping expansion step. The list of rmapping types that can be used is available at the /obs/mappingTypes URL. The current list is described in section Mapping types.
|
localConceptIDs | {localConceptID1,...,localConceptIDN} | default: empty (i.e. all concepts) | Specifies the list of concept to use to query the Resource index (i.e., get the annotations done with this list). This parameter must be jointly specified with the mode parameter. If localConceptIDs contains only one element then the mode parameter can be ignored.The values are separated with comma (without spaces).
|
virtual | {true, false} | default: false | Specifies the if the list of ontologies are all BioPortal virtual ontology IDs or UMLS ontologies. |
mode | {union, intersection} | default: union | Specifies the mode to use when querying the resource index with several concept (parameter localConceptIDs). The union mode returns the union of all the annotations (filtered eventually with other parameters) done with each specified localConceptID. The intersection mode returns the intersection. |
localElementID | default: all | Specifies the identifier of the resource element for which annotations are requested. The localElementID is defined by the original resource e.g., PMID for PubMed, NCT for ClinicalTrials. The full list of the localElementID type is defined in Section Local element ID used.
| |
resourceID | default: all | Specifies the resource to filter the annotations with. The resource_identifier used for this parameter identify a resource in the OBR index. They are defined in section Resource identifiers.The list of resourceID can be used is available at the /obs/resources URL.
| |
elementDetails | {true, false} | default: false | Specifies the if the returned resource elements to be detailed or not. |
withContext | {true, false} | default: true | Specifies whether the annotations context information to be available or not.If turn to false, the set of annotations returned will be simplified and will not detail the context information for an annotation. Only the score will be returned (which implies score=true) |
from and number | {real_number} | default: 1/10 respectively | Specifies an offset of annotations defined by from and number. |
format | {asText ,asTabDelimited, asXML ,asOWL} | default: asXML | Specifies the desired format of the response. |
Web Service Response
Response Format
xml | returns XML representation of the ObrResultBeanDetailled. |
text | returns plain text representation of the ObrResultBeanDetailled. |
tabDelimited | shorter version of "Text" format. returns not the full result content but the annotations only (no statistics, etc.). The format of the tab delimited file is: score \t conceptId \t preferredName \t synonyms (separated by ' /// ') \t semanticType (separated by ' /// ') \t contextName \t isDirect \t other context information (e.g., childConceptId, mappedConceptId, level, mappingType) (separated by ' /// '). |
OWL | returns OWL representation of the ObrResultBeanDetailled. |
Note : if request parameter withContext is true, then returns representation of the ObrResultBeanDetailled and if request parameter withContext is false, then returns representation of the ObrResultBean.
Response Content: ObrResultBeanDetailled
Response ObrResultBeanDetailled contains all the contents of ObrResultBean. Those contents are described in section Response Content: ObrResultBean.
Following are remaining contents for ObrResultBeanDetailled :
directAnnotations | ObrAnnotationBean is a representation of one annotation. |
isaAnnotations | ObrAnnotationBean is a representation of one annotation. |
mappingAnnotations | ObrAnnotationBean is a representation of one annotation. |
Note : Response contents of the ObrAnnotationBean are described in section ObrResultBean annotations
Response Content: ObrResultBean
resultID | |||||||||||||||||||||||||||
dictionary | Dictionary contains the metadata (not the content) of the dictionary used for a result. dictionaryId, dictionaryName, and dictionaryDate identify the dictionary on the server side and give information about its content. Dictionary versioning is strongly linked to the evolution of the ontologies used. Each time ontologies change, the dictionary is updated. All the dictionary information may be useful for comparing results of the Annotator Restlet service on time. | ||||||||||||||||||||||||||
statistics | Statistics contains information on the number of annotations done for a given context. The contextName keyword identifies the type of context and nbAnnotation is the number of annotations of this type. | ||||||||||||||||||||||||||
parameters | Parameters summarizes all the parameters specified by the user when requesting the Annotator Restlet service. Those parameters are described in section Service parameters | ||||||||||||||||||||||||||
ontologies | To keep the model simple, we provide only the global ontology identifier, localOntologyId the name (ontologyName) and version (ontologyVersion). This information come from the original repositories (UMLS/BioPortal) and might help the user to select the right ontology to use. When an ontology is used in the annotation, a result has a set of OntologyUsed which specify 2 other properties: nbAnnotation, the number of annotation that have been made with concepts from this ontology. score, the sum of all the scores of the annotations done with concepts from this ontology (if parameter scored=true). Therefore, score represents the most accurate ontology to annotate the given text. | ||||||||||||||||||||||||||
annotations | ObrAnnotationBean/ObrAnnotationBeanDetailled is a representation of one annotation. If elementDetails parameter is true the service return response of type ObrAnnotationBean ,otherwise ObrAnnotationBeanDetailled. An annotation has a score which represents the accuracy of the annotation computed by the scoring algorithm (if the scored=true parameter was chosen, otherwise score=-1). An annotation is done with a concept in a context.
Response Content: ObrAnnotationBeanDetailled Response ObrAnnotationBeanDetailled contains all the contents of ObrAnnotationBean. Those contents are described in section Response Content: ObrAnnotationBean. Following are remaining contents for ObrAnnotationBeanDetailled :
Response Content: ObrAnnotationBean
| ||||||||||||||||||||||||||
localElementID localConceptIDs mode withContext elementDetails counts offsetStart offsetMax | Parameters summarizes all the parameters specified by the user when requesting the Resource Index Restlet service. Those parameters are described in section Service parameters |
GET calls
Following section describes all other simplified GET services available in Resource_Index_API.
Annotation by Concept Service
Returns the set of annotations done with a given localConceptID.
- GET Request Format : /byconcept/{ontologyID}/{withContext}/{counts}/{from}/{number}?conceptID={conceptID}
- Example : http://rest.bioontology.org/resource_index/byconcept/40477/false/true/0/10?conceptID=npo%3ANanoparticle
- Old Request Format* : /byconcept/{ontologyID}/{conceptID}/{withContext}/{counts}/{from}/{number}
- Response Content : ObrResultBean/ObrResultBeanDetailled. If request parameter withContext is true, then returns representation of the ObrResultBeanDetailled and if request parameter withContext is false, then returns representation of the ObrResultBean.
Annotation for BioPortal virtual ontology Concept Service
Returns the set of all annotations done with a given localConceptID using BioPortal virtual ontology ID.
- GET Request Format : /byconcept/virtual/{virtualOntologyID}/{withContext}/{counts}/{from}/{number}?conceptID={conceptID}
- Example : http://rest.bioontology.org/resource_index/byconcept/virtual/1083/false/true/0/10?conceptID=npo%3ANanoparticle
- Old Request Format* : /byconcept/virtual/{virtualOntologyID}/{conceptID}/{withContext}/{counts}/{from}/{number}
- Response Content : ObrResultBean/ObrResultBeanDetailled.
Annotation By Concept And Resource Service
Returns the set of all annotations done with a given localConceptID for given resourceID.
- GET Request Format : /byconcept/{ontologyID}/{resourceID}/{withContext}/{counts}/{from}/{number}?conceptID={conceptID}
- Example : http://rest.bioontology.org/resource_index/byconcept/40477/CANANO/false/true/0/10?conceptID=npo%3ANanoparticle
- Old Request Format* : /byconcept/{ontologyID}/{conceptID}/{resourceID}/{withContext}/{counts}/{from}/{number}/{from}/{number}
- Response Content : ObrResultBean/ObrResultBeanDetailled.
Annotation for BioPortal virtual ontology Concept And Resource Service
Returns the set of all annotations done with a given localConceptID using BioPortal virtual ontology ID and using particular resourceID.
- GET Request Format : /byconcept/virtual/{virtualOntologyID}/{resourceID}/{withContext}/{counts}/{from}/{number}?conceptID={conceptID}
- Example : http://rest.bioontology.org/resource_index/byconcept/virtual/1083/CANANO/false/true/0/10?conceptID=npo%3ANanoparticle
- Old Request Format* : byconcept/virtual/{virtualOntologyID}/{conceptID}/{resourceID}/{withContext}/{counts}/{from}/{number}
- Response Content : ObrResultBean/ObrResultBeanDetailled.
Annotation By Resource Element Service
Returns the set of all annotations done with a given resource element localElementID for all the concepts.
- GET Request Format : /byelement/{resourceID}/{withContext}/{counts}/{from}/{number}?elementID={localElementID}
- Example : http://rest.bioontology.org/resource_index/byelement/CANANO/true/false/0/10?elementID=6979603
- OldRequest Format* : /byelement/{resourceID}/{localElementID}/{withContext}/{counts}/{from}/{number}
- Response Content : ObrResultBean/ObrResultBeanDetailled.
Annotation Details By Resource Element Service
Returns the set of all annotations details with a given resource element localElementID for given conceptID
- GET Request Format : /details/{elementDetails}/concept/{ontologyID}/{conceptID}/resource/{resourceID}?conceptID={conceptID}&elementID={localElementID}
- Example1 : http://rest.bioontology.org/resource_index/details/true/concept/40477/resource/CANANO?conceptID=npo%3ANanoparticle&elementID=6979603
- Example1 : http://rest.bioontology.org/resource_index/details/false/concept/40477/resource/CANANO?conceptID=npo%3ANanoparticle&elementID=6979603
- Old Request Format* : /details/{elementDetails}/concept/{ontologyID}/{conceptID}/resource/{resourceID}/element/{localElementID}
- Response Content : ObrAnnotationBeanDetailled if elementDetails is true otherwise ObrAnnotationBean
Annotation Details By Resource Element Service for BioPortal Virtual OntologyID
Returns the set of all annotations details with a given resource element localElementID for given conceptID of BioPortal virtual ontologyID
- GET Request Format : /details/{elementDetails}/virtual/concept/{virtualOntologyID}/resource/{resourceID}?conceptID={conceptID}&elementID={localElementID}
- Example1 : http://rest.bioontology.org/resource_index/details/true/virtual/concept/1083/npo:Nanoparticle/resource/CANANO?conceptID=npo%3ANanoparticle&elementID=6979603
- Example2 : http://rest.bioontology.org/resource_index/details/false/virtual/concept/1083/npo:Nanoparticle/resource/CANANO?conceptID=npo%3ANanoparticle&elementID=6979603
- Old Request Format* : /details/{elementDetails}/virtual/concept/{virtualOntologyID}/{conceptID}/resource/{resourceID}/element/{localElementID}
- Response Content : ObrAnnotationBeanDetailled if elementDetails is true otherwise ObrAnnotationBean.
Resources Service
Returns the set of all resources available in resource index and information related to it.
- GET Request Format : /resources
- Example: http://rest.bioontology.org/resource_index/resources
- Response Content : Resource is a representation of one resource
Response Content: Resource
resourceName | Name of the particular resource. | ||||||||||
resourceID | Identifier of the resource. | ||||||||||
mainContext | Main context string for the resource. | ||||||||||
resourceURL | Website URL for the resource | ||||||||||
resourceElementURL | Base URL for getting elements for resource. | ||||||||||
resourceDescription | Description of the resource. | ||||||||||
resourceLogo | URL of logo image for the resource. | ||||||||||
resourceStructure | Represents Structure of an element for the resource.
Response Content: Structure
|
Resource Service
Returns the resource in resource index for given resourceID and information related to it.
- GET Request Format : /resources/{resourceID}
- Example: http://rest.bioontology.org/resource_index/resources/CANANO
- Response Content : Resource.
Resource Element Service
Service returns elementURL for given localElementID and redirect it to get resource element on the web.
- GET Request Format : /element/{resourceID}?element={localElementID}
- Example: http://rest.bioontology.org/resource_index/element/AE?element=E-GEOD-9118
- Response Content : Web page containing details of the element.
Resources Service with ontologies used for indexing
Returns the set of all resources available in resource index and list of onotolgies used for indexing them.
- GET Request Format : /resources?withOntologies=true
- Example: http://rest.bioontology.org/resource_index/resources?withOntologies=true
- Response Content : ObrResourceBean is a representation of one resource with ontologies
Response Content: ObrResourceBean
Response ObrResourceBean contains all the contents of Resource. Those contents are described in section Response Content: Resource.
Following are remaining contents for ObrResourceBean :
ontologiesUsed | Presents list of ontologies used for indexing. Each ontology of type OntologyBean.
Response Content: OntologyBean
|
Resource Service with ontologies used for indexing
Returns the information about resources and list of onotolgies used for indexing it.
- GET Request Format : /resources/{resourceID}?withOntologies=true
- Example: http://rest.bioontology.org/resource_index/resources/GEO?withOntologies=true
- Response Content : Resource is represented by ObrResourceBean.
Ontologies Service with resources indexed
Returns the set of all ontologies used in resource index with list of resources.
- GET Request Format : /ontologies
- Example: http://rest.bioontology.org/resource_index/ontologies
- Response Content : Each Ontology is represented by ObrOntologyBean.
Response ObrOntologyBean contains all the contents of OntologyBean.Those contents are described in section Response Content: OntologyBean.
Following are remaining contents for ObrResourceBean :
resources | Represents list of resources. Response content for each resource is of type Resource. |
Ontology Service with resources indexed
Returns the information about given ontologies used in resource index with list of resources.
- GET Request Format : /ontologies?ontologyID={localOntologyID}
- Example: http://rest.bioontology.org/resource_index/ontologies?ontologyID=1083
- Response Content : Ontology is represented by ObrOntologyBean.
All Statistics Service
Returns the information about number of all the annotations done in resource index.
- GET Request Format : /statistics/all
- Example: http://rest.bioontology.org/resource_index/statistics/all
- Response Content : All annotations represented by ObrStatisticsBean.
Response Content: ObrStatisticsBean Following are remaining contents for ObrStatisticsBean:
indexedAnnotations | Sum of the number of rows in all the indexing tables |
mgrepAnnotations | Number of mgrep annotations entries in direct annotation table. |
reportedAnnotations | Number of reported annotations entries in direct annotation table. |
isaAnnotations | Number of is-a annotations entries in extended annotation table. |
mappingAnnotations | Number of mapping annotations entries in extended annotation table. |
Ontology Statistics Service
Returns the total statistics for given ontology for All resources.
- GET Request Format : /statistics/ontology/{localOnotlogyID}
- Example: http://rest.bioontology.org/resource_index/statistics/ontology/1083
- Response Content : Ontology statistics with format ObrOntologyStatisticsBean.
Response Content: ObrOntologyStatisticsBean Following are contents for ObrOntologyStatisticsBean:
resourceID | Resource Id for resource. |
statistics | ObrStatisticsBean is a representation of statistics |
Ontology Statistics Service by resources
Returns the statistics for given ontology for each resource separately.
- GET Request Format : /statistics/ontology/{localOnotlogyID}?byresource=true
- Example: http://rest.bioontology.org/resource_index/statistics/ontology/1083?byresource=true
- Response Content : ObrOntologyStatisticsBean
Resource Statistics Service
Returns the total statistics for given resource for All ontology.
- GET Request Format : /statistics/resource/{resourceID}
- Example: http://rest.bioontology.org/resource_index/statistics/resource/CANANO
- Response Content : Resource statistics with format ObrResourceStatisticsBean.
Response Content: ObrResourceStatisticsBean Following are contents for ObrResourceStatisticsBean:
localOntologyID | local ontology id for given ontology. |
statistics | ObrStatisticsBean is a representation of statistics |
Resource Statistics Service by ontologies
Returns the statistics for given resource for each ontology separately.
- GET Request Format : /statistics/resource/{resourceID}?byontology=true
- Example: http://rest.bioontology.org/resource_index/statistics/resource/CANANO?byontology=true
- Response Content : Resource statistics with format ObrResourceStatisticsBean.