The InPhO offers much of its data through a REST API in JSON and RDF formats.
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:
| URI | GET | PUT | POST | DELETE |
|---|---|---|---|---|
| /entity | list | – | – | – |
| /entity/{id} | view | – | – | – |
| /idea | list | – | create | – |
| /idea/{id} | view | update | – | delete |
| /idea/{id}/graph | view | – | – | – |
| /idea/{id}/{relation} | list | – | – | – |
| /idea/{id}/{relation}/{id2} | – | update | create | delete |
| /thinker | list | – | create | – |
| /thinker/{id} | view | update | – | delete |
| /thinker/{id}/graph | view | – | – | – |
| /thinker/{id}/{relation}/{id2} | – | update | create | – |
| /journal | list | – | create | – |
| /journal/{id} | view | update | – | delete |
| /school_of_thought | list | – | – | – |
| /school_of_thought/{id} | view | – | – | – |
| /work | list | – | – | – |
| /work/{id} | view | – | – | – |
| /taxonomy | list | – | – | – |
| /taxonomy/{id} | view | – | – | – |
Adding a file extension will return the appropriate format for GET requests. Currently implemented:
| URI | default | html | json | xml |
|---|---|---|---|---|
| /entity | html | y | y | – |
| /entity/{id} | html | y | y | – |
| /idea | html | y | y | – |
| /idea/{id} | html | y | y | – |
| /idea/{id}/graph | html | y | y | – |
| /idea/{id}/{relation} | html | y | y | – |
| /idea/{id}/{relation}/{id2} | – | – | – | – |
| /thinker | html | y | y | – |
| /thinker/{id} | html | y | y | – |
| /thinker/{id}/graph | html | y | y | – |
| /thinker/{id}/{relation}/{id2} | – | – | – | – |
| /journal | html | y | y | – |
| /journal/{id} | html | y | y | – |
| /taxonomy | html | y | y | – |
| /taxonomy/{id} | html | y | y | – |
| /school_of_thought | html | y | y | – |
| /school_of_thought/{id} | html | y | y | – |
| /work | html | y | y | – |
| /work/{id} | html | y | y | – |
Code using our platform should handle the 6 HTTP Responses below for all Methods, unless otherwise noted.
There are five levels of authentication - from most restrictive to least restrictive, each role has the privileges ofall lesser roles:
| public | GET |
| user | evaluation POST |
| creator | evaluation PUT, DELETE |
| curator | entity PUT, POST, DELETE |
| admin | all permissions |
The quickest way to get started is to use the command line tool curl:
curlhttps://inpho.cogs.indiana.edu/idea/646
To send a query for a specific SEP directory
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°ree=3"-uusername:passwordhttps://inpho.cogs.indiana.edu/thinker/3724/teacher_of/2553
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:
| PHP | curl |
| Python | urllib |
| Perl | WWW::curl |
| Ruby | Net::HTTP |
| C | libcurl |
| C++ | curlpp |
| C# | System.Net.HttpWebRequest |
| Java | HttpClient |
| Common Lisp | AllegroServe |
| JavaScript | XMLHttpRequest |
| JavaScript | jQuery.PostjQuery.Ajax[useful notes on PUT and DELETE] |
| JavaScript | YAHOO.util.Connect.asyncRequest[example][docs] |
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.