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.

JSON DUMP

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 a specific Ontology

  • URL: http://www.cropontology.org/get-ontology/{ontologyId}
  • Method: GET
  • Returns: JSON representation of the ontology
  • 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 /ontologies API 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 user cookie in the header that contains a token. 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. Pass user cookie in request
  • Returns: Object of the currently logged in user

Create Ontology

  • URL: http://www.cropontology.org/add-ontology
  • Method: POST. Pass user cookie 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/default-list/?ontologyId={ontologyId}
  • Method: GET
  • Returns: JSON of the default list of traits, methods and scales of an ontology ID
  • Example:

Retrieve Term Information

  • URL: http://www.cropontology.org/get-term/?id={termId}
  • Method: GET
  • Returns: Object representing a term information. Can be used to update the information of a given term when it is updated
  • Example: