OntoWiki Web Services
Web services are handled by OntoWiki's ServiceController.
Authentication (/service/auth)
Authentication Request
You can authenticate using via web service with an OntoWiki installation under the URI <ontowiki-uri>/service/auth.
Authentication parameters can be supplied using POST or GET. However, GET is disabled by default and we don't recommend using it as passwords will be visible in the URI sent to the server. If you want to enable GET authentication set OntoWiki's config parameter rest.allowGetAuth to true.
The authentication supports the following parameters:
- u — the username to authenticate with (required parameter if logout is not supplied or false)
- p — the password to authenticate with (can be omitted; defaults to "")
- logout — supply this parameter with the value true to remove the current authentication (required for logout).
Authentication Response
The REST Server responds with one of the following HTTP responses:
- 200 OK — The authentication was successfull. You now can request OntoWiki URIs that require authentication.
- 401 Unauthorized — The authentication did not succeed. In most cases you supplied invalid user name, password or both.
- 405 Method Not Allowed — You tried to authenticate via GET, although this is disabled in OntoWiki config.
- 400 Bad Request — You didn't supply the parameters needed to fullfill the request.
SPARQL Query (/service/sparql)
Onto Wiki's web service accepts SPARQL queries according to the
SPARQL protocol. The service is reachable under the URI <ontowiki-uri>/service/sparql.
Installation
You should go to Erfurt-directory and enable it in erfurt.ini by setting the value of endpoint.http to 'true'.
Usage
values submitted by HTTP GET/POST Variables:
- query: OBLIGATORY must contain the SPARQL-query to be executed on the Database
- default-graph-uri: OPTIONAL can contain an URI of a model to query on
Error Message is given if any problem occured. (See Authentication Response for Error-Codes; they are applying on SPARQL Endpoint too)
Example
/service/sparql?query=SELECT * WHERE {?s ?p ?o}&default-graph-uri=http://mymodel.org/ will give you all triples from http://mymodel.org. The result of the query is delivered as xml like specified from:
http://www.w3.org/TR/rdf-sparql-XMLres/.
Model Update (/service/update)
OntoWiki supports updating models via its web service. As of version 0.9 we support a
JSON format but more formats are planned. To update a model, three parameters must be supplied:
- model — the graph URI to be updated
- old — the old model as it was before the update process
- new — the updated model.
The difference between old and new determines the statements that will be added to the model.
Information
Last Modification:
2008-02-02 14:49:58 by Sebastian Dietzold