Difference between revisions of "OJ Break v2 Agent Reference"

From xBio:D Wiki
Jump to navigation Jump to search
(Elements)
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
'''Introduction'''
 
'''Introduction'''
  
OJ_Break is the name of the xBio:D RESTful API service to facilitate discovery of data within the xBio:D database. The API can respond with JavaScript Object Notation (JSON), XML, or JSON with padding (JSONP) and accepts HTTP GET and POST requests indiscriminately. The backend of the API is written in Oracle's PL/SQL database language, which is fast but often inflexible, while a Python presentation layer mitigates request handling and authentication.
+
OJ_Break is the name of the xBio:D RESTful API service to facilitate discovery of data within the xBio:D database. The API can respond with HTML, JSON, XML, or JSON with padding (JSONP) and accepts HTTP GET and POST requests indiscriminately. The backend of the API is written in Oracle's PL/SQL database language, which is fast but often inflexible, while a Python presentation layer mitigates request handling and authentication.
  
 
OJ_Break Version 2 is a new and improved edition of the work started in Version 1. Version 2 introduces a completely restructured and standardized data model to further enhance the functionality of the xBio:D database.
 
OJ_Break Version 2 is a new and improved edition of the work started in Version 1. Version 2 introduces a completely restructured and standardized data model to further enhance the functionality of the xBio:D database.
Line 10: Line 10:
 
Using the OJ_Break Version 2 API requires calling methods with corresponding, method specific parameters (found on this page) and a few other required parameters. These required parameters include specifying a return ''format'', an API access ''key'', and a ''version'' number.  
 
Using the OJ_Break Version 2 API requires calling methods with corresponding, method specific parameters (found on this page) and a few other required parameters. These required parameters include specifying a return ''format'', an API access ''key'', and a ''version'' number.  
  
     Example: http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentInfo?agent_id=2&format=json&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2
+
     Example: http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentInfo?agent_id=2&format=html&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2
  
 
Notice the specification of the ''version'' parameter at the end of the example method call. With the introduction of OJ_Break Version 2, the ''version'' parameter has a default value of ''2'' making the specification in the example unnecessary. To read more about using the OJ_Break Version 2 API, go to [[OJ_Break API Access]].
 
Notice the specification of the ''version'' parameter at the end of the example method call. With the introduction of OJ_Break Version 2, the ''version'' parameter has a default value of ''2'' making the specification in the example unnecessary. To read more about using the OJ_Break Version 2 API, go to [[OJ_Break API Access]].
 +
 +
 +
[[File:OJ_Break Data Model - Agent.png|none|frame|Agent Data Model]]
  
 
== Procedural Reference ==
 
== Procedural Reference ==
Line 19: Line 22:
 
===== Description =====
 
===== Description =====
 
===== Parameters =====
 
===== Parameters =====
* ''agent_id'': ''agent_id''
+
* ''agent_id'': ''[[#agent_id|agent_id]]''
 
* ''format'': string
 
* ''format'': string
 
* ''key'': string
 
* ''key'': string
 
* ''version'': number
 
* ''version'': number
 
===== Return =====
 
===== Return =====
* ''AgentComplete''
+
* [[#AgentComplete (extends AgentExtended)|AgentComplete]]
  
 
===== Example =====
 
===== Example =====
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentInfo?agent_id=2&format=json&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2
+
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentInfo?agent_id=2&format=html&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2
  
 
==== getAgentLiterature ====
 
==== getAgentLiterature ====
 
===== Description =====
 
===== Description =====
 
===== Parameters =====
 
===== Parameters =====
* ''agent_id'': ''agent_id''
+
* ''agent_id'': ''[[#agent_id|agent_id]]''
* ''offset'': number (optional)
+
* ''*offset'': number
* ''limit'': number (optional)
+
* ''*limit'': number
 
* ''format'': string
 
* ''format'': string
 
* ''key'': string
 
* ''key'': string
 
* ''version'': number
 
* ''version'': number
 
===== Return =====
 
===== Return =====
* ''AgentReturnLiterature''
+
* [[#AgentReturnLiterature (extends AgentReturn)|AgentReturnLiterature]]
  
 
===== Example =====
 
===== Example =====
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentLiterature?agent_id=2&format=json&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2
+
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentLiterature?agent_id=2&format=html&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2
  
 
==== getAgentTaxa ====
 
==== getAgentTaxa ====
 
===== Description =====
 
===== Description =====
 
===== Parameters =====
 
===== Parameters =====
* ''agent_id'': ''agent_id''
+
* ''agent_id'': ''[[#agent_id|agent_id]]''
* ''offset'': number (optional)
+
* ''*offset'': number
* ''limit'': number (optional)
+
* ''*limit'': number
 
* ''format'': string
 
* ''format'': string
 
* ''key'': string
 
* ''key'': string
 
* ''version'': number
 
* ''version'': number
 
===== Return =====
 
===== Return =====
* ''AgentReturnTaxa''
+
* [[#AgentReturnTaxa (extends AgentReturn)|AgentReturnTaxa]]
  
 
===== Example =====
 
===== Example =====
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentTaxa?agent_id=2&format=json&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2
+
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentTaxa?agent_id=2&format=html&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2
  
 
==== getAgentOccurrences ====
 
==== getAgentOccurrences ====
 
===== Description =====
 
===== Description =====
 
===== Parameters =====
 
===== Parameters =====
* ''agent_id'': ''agent_id''
+
* ''agent_id'': ''[[#agent_id|agent_id]]''
* ''offset'': number (optional)
+
* ''*offset'': number
* ''limit'': number (optional)
+
* ''*limit'': number
* ''basic_only'': Boolean_flag (optional)
+
* ''*basic_only'': Boolean_flag
 
* ''format'': string
 
* ''format'': string
 
* ''key'': string
 
* ''key'': string
 
* ''version'': number
 
* ''version'': number
 
===== Return =====
 
===== Return =====
* ''AgentReturnOccurrences''
+
* [[#AgentReturnOccurrences (extends AgentReturn)|AgentReturnOccurrences]]
  
 
===== Example =====
 
===== Example =====
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentOccurrences?agent_id=2&format=json&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2
+
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentOccurrences?agent_id=2&format=html&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2
 
 
  
 
== Agent Data Type Glossary ==
 
== Agent Data Type Glossary ==
 
=== Classes===
 
=== Classes===
 
==== AgentBasic ====
 
==== AgentBasic ====
* ''agent_id'': ''[[#agent_id|agent_id]]'' element
+
* ''agent_id'': ''[[#agent_id|agent_id]]''
* ''agent_type'': ''[[#agent_type|agent_type]]'' element
+
* ''agent_type'': ''[[#agent_type|agent_type]]''
* ''agent_name'': ''[[#agent_name|agent_name]]'' element
+
* ''agent_name'': ''[[#agent_name|agent_name]]''
  
==== AgentComplete (extends [[#AgentExtended_.28extends_AgentBasic.29|AgentExtended]]) ====
+
==== AgentComplete (extends [[#AgentExtended (extends AgentBasic)|AgentExtended]]) ====
* ''stats'': [[#AgentStats|AgentStats]] class
+
* ''stats'': [[#AgentStats|AgentStats]]
  
 
==== AgentExtended (extends [[#AgentBasic|AgentBasic]]) ====
 
==== AgentExtended (extends [[#AgentBasic|AgentBasic]]) ====
  
 +
==== AgentReturn ====
 +
* ''general'': [[#AgentBasic|AgentBasic]]
 +
 +
==== AgentReturnLiterature (extends [[#AgentReturn|AgentReturn]]) ====
 +
* ''literature'': array of [[OJ_Break v2 Literature Reference#LiteratureExtended (extends LiteratureBasic)|LiteratureExtended]]
 +
 +
==== AgentReturnOccurrences (extends [[#AgentReturn|AgentReturn]]) ====
 +
* ''occurrences'': array of [[OJ_Break v2 Occurrence Reference#OccurrenceExtended (extends OccurrenceBasic)|OccurrenceExtended]]
 +
 +
==== AgentReturnTaxa (extends [[#AgentReturn|AgentReturn]]) ====
 +
* ''taxa'': array of [[OJ_Break v2 Taxon Reference#TaxonRelationship (extends TaxonExtended)|TaxonRelationship]]
 +
 +
==== AgentStats ====
 +
* ''num_spms'': Number
 +
* ''num_coll_events'': Number
 +
* ''num_pubs'': Number
 +
 +
==== PartyComplete (realizes [[#AgentComplete (extends AgentExtended)|AgentComplete]]) ====
 +
* ''people'': array of [[#PersonComplete (realizes AgentComplete)|PersonComplete]]
 +
 +
==== PartyExtended (realizes [[#AgentExtended (extends AgentBasic)|AgentExtended]]) ====
 +
* ''people'': array of [[#PersonExtended (realizes AgentExtended)|PersonExtended]]
 +
 +
==== PersonAddress ====
 +
* ''full_address'': String
 +
* ''address1'': String
 +
* ''address2'': String
 +
* ''address3'': String
 +
* ''address4'': String
 +
* ''city'': String
 +
* ''state'': String
 +
* ''zip_code'': String
 +
* ''country'': String
 +
 +
==== PersonComplete (realizes [[#AgentComplete (extends AgentExtended)|AgentComplete]]) ====
 +
* ''title'': String
 +
* ''institution'': [[OJ_Break v2 Institution Reference#InstitutionBasic|InstitutionBasic]]
 +
* ''contact'': [[#PersonContact|PersonContact]]
 +
* ''bio'': String
 +
* ''year_born'': Number
 +
* ''year_died'': Number
 +
* ''gender'': ''[[#gender|gender]]''
 +
* ''image'': URL
 +
* ''synonyms'': array of [[#PersonExtended (realizes AgentExtended)|PersonExtended]]
 +
 +
==== PersonContact ====
 +
* ''address'': [[#PersonAddress|PersonAddress]]
 +
* ''email'': Email
 +
* ''phone'': Phone
 +
* ''fax'': Phone
 +
* ''web'': URL
 +
 +
==== PersonExtended (realizes [[#AgentExtended (extends AgentBasic)|AgentExtended]]) ====
 +
* ''last_name'': ''[[#last_name|last_name]]'' element
 +
* ''first_name'': ''[[#first_name|first_name]]'' element
 +
* ''initials'': ''[[#initials|initials]]'' element
 +
* ''generation'': ''[[#generation|generation]]'' element
 +
* ''name_order'': ''[[#name_order|name_order]]'' element
 +
* ''person_icon'': ''[[#person_icon|person_icon]]'' element
 +
* ''preferred_name'': ''[[#preferred_name|preferred_name]]'' element
  
 
=== Elements ===
 
=== Elements ===
 +
==== agent_id ====
 +
Number - An identifier which uniquely identifies an agent.
 +
==== agent_type ====
 +
String - a single word description of the agent. Can be either "PERSON" or "PARTY".
 +
==== agent_name ====
 +
String - An agent's full name. If the agent is a party, all names in the party are included and comma separated.
 +
==== last_name ====
 +
String - A agent's last name (surname).
 +
==== first_name ====
 +
String - A agent's first name.
 +
==== gender ====
 +
String - A one letter designation for the gender of the agent (F => Female, M => Male, U => Unknown / Unspecified).
 +
==== initials ====
 +
String - The initials for the given name of an agent.
 +
==== generation ====
 +
String - The generational designation (Jr., III, etc.) for an agent.
 +
==== name_order ====
 +
String - An indicator specifying whether an agent's name should be formatted according to western (W) or eastern (E) conventions.
 +
==== person_icon ====
 +
URL - URL location of thumbnail of an agent.
 +
==== preferred_name ====
 +
String - A agent's preferred name.
 +
 
== See also ==
 
== See also ==
 
Visit any of the below links to find information about the other data domains defined by OJ_Break Version 2.
 
Visit any of the below links to find information about the other data domains defined by OJ_Break Version 2.
Line 98: Line 183:
 
* [[OJ_Break v2 Literature Reference|Literature]]
 
* [[OJ_Break v2 Literature Reference|Literature]]
 
* [[OJ_Break v2 Locality Reference|Locality]]
 
* [[OJ_Break v2 Locality Reference|Locality]]
 +
* [[OJ_Break v2 Media Reference|Media]]
 
* [[OJ_Break v2 Occurrence Reference|Occurrence]]
 
* [[OJ_Break v2 Occurrence Reference|Occurrence]]
 
* [[OJ_Break v2 Search Reference|Search]]
 
* [[OJ_Break v2 Search Reference|Search]]
 
* [[OJ_Break v2 Taxon Reference|Taxon]]
 
* [[OJ_Break v2 Taxon Reference|Taxon]]

Latest revision as of 19:18, 29 June 2015

Introduction

OJ_Break is the name of the xBio:D RESTful API service to facilitate discovery of data within the xBio:D database. The API can respond with HTML, JSON, XML, or JSON with padding (JSONP) and accepts HTTP GET and POST requests indiscriminately. The backend of the API is written in Oracle's PL/SQL database language, which is fast but often inflexible, while a Python presentation layer mitigates request handling and authentication.

OJ_Break Version 2 is a new and improved edition of the work started in Version 1. Version 2 introduces a completely restructured and standardized data model to further enhance the functionality of the xBio:D database.

API Information and Access

This page specifies the methods and data defined by OJ_Break Version 2, more precisely those that are defined by the Agent data domain. To get information on any of the other data domains defined in OJ_Break Version 2, visit the See also section.

Using the OJ_Break Version 2 API requires calling methods with corresponding, method specific parameters (found on this page) and a few other required parameters. These required parameters include specifying a return format, an API access key, and a version number.

   Example: http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentInfo?agent_id=2&format=html&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2

Notice the specification of the version parameter at the end of the example method call. With the introduction of OJ_Break Version 2, the version parameter has a default value of 2 making the specification in the example unnecessary. To read more about using the OJ_Break Version 2 API, go to OJ_Break API Access.


Agent Data Model

Procedural Reference

Agent

getAgentInfo

Description
Parameters
  • agent_id: agent_id
  • format: string
  • key: string
  • version: number
Return
Example
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentInfo?agent_id=2&format=html&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2

getAgentLiterature

Description
Parameters
  • agent_id: agent_id
  • *offset: number
  • *limit: number
  • format: string
  • key: string
  • version: number
Return
Example
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentLiterature?agent_id=2&format=html&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2

getAgentTaxa

Description
Parameters
  • agent_id: agent_id
  • *offset: number
  • *limit: number
  • format: string
  • key: string
  • version: number
Return
Example
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentTaxa?agent_id=2&format=html&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2

getAgentOccurrences

Description
Parameters
  • agent_id: agent_id
  • *offset: number
  • *limit: number
  • *basic_only: Boolean_flag
  • format: string
  • key: string
  • version: number
Return
Example
http://osuc.biosci.ohio-state.edu/OJ_Break/getAgentOccurrences?agent_id=2&format=html&key=FBF57A9F7A666FC0E0430100007F0CDC&version=2

Agent Data Type Glossary

Classes

AgentBasic

AgentComplete (extends AgentExtended)

AgentExtended (extends AgentBasic)

AgentReturn

AgentReturnLiterature (extends AgentReturn)

AgentReturnOccurrences (extends AgentReturn)

AgentReturnTaxa (extends AgentReturn)

AgentStats

  • num_spms: Number
  • num_coll_events: Number
  • num_pubs: Number

PartyComplete (realizes AgentComplete)

PartyExtended (realizes AgentExtended)

PersonAddress

  • full_address: String
  • address1: String
  • address2: String
  • address3: String
  • address4: String
  • city: String
  • state: String
  • zip_code: String
  • country: String

PersonComplete (realizes AgentComplete)

PersonContact

  • address: PersonAddress
  • email: Email
  • phone: Phone
  • fax: Phone
  • web: URL

PersonExtended (realizes AgentExtended)

Elements

agent_id

Number - An identifier which uniquely identifies an agent.

agent_type

String - a single word description of the agent. Can be either "PERSON" or "PARTY".

agent_name

String - An agent's full name. If the agent is a party, all names in the party are included and comma separated.

last_name

String - A agent's last name (surname).

first_name

String - A agent's first name.

gender

String - A one letter designation for the gender of the agent (F => Female, M => Male, U => Unknown / Unspecified).

initials

String - The initials for the given name of an agent.

generation

String - The generational designation (Jr., III, etc.) for an agent.

name_order

String - An indicator specifying whether an agent's name should be formatted according to western (W) or eastern (E) conventions.

person_icon

URL - URL location of thumbnail of an agent.

preferred_name

String - A agent's preferred name.

See also

Visit any of the below links to find information about the other data domains defined by OJ_Break Version 2.