Difference between revisions of "OJ Break API Reference"

From xBio:D Wiki
Jump to navigation Jump to search
Line 343: Line 343:
 
*  
 
*  
 
===== Example =====
 
===== Example =====
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getPlaceInfo?place_id=&callback=api
+
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getPlaceInfo?place_id=1&callback=api
  
 
==== getSubdivisions ====
 
==== getSubdivisions ====
Line 354: Line 354:
 
*  
 
*  
 
===== Example =====
 
===== Example =====
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getSubdivisions?place_id=&callback=api
+
http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getSubdivisions?place_id=1&callback=api
  
 
==== getGeoTaxa ====
 
==== getGeoTaxa ====

Revision as of 15:08, 29 May 2014

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.


Contents

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_rel_extended class with below extensions
  • 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 a 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

getTaxonSynonyms

Description

Get the taxa that are objective or subjectively synonymous with a taxon.

Parameters
  • tnuid: number
  • showFossils: string
  • callback: string
Return
  • synonyms: array of taxon_rel_extended
Example

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

getLocalities

Description

Get the localities from vouchered and unvouchered records for a taxon.

Parameters
  • tnuid: number
  • inst_id: number
  • precDecimals: number
  • showChildren: string
  • callback: string
Return
  • localities: array of loc_coords
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getLocalities?tnuid=30148&inst_id=0&precDecimals=4&showChildren=Y&callback=api

getLocalities

Description

Get the localities within geopolitical divisions from vouchered and unvouchered records for a taxon.

Parameters
  • tnuid: number
  • pnids: array of pnid
  • inst_id: number
  • precDecimals: number
  • showChildren: string
  • callback: string
Return
  • localities: array of loc_coords
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getLocalities?tnuid=30148&pnids=5816,5735&inst_id=0&precDecimals=4&showChildren=Y&callback=api

getCuids

Description

Get the occurrence identifiers (collecting unit IDs) for a taxon.

Parameters
  • tnuid: number
  • showChildren: string
  • inst_id: number
  • pnids: array of pnid
  • callback: string
Return
  • cuids: array of cuid
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getCuids?tnuid=30148&showChildren=Y&inst_id=1&pnids=&callback=api

getCuids

Description

Get the occurrence identifiers (collecting unit IDs) for selected taxa.

Parameters
  • tnuids: array of tnuid
  • pnids: array of pnid
  • callback: string
Return
  • cuids: array of cuid
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getCuids?tnuids=30148,491&pnids=5816,5735&callback=api

getTypes

Description
Parameters
  • tnuid: number
  • showSyns: string
  • inst_id: number
  • primary_only: string
  • taxon_author_search: string
  • offset: number
  • limit: number
  • callback: string
Return
  • Types: array of ..
  • num_records: number
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTypes?tnuid=52&showSyns=F&inst_id=1&primary_only=Y&taxon_author_search=&offset=1&limit=10&callback=api

getInsts

Description
Parameters
  • tnuid: number
  • callback: string
Return
  • collections: array of .. (inst_id, inst_name, inst_code, spm_count)
Example

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

getTaxonLiterature

Description

Deprecated

Parameters
  • tnuid: number
  • showSyns: string
  • callback: string
Return
  • lit: pubs
Example

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

getTaxonLit

Description

Preferred

Parameters
  • tnuid: number
  • showSyns: string
  • callback: string
Return
  • pubs: array of pubs
Example

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

getAssociations

Description
Parameters
  • tnuid: number
  • rank_grouping: string
  • callback: string
Return
  • associations: array of .. (taxon_basic class, type, relationship, hier, cuids)
Example

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

getHabitats

Description
Parameters
  • tnuid: number
  • callback: string
Return
  • habitats: array of .. (habitat, images)
Example

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

getTaxonImages

Description
Parameters
  • tnuid: number
  • callback: string
Return
  • images: array of .. (image/media_basic extension)
Example

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

getTaxonBreakdown

Description
Parameters
  • tnuid: number
  • callback: string
Return
  • taxa: array of .. (taxon_basic, count)
  • sex: array of .. (U,M,F,N,null)
Example

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

getTaxonPhenology

Description
Parameters
  • tnuid: number
  • callback: string
Return
  • spms: array of .. (date, sort_date, cuid)
Example

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

getTaxonNewTaxaByPub

Description
Parameters
  • tnuid: number
  • validOnly: string
  • callback: string
Return
  • pubs: array of .. (taxa_num, pub_ref)
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonNewTaxaByPub?tnuid=491&validOnly=Y&callback=api

getTaxonNewTaxaByYear

Description
Parameters
  • tnuid: number
  • validOnly: string
  • callback: string
Return
  • years: array of .. (taxa_num, year)
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonNewTaxaByYear?tnuid=52&validOnly=Y&callback=api

getTaxonStatsForYear

Description
Parameters
  • tnuid: number
  • stats_year: number
  • callback: string
Return
  • stats: array of .. (new_spm_num, all_spm_num, new_taxa_spm_num, all_taxa_spm_num, new_images_num, all_images_num, spm_years, images_years)
Example

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

Occurrence / Specimen

getSpmInfo

Description
Parameters
  • cuid: string
  • callback: string
Return
  • spmInfo: array of ..
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getSpmInfo?cuid=OSUC+59557&callback=api

getSpmsInfo

Description
Parameters
  • cuids: array of string
  • callback: string
Return
  • spmsInfo: array of ..
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getSpmsInfo?cuids=OSUC+59557,OSUC+56308&callback=api

Locality

getLocalityInfo

Description
Parameters
  • loc_id: number
  • tnuid: number
  • inst_id: number
  • per_id: number
  • pnid: number
  • showChildren: string
  • completeSpmInfo: string
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getLocalityInfo?loc_id=1&tnuid=30148&inst_id=1&per_id=1&pnid=1&showChildren=Y&completeSpmInfo=Y&callback=api

Place / Geopolitical Entity

getPlaceInfo

Description
Parameters
  • place_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getPlaceInfo?place_id=1&callback=api

getSubdivisions

Description
Parameters
  • place_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getSubdivisions?place_id=1&callback=api

getGeoTaxa

Description
Parameters
  • place_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getGeoTaxa?place_id=&callback=api

getGeoCollTrips

Description
Parameters
  • place_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getGeoCollTrips?place_id=&callback=api

getGeoCollTrips2

Description
Parameters
  • place_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getGeoCollTrips2?place_id=&callback=api

getGeoInsts

Description
Parameters
  • place_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getGeoTaxa?place_id=&callback=api

Literature

getLitReference

Description
Parameters
  • pub_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getLitReference?pub_id=&callback=api

getLitParts

Description
Parameters
  • pub_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getLitParts?pub_id=&callback=api

getPubTaxonCitation

Description
Parameters
  • pub_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getPubTaxonCitation?pub_id=&callback=api

getPubAssocCitation

Description
Parameters
  • pub_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getPubAssocCitation?pub_id=&callback=api

Journal

getJournalInfo

Description
Parameters
  • jrnl_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getJournalInfo?jrnl_id=&callback=api

getJournalPubs

Description
Parameters
  • jrnl_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getJournalPubs?jrnl_id=&callback=api

getJournalTaxa

Description
Parameters
  • jrnl_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getJournalTaxa?jrnl_id=&callback=api

Institution

getCollectionInfo

Description
Parameters
  • inst_id: number
  • callback: string
Return
  • collection_info: array of (name, code, vouchered, num_prim_types, num_sec_types, num_species, num_spms, oldest_spm, last_spm_time)
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getCollectionInfo?inst_id=21&callback=api

getPrimaryTypes

Description
Parameters
  • inst_id: number
  • callback: string
Return
  • types: array of .. (taxon_basic, cuid, type, hier, orig_desc (pubs))
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getPrimaryTypes?inst_id=6&callback=api

getSecondaryTypes

Description
Parameters
  • inst_id: number
  • callback: string
Return
  • types: array of .. (same as primary)
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getSecondaryTypes?inst_id=6&callback=api

getInstTaxa

Description
Parameters
  • inst_id: number
  • callback: string
Return
  • taxa: array of .. (taxon_extended, hier)
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getInstTaxa?inst_id=21&callback=api

getInstCollTrips2

Description
Parameters
  • inst_id: number
  • callback: string
Return
  • coll_trips: array of ..
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getInstCollTrips2?inst_id=21&callback=api

getInstPubs

Description
Parameters
  • inst_id: number
  • callback: string
Return
  • pubs: array of literature_basic
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getInstPubs?inst_id=1&callback=api

Unvouchered Record

getUnvoucheredRecord

Description
Parameters
  • unv_id: number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getUnvoucheredRecord?univ_id=1&callback=api

getUnvoucheredRecords

Description
Parameters
  • tnuid: number
  • showChildren: string
  • pnids: array of number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getUnvoucheredRecords?univ_id=1&showChildren=Y&pnids=&callback=api

getUnvoucheredRecords

Description
Parameters
  • tnuid: number
  • pnids: array of number
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getUnvoucheredRecords?univ_id=1&pnids=&callback=api

getUnvLocalityInfo

Description
Parameters
  • loc_id: number
  • tnuid: number
  • per_id: number
  • pnid: number
  • showChildren: string
  • callback: string
Return
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getUnvLocalityInfo?loc_id=1&tnuid=30148&per_id=1&pnid=1&showChildren=Y&callback=api

Text Search

getSearchResults

Description
Parameters
  • name: string
  • limit: number
  • categoryLimit: string
  • callback: string
Return
  • taxon_results:
  • cuid_results:
  • agent_results:
  • inst_results:
  • place_results:
  • journal_results:
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getSearchResults?name=Heptascelio+striatosternus&limit=20&categoryLimit=&callback=api

getTaxaFromText

Description
Parameters
  • name: string
  • limit: number
  • nameOnly: string
  • callback: string
Return
  • taxa:
  • count: number
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxaFromText?name=Heptascelio+striatosternus&limit=10&nameOnly=N&callback=api

getCuidsFromText

Description
Parameters
  • name: string
  • limit: number
  • callback: string
Return
  • cuids:
  • count: number
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getCuidsFromText?name=Heptascelio+striatosternus&limit=10&callback=api

getAgentsFromText

Description
Parameters
  • name: string
  • limit: number
  • includeParty: string
  • callback: string
Return
  • agents:
  • count: number
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getAgentsFromText?name=Heptascelio+striatosternus&limit=10&includeParty=Y&callback=api

getInstFromText

Description
Parameters
  • name: string
  • limit: number
  • callback: string
Return
  • inst:
  • count: number
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getInstFromText?name=Heptascelio+striatosternus&limit=10&callback=api

getJournalsFromText

Description
Parameters
  • name: string
  • limit: number
  • callback: string
Return
  • journals:
  • count: number
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getJournalsFromText?name=Heptascelio+striatosternus&limit=10&callback=api

getOrgsFromText

Description
Parameters
  • name: string
  • limit: number
  • callback: string
Return
  • orgs:
  • count: number
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getOrgsFromText?name=Heptascelio+striatosternus&limit=10&callback=api

getPlacesFromText

Description
Parameters
  • name: string
  • limit: number
  • callback: string
Return
  • places:
  • count: number
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getPlacesFromText?name=Heptascelio+striatosternus&limit=10&callback=api

getLocalitiesFromText

Description
Parameters
  • name: string
  • limit: number
  • callback: string
Return
  • locs:
  • count: number
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getLocalitiesFromText?name=Heptascelio+striatosternus&limit=10&callback=api

getCollMethodsFromText

Description
Parameters
  • name: string
  • limit: number
  • callback: string
Return
  • coll_methods:
  • count: number
Example

http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getCollMethodsFromText?name=Heptascelio+striatosternus&limit=10&callback=api

Data Type Glossary

OJ_Break API Data Type Glossary