Movatterモバイル変換


[0]ホーム

URL:


InPhO API Docs

The InPhO offers much of its data through a REST API in JSON and RDF formats.

 

A RESTful InPhO API

We are committed to open access, with data availablevia a REST API,a monthly OWL archive of the ontology, visualizations and datafiles postedon our datablog, andsource code at GitHub. All data uses theCreative Commons BY-NC-SA 3.0 license.

InPhO maintains an open-access application platform interface (API) to facilitate collaboration with digital humanities and semantic web programmers. This API is built upon the principles of REpresentational State Transfer (REST), a paradigm of web service development which leverages the ubiquotus HTTP protocol to provide a common interface for object manipulation.

Every idea, thinker and journal in the InPhO knowledge base may be retrieved in both a human-readable HTML page and a machine-readable JSON object. Entities may be manipulated through the four basic HTTP Request Methods: POST (create), GET (retrieve/list), PUT (update), DELETE. Authentication is handled through HTTP Basic Authentication over a secure SSL connection. Due to the stateless nature of a RESTful web service, each request is completely self-contained, eliminating the need for session scoping.

A detailed technical specification is below:

API Structure

URIGETPUTPOSTDELETE
/entitylist
/entity/{id}view
/idealistcreate
/idea/{id}viewupdatedelete
/idea/{id}/graphview
/idea/{id}/{relation}list
/idea/{id}/{relation}/{id2}updatecreatedelete
/thinkerlistcreate
/thinker/{id}viewupdatedelete
/thinker/{id}/graphview
/thinker/{id}/{relation}/{id2}updatecreate
/journallistcreate
/journal/{id}viewupdatedelete
/school_of_thoughtlist
/school_of_thought/{id}view
/worklist
/work/{id}view
/taxonomylist
/taxonomy/{id}view

Adding a file extension will return the appropriate format for GET requests. Currently implemented:

URIdefaulthtmljsonxml
/entityhtmlyy
/entity/{id}htmlyy
/ideahtmlyy
/idea/{id}htmlyy
/idea/{id}/graphhtmlyy
/idea/{id}/{relation}htmlyy
/idea/{id}/{relation}/{id2}
/thinkerhtmlyy
/thinker/{id}htmlyy
/thinker/{id}/graphhtmlyy
/thinker/{id}/{relation}/{id2}
/journalhtmlyy
/journal/{id}htmlyy
/taxonomyhtmlyy
/taxonomy/{id}htmlyy
/school_of_thoughthtmlyy
/school_of_thought/{id}htmlyy
/workhtmlyy
/work/{id}htmlyy
Thinker-Thinker {relation}s
influenced, influenced_by, teacher_of, student_of
Idea-Idea {relation}s
classes, instances, links, hyponyms, relatedFIX: generality, relatedness
Idea {relation}s
FIX: nationality, profession

Response Codes

Code using our platform should handle the 6 HTTP Responses below for all Methods, unless otherwise noted.

HTTP 200 OK
Request processed, success
HTTP 400 Bad Request
Only for: POST, PUTRequest did not validate (ex: teacher_of can only have a degree of 0 or 1 (y/n) - if degree=3 you will get an HTTP 400)
HTTP 401 Unauthorized
Only for: Permissioned methods (see chart below)Unable to be authorized, self explanatory.
HTTP 404 Not Found
One of the ids passed was invalid, so the resource could not be found
HTTP 405 Method Not Allowed
The URL does not support the request method. (ex: Using GET on anevaluation url)
HTTP 409 Conflict
Only for: POST, PUTValid request, but there are conflicts (ex. creating a journal with an ISSN that is already in the db)
HTTP 500 Internal Server Error
Thrown if there are currently issues with the InPhO service.

Permissions

There are five levels of authentication - from most restrictive to least restrictive, each role has the privileges ofall lesser roles:

publicGET
userevaluation POST
creatorevaluation PUT, DELETE
curatorentity PUT, POST, DELETE
adminall permissions

Request Parameters

GET Parameters

/idea, /journal, /entity, /taxonomy, /thinker, /work, /school_of_thought
string: sep, qboolean: redirectint: limit

POST/PUT Parameters

/journal/{id}
String: ISSN, URLboolean: openAccess, student, active (pass blank for false - ex. “?openAccess=&student=&active=”)
/idea, /journal, /entity, /taxonomy, /thinker, /work, /school_of_thought
String: sep_dir
/idea/{id}, /journal{id}, /entity{id}, /taxonomy{id}, /thinker{id}, /work{id}, /school_of_thought{id}
String: sep_dir
/idea/{id}/{related}
boolean: sep_filter
/idea/{id}/{relation}/{id2}
int: degree (0:4)
/thinker/{id}}/{relation}/{id2}
int: degree (0:4)

Quick Start

The quickest way to get started is to use the command line tool curl:

GET

curlhttps://inpho.cogs.indiana.edu/idea/646

To send a query for a specific SEP directory

PUT

curl-XPUT-d"degree=1"-uusername:passwordhttps://inpho.cogs.indiana.edu/thinker/3724/teacher_of/2553

For platforms which do not support the PUT method (including HTML4 forms), one can make a POST request with theparameter_method=PUT which will be translated to the appropriate request on the server-side:

curl-d"_method=PUT&degree=3"-uusername:passwordhttps://inpho.cogs.indiana.edu/thinker/3724/teacher_of/2553

POST
curl-XPOST-d"label=epistemology"-uusername:passwordhttps://inpho.cogs.indiana.edu/idea
DELETE
curl-XDELETE-uusername:passwordhttps://inpho.cogs.indiana.edu/thinker/3724/teacher_of/2553curl-XDELETE-uusername:passwordhttps://inpho.cogs.indiana.edu/idea/715

Development

Developers may use any language to code against the API, provided they use the HTTP protocol.These are some reccommended url libraries for common development languages:

PHPcurl
Pythonurllib
PerlWWW::curl
RubyNet::HTTP
Clibcurl
C++curlpp
C#System.Net.HttpWebRequest
JavaHttpClient
Common LispAllegroServe
JavaScriptXMLHttpRequest
JavaScriptjQuery.PostjQuery.Ajax[useful notes on PUT and DELETE]
JavaScriptYAHOO.util.Connect.asyncRequest[example][docs]

Testing

InPhO maintains a separate server for development testing. Applications should be tested onhttp://inphodev.cogs.indiana.edu:8088/ before switching tohttps://inpho.cogs.indiana.edu/. InPhOdev maintains a separate database toavoid data pollution issues during development. The data is periodicallyreplaced with the newest data from InPhO.

More REST Resources


Office of Digital Humanities Funded through several generous grants by theNational Endowment of the Humanities, Office of Digital Humanities. Any views, findings, conclusions or recommendations expressed in this website do not necessarily represent those of the NEH.


Prior support from the Office of the Vice-Provost for Research and the Cognitive Science Program at Indiana University Bloomington made the original Indiana Philosophy Ontology project possible. Although rebranded to the Internet Philosophy Ontology, our genesis lives on in the InPhO moniker.


InPhO is committed to open access. Data published viathe REST API,datablog, andOWL archives are licensed by theCreative Commons BY-NC-SA 3.0 License. Developed using open-source technologies and distributed onGitHub.


[8]ページ先頭

©2009-2026 Movatter.jp