Difference between revisions of "OJ Break API Reference"

From xBio:D Wiki
Jump to navigation Jump to search
Line 12: Line 12:
  
  
== Reference ==
+
== Procedural Reference ==
=== Procedures ===
+
=== Taxon ===
==== Taxon ====
+
==== getTaxonStats ====
===== getTaxonStats =====
+
===== Description =====
====== Description ======
 
 
Get some basic taxonomic statistics for a taxon from a tnuid.
 
Get some basic taxonomic statistics for a taxon from a tnuid.
====== Parameters ======
+
===== Parameters =====
 
* ''tnuid'': number
 
* ''tnuid'': number
 
* ''callback'': string
 
* ''callback'': string
====== Return ======
+
===== Return =====
 
* ''taxon'': string
 
* ''taxon'': string
 
* ''author'': string
 
* ''author'': string
 
* ''stats'': taxon_stats
 
* ''stats'': taxon_stats
  
====== Example ======
+
===== Example =====
 
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonStats?tnuid=30148&callback=api
 
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonStats?tnuid=30148&callback=api
  
===== getTaxonInfo =====
+
==== getTaxonInfo ====
====== Description ======
+
===== Description =====
 
Get some basic taxonomic information for a taxon from a tnuid.
 
Get some basic taxonomic information for a taxon from a tnuid.
====== Parameters ======
+
===== Parameters =====
 
* ''tnuid'': number
 
* ''tnuid'': number
 
* ''inst_id'': number
 
* ''inst_id'': number
 
* ''callback'': string
 
* ''callback'': string
====== Return ======
+
===== Return =====
 
* ''taxon_extended'' class with below extensions
 
* ''taxon_extended'' class with below extensions
 
* ''rel_type'': string
 
* ''rel_type'': string
Line 47: Line 46:
 
* ''stats'': taxon_info_stats
 
* ''stats'': taxon_info_stats
 
* ''contribs'': array of contribution
 
* ''contribs'': array of contribution
====== Example ======
+
===== Example =====
 
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonInfo?tnuid=30148&inst_id=0&callback=api
 
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonInfo?tnuid=30148&inst_id=0&callback=api
  
===== getTaxonHierarchy =====
+
==== getTaxonHierarchy ====
====== Description ======
+
===== Description =====
 
Get the taxonomic hierarachy in which a taxon is at the terminal node from a tnuid.
 
Get the taxonomic hierarachy in which a taxon is at the terminal node from a tnuid.
====== Parameters ======
+
===== Parameters =====
 
* ''tnuid'': number
 
* ''tnuid'': number
 
* ''callback'': string
 
* ''callback'': string
====== Return ======
+
===== Return =====
 
* ''taxon'': string
 
* ''taxon'': string
 
* ''author'': string
 
* ''author'': string
 
* ''hier'': taxon_hierarchy
 
* ''hier'': taxon_hierarchy
====== Example ======
+
===== Example =====
 
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonHierarchy?tnuid=30148&callback=api
 
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonHierarchy?tnuid=30148&callback=api
  
===== getIncludedTaxa =====
+
==== getIncludedTaxa ====
====== Description ======
+
===== Description =====
 
Get the taxa that are directly included within this taxon but not synonymous with it.
 
Get the taxa that are directly included within this taxon but not synonymous with it.
====== Parameters ======
+
===== Parameters =====
 
* ''tnuid'': number
 
* ''tnuid'': number
 
* ''inst_id'': number
 
* ''inst_id'': number
Line 74: Line 73:
 
* ''show_num_spms'': boolean_flag
 
* ''show_num_spms'': boolean_flag
 
* ''callback'': string
 
* ''callback'': string
====== Return ======
+
===== Return =====
 
* ''tnuid'': number
 
* ''tnuid'': number
 
* ''parent_tnuid'': number
 
* ''parent_tnuid'': number
 
* ''includedTaxa'': array of taxon_extended
 
* ''includedTaxa'': array of taxon_extended
====== Example ======
+
===== Example =====
 
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getIncludedTaxa?tnuid=491&inst_id=0&showSyns=Y&showFossils=Y&types_only=N&show_num_spms=Y&callback=api
 
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getIncludedTaxa?tnuid=491&inst_id=0&showSyns=Y&showFossils=Y&types_only=N&show_num_spms=Y&callback=api
  
Line 154: Line 153:
  
  
==== Occurrence / Specimen ====
+
=== Occurrence / Specimen ===
 
{|
 
{|
 
! align="left"| Method
 
! align="left"| Method
Line 170: Line 169:
  
  
==== Locality ====
+
=== Locality ===
 
{|
 
{|
 
! align="left"| Method
 
! align="left"| Method
Line 182: Line 181:
  
  
==== Place / Geopolitical Entity ====
+
=== Place / Geopolitical Entity ===
 
{|
 
{|
 
! align="left"| Method
 
! align="left"| Method
Line 214: Line 213:
  
  
==== Literature ====
+
=== Literature ===
 
{|
 
{|
 
! align="left"| Method
 
! align="left"| Method
Line 238: Line 237:
  
  
==== Journal ====
+
=== Journal ===
 
{|
 
{|
 
! align="left"| Method
 
! align="left"| Method
Line 258: Line 257:
  
  
==== Institution ====
+
=== Institution ===
 
{|
 
{|
 
! align="left"| Method
 
! align="left"| Method
Line 290: Line 289:
  
  
==== Unvouchered Record ====
+
=== Unvouchered Record ===
 
{|
 
{|
 
! align="left"| Method
 
! align="left"| Method
Line 314: Line 313:
  
  
==== Text Search ====
+
=== Text Search ===
 
{|
 
{|
 
! align="left"| Method
 
! align="left"| Method
Line 361: Line 360:
 
|}
 
|}
  
=== Data Type Glossary ===
+
== Data Type Glossary ==
 
[[OJ_Break API Data Type Glossary]]
 
[[OJ_Break API Data Type Glossary]]
  
  
 
[[Category:OJ_Break API]]
 
[[Category:OJ_Break API]]

Revision as of 21:36, 30 October 2013

Introduction

OJ_Break is the name of the xBio:D RESTful(-like) API service to facilitate discovery of data within the xBio:D database. The API responds exclusively in JavaScript Object Notation (JSON) and accepts only HTTP GET and POST requests indiscriminately unlike a true REST API. Built using Oracle's PL/SQL database language, the API is fast but often inflexible and inconsistent, so take note of all of the comments below.


Overview

All API requests must be formatted by first selecting the OJ_Break library then specifying the API method. Also, each method must include a callback argument even if a callback function is unnecessary (e.g. jQuery AJAX requests).

The format for API calls is: http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.[method]?[argument1]=[value1]&...

  • Example: http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonInfo?tnuid=5012&callback=test
  • Response: test({"taxon":"Oxyscelio consobrinus","author":"(Kieffer)","status":"Subsequent name/combination","rank":"Species","valid":"Valid","fossil":"N","rel_type":"Member",...


Procedural Reference

Taxon

getTaxonStats

Description

Get some basic taxonomic statistics for a taxon from a tnuid.

Parameters
  • tnuid: number
  • callback: string
Return
  • taxon: string
  • author: string
  • stats: taxon_stats
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonStats?tnuid=30148&callback=api

getTaxonInfo

Description

Get some basic taxonomic information for a taxon from a tnuid.

Parameters
  • tnuid: number
  • inst_id: number
  • callback: string
Return
  • taxon_extended class with below extensions
  • rel_type: string
  • valid_taxon: taxon_basic (only present when defined)
  • parent_taxon: taxon_basic
  • hier: taxon_hierarchy
  • source: taxon_source
  • common_names: array of common_name
  • orig_desc: contrib_literature_basic (only present when defined)
  • stats: taxon_info_stats
  • contribs: array of contribution
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonInfo?tnuid=30148&inst_id=0&callback=api

getTaxonHierarchy

Description

Get the taxonomic hierarachy in which a taxon is at the terminal node from a tnuid.

Parameters
  • tnuid: number
  • callback: string
Return
  • taxon: string
  • author: string
  • hier: taxon_hierarchy
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonHierarchy?tnuid=30148&callback=api

getIncludedTaxa

Description

Get the taxa that are directly included within this taxon but not synonymous with it.

Parameters
  • tnuid: number
  • inst_id: number
  • showSyns: string
  • showFossils: string
  • types_only: string
  • show_num_spms: boolean_flag
  • callback: string
Return
  • tnuid: number
  • parent_tnuid: number
  • includedTaxa: array of taxon_extended
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getIncludedTaxa?tnuid=491&inst_id=0&showSyns=Y&showFossils=Y&types_only=N&show_num_spms=Y&callback=api


Method Return Description
getTaxonSynonyms(tnuid:number, showFossils:Y|N, callback:string)
getLocalities(tnuid:number, inst_id:number, precDecimals:number, showChildren:Y|N, callback:string)
getLocalities(tnuid:number, inst_id:number, pnids:array of number, precDecimals:number, showChildren:Y|N, callback:string)
getCuids(tnuids:array of number, pnids:array of number, callback:string)
getCuids(tnuid:number, showChildren:Y|N, inst_id:number, pnids:array of number, callback:string)
getTypes(tnuid:number, showSyns:Y|N, inst_id:number, primary_only:Y|N, taxon_author_search:string, offset:number, limit:number, callback:string)
getInsts(tnuid:number, callback:string)
getTaxonLiterature(tnuid:number, showSyns:Y|N, callback:string)
getAssociations(tnuid:number, rank_grouping:string, callback:string)
getHabitats(tnuid:number, callback:string)
getTaxonImages(tnuid:number, callback:string)
getTaxonBreakdown(tnuid:number, callback:string)
getTaxonPhenology(tnuid:number, callback:string)
getTaxonNewTaxaByPub(tnuid:number, validOnly:Y|N, callback:string)
getTaxonNewTaxaByYear(tnuid:number, validOnly:Y|N, callback:string)
getTaxonStatsForYear(tnuid:number, stats_year:number, callback:string)


Occurrence / Specimen

Method Return Description
getSpmInfo(cuid:string, callback:string)
getSpmsInfo(cuids:array of string, callback:string)


Locality

Method Return Description
getLocalityInfo(locID:number, tnuid:number, inst_id:number, per_id:number, pnid:number, showChildren:Y|N, completeSpmInfo:Y|N, callback:string)


Place / Geopolitical Entity

Method Return Description
getPlaceInfo(place_id:number, callback:string)
getSubdivisions(place_id:number, callback:string)
getGeoTaxa(place_id:number, callback:string)
getGeoCollTrips(place_id:number, callback:string)
getGeoCollTrips2(place_id:number, callback:string)
getGeoInsts(place_id:number, callback:string)


Literature

Method Return Description
getLitReference(pub_id:number, callback:string)
getLitParts(pub_id:number, callback:string)
getPubTaxonCitation(pub_id:number, callback:string)
getPubAssocCitation(pub_id:number, callback:string)


Journal

Method Return Description
getJournalInfo(jrnl_id:number, callback:string)
getJournalPubs(jrnl_id:number, callback:string)
getJournalTaxa(jrnl_id:number, callback:string)


Institution

Method Return Description
getCollectionInfo(inst_id:number, callback:string)
getPrimaryTypes(inst_id:number, callback:string)
getSecondaryTypes(inst_id:number, callback:string)
getInstTaxa(inst_id:number, callback:string)
getInstCollTrips2(inst_id:number, callback:string)
getInstPubs(inst_id:number, callback:string)


Unvouchered Record

Method Return Description
getUnvoucheredRecord(unv_id:number, callback:string)
getUnvoucheredRecords(tnuid:number, showChildren:Y|N, pnids:array of number, callback:string)
getUnvoucheredRecords(tnuids:array of number, pnids:array of number, callback:string)
getUnvLocalityInfo(locID:number, tnuid:number, per_id:number, pnid:number, showChildren:Y|N, callback:string)


Text Search

Method Return Description
getSearchResults(name:string, limit:number, categoryLimit:string, callback:string)
getTaxaFromText(name:string, limit:number, nameOnly:Y|N, callback:string)
getCuidsFromText(name:string, limit:number, callback:string)
getAgentsFromText(name:string, limit:number, includeParty:Y|N, callback:string)
getInstFromText(name:string, limit:number, callback:string)
getJournalsFromText(name:string, limit:number, callback:string)
getOrgsFromText(name:string, limit:number, callback:string)
getPlacesFromText(name:string, limit:number, callback:string)
getLocalitiesFromText(name:string, limit:number, callback:string)
getCollMethodsFromText(name:string, limit:number, callback:string)

Data Type Glossary

OJ_Break API Data Type Glossary