Loading...
API
This is the official API for the Ontology Curation Tool. It allows you to programmatically retrieve and interact with Ontology data.
To let us gather feedback you can leave a comment using the form on the right.
API Data Types
Data can be requested in JSON.
API calls follow the CRUD semantics: create, retrieve, update and delete.
Search Terms
- URL:
http://www.cropontology.org/search?q={query} - Method:
GET - Returns: Array of objects matching the search query - each object being a term
- Example:
Retrieve all Ontologies
- URL:
http://www.cropontology.org/get-ontologies - Method:
GET - Returns: JSON Hierarchy of the Ontologies under each category
- Example:
Retrieve Ontology ID by its Name
- URL:
http://www.cropontology.org/get-ontology-id?ontology_name={ontology_name} - Method:
GET - Returns: ID of the ontology, to be used with
/get-ontology-roots/{id} - Example:
Retrieve Categories
- URL:
http://www.cropontology.org/get-categories - Method:
GET - Returns: Array of strings - string being the name of the category that you pass to the
/ontologiesAPI call - Example:
Retrieve Ontologies By Category
- URL:
http://www.cropontology.org/ontologies?category={category} - Method:
GET - Returns: Array of objects; each one representing an ontology
- Example:
Retrieve Terms in RDF
- URL:
http://www.cropontology.org/rdf/{termId} - Method:
GET - Returns: XML related RDF
- Example:
Retrieve Root Terms of an Ontology
- URL:
http://www.cropontology.org/get-ontology-roots/{ontologyId} - Method:
GET - Returns: Array of objects; each one representing a term
- Example:
Retrieve Child Terms of parent Term
- URL:
http://www.cropontology.org/get-children/{parentId} - Method:
GET - Returns: Array of terms
- Example:
Retrieve Parents of Term
- URL:
http://www.cropontology.org/get-term-parents/{termId} - Method:
GET - Returns: Array of the paths from the parent to child
- Example:
Retrieve Properties/Attributes of a Term
- URL:
http://www.cropontology.org/get-attributes/{termId} - Method:
GET - Returns: Array of objects representing the terms property
- Example:
Retrieve Comments of a Term
- URL:
http://www.cropontology.org/get-comments?termId={termId} - Method:
GET - Returns: Array of objects representing a comment
- Example:
Login - Retrieve a user's auth token (used for adding and editing ontologies)
- URL:
http://www.cropontology.org/login - Method:
POST. {username}, {password} - Returns: HTTP response with a
usercookie in the header that contains atoken. You'll need to pass this cookie to subsequent requests that require authentication
Retrieve Logged-in User information
- URL:
http://www.cropontology.org/login - Method:
GET. Passusercookie in request - Returns: Object of the currently logged in user
Create Ontology
- URL:
http://www.cropontology.org/add-ontology - Method:
POST. Passusercookie in request. {json} a JSON string representing a list of objects; each object being a term. {ontology_name}, {ontology_id}, {ontology_summary} - Returns: HTTP error if something went wrong
Delete Ontology
- URL:
http://www.cropontology.org/delete-ontology - Method:
POST. {ontologyID} - Returns: HTTP error if something went wrong
Retrieve IB Fieldbook Default List
- URL:
http://www.cropontology.org/ibfieldbook - Method:
GET - Returns: An object - each key being the ontology name and the value being the array of ids
