API
and Documentation
SPARQL Endpoint Web Service API
Documentation
For
background, we suggest first reading the
about section for this Web
Service. Also, you may want to consult
this
document for an overall discussion of API design and philosophy.
Developers communicate with the
SPARQL Endpoint Zitgist
UMBEL Web service using the HTTP GET method. You may request one
of the following mime types: (1)
application/sparql-results+xml,
(2)
application/sparql-results+json, (3) text/html , (4)
application/rdf+xml and (5)
application/rdf+n3. The content returned by the Web
service will be serialized using the mime type requested and the data
returned will depend on the parameters selected.
Note: The SPARQL Endpoint Web service is limited to returning a maximum of 100 results in the free online version.
Web Service Endpoint
Information
Here is the information needed to communicate
with this Web service's endpoint. Descriptions of the parameters are
included below.
Note: if a parameter has a default value,
the requester can omit it and the default value will be used. Also,
some baseline UMBEL Web services may not offer other values than the
default.
HTTP
Method:
Possible "Accept:" HTTP header
field value:
URI:
- http://umbel.zitgist.com/ws/sparql/
?graph=param1&version=param2&query=param3&lang=param4
URI dynamic parameters description:
Note: All parameters have to be URL-encoded
- param1. One of:
- " http://umbel.org/umbel/sc/v071/ (default)": Graph where the
subject concepts and
abstract concepts are described
- " http://umbel.org/umbel/ne/v071/": Graph where the named entities
are
described
- " http://umbel.org/umbel/v071/": Graph where
the UMBEL ontology
classes and properties are described
- param2. The UMBEL version to query; One of:
- 071 (default). UMBEL version 0.71
- param3. The url-encoded
SPARL query without the "sparql" begenning
keyword
- param4. One of:
- " en (default)": Labels
of resultsets in English if available
Example of
Returned XML Document
This is an example of the XML document
returned by this Web service endpoint for a given SPARQL query.
Query:
- http://umbel.zitgist.com/new/ws/sparql/?
graph=http%3A%2F%2Fumbel.org%2Fumbel%2Fsc%2Fv071%2F&version=071&
query=select+%2A+from+%3Chttp%3A%2F%2Fumbel.org%2Fumbel%2Fsc%2Fv071
%2F%3E+where+%7B%3Fs+%3Fp+%3Fo.%7D%20LIMIT%201
"Accept:" HTTP header field value:
- application/sparql-results+xml
Result:
-
<?xml version="1.0" ?>
-
<sparql xmlns="http://www.w3.org/2005/sparql-results#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/sw/DataAccess/rf1/result2.xsd">
-
<head>
-
<variable name="s"/>
-
<variable name="p"/>
-
<variable name="o"/>
-
</head>
-
<results distinct="false" ordered="true">
-
<result>
-
<binding name="s"><uri>
http://umbel.org/umbel/ac/AbductiveInferenceProcess</uri></binding>
-
<binding name="p"><uri>
http://www.w3.org/1999/02/22-rdf-syntax-ns#type</uri></binding>
-
<binding name="o"><uri>
http://umbel.org/umbel#AbstractConcept</uri></binding>
-
</result>
-
</results>
-
</sparql>
Example
of Returned JSON Document
This is an example of the JSON document
returned by this Web service endpoint for a given SPARQL query.
Query:
- http://umbel.zitgist.com/new/ws/sparql/?
graph=http%3A%2F%2Fumbel.org%2Fumbel%2Fsc%2F&version=071&
query=select+%2A+from+%3Chttp%3A%2F%2Fumbel.org%2Fumbel%2Fsc%2Fv071
%2F%3E+where+%7B%3Fs+%3Fp+%3Fo.%7D%20LIMIT%201
"Accept:" HTTP header field value:
- application/sparql-results+json
Result:
-
{ "head": { "link": [], "vars": ["s", "p", "o"] },
-
"results": { "distinct": false,
"ordered": true, "bindings": [
-
{ "s": { "type": "uri",
"value":
"http://umbel.org/umbel/ac/AbductiveInferenceProcess" }
,
"p": { "type": "uri", "value":
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
} ,
"o": { "type": "uri", "value":
"http://umbel.org/umbel#AbstractConcept"
}} ] } }
Example
of Returned HTML Document
This is an example of the HTML document
returned by this Web service endpoint for a given SPARQL query.
Query:
- http://umbel.zitgist.com/new/ws/sparql/?
graph=http%3A%2F%2Fumbel.org%2Fumbel%2Fsc%2F&version=071&
query=select+%2A+from+%3Chttp%3A%2F%2Fumbel.org%2Fumbel%2Fsc%2Fv071
%2F%3E+where+%7B%3Fs+%3Fp+%3Fo.%7D%20LIMIT%201
"Accept:" HTTP header field value:
Result:
-
<table class="sparql" border="1">
-
-
-
-
-
-
-
<td>http://umbel.org/umbel/ac/AbductiveInferenceProcess
</td>
-
<td>http://www.w3.org/1999/02/22-rdf-syntax-ns#type
</td>
-
<td>http://umbel.org/umbel#AbstractConcept
</td>
-
-
Example
of Returned RDF/N3 Document
Here is an example of a RDF/N3
document returned by this Web service endpoint for a given URI. This
example returns a list of UMBEL named entities where
the preferred label matches the example "madonna" search string.
Query:
- http://umbel.zitgist.com/new/ws/sparql/?
graph=http%3A%2F%2Fumbel.org%2Fumbel%2Fsc%2F&version=071&
query=select+%2A+from+%3Chttp%3A%2F%2Fumbel.org%2Fumbel%2Fsc%2Fv071
%2F%3E+where+%7B%3Fs+%3Fp+%3Fo.%7D%20LIMIT%201
"Accept:" HTTP header field value:
Result:
-
@prefix res:
<http://www.w3.org/2005/sparql-results#> .
-
@prefix rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
[] rdf:type res:ResultSet ;
-
res:resultVariable "s" ;
-
res:resultVariable "p" ;
-
res:resultVariable "o" ;
-
res:solution [
-
res:binding [
res:variable "s" ; res:value
<http://umbel.org/umbel/ac/AbductiveInferenceProcess>
] ;
-
res:binding [
res:variable "p" ; res:value
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
] ;
-
res:binding [
res:variable "o" ; res:value
<http://umbel.org/umbel#AbstractConcept>
] ] .
HTTP
Status Codes
Here are the possible HTTP status (error)
codes returned by this Web service endpoint.
- Code: 200
- Code: 400
- Message: Bad Request
- Message description: No SPARQL
query specified
- Code: 406
- Message: Not Acceptable
- Message
description: Unacceptable mime type requested
- Code: 500