CTS2-LE REST API: SPARQL Query: Unterschied zwischen den Versionen

Aus CTS2-LE
Zur Navigation springen Zur Suche springen
(Added basic HTTP operations supported by CTS2-LE)
Zeile 1: Zeile 1:
 +
CTS2-LE allows for SPARQL-SELECT queries within and across terminologies.
 +
 +
=== Operation ===
 +
* '''Path:''' /WebCts2LE/service/crud/sparql/select
 +
* '''Method:''' GET
 +
* '''Path Parameters:''' -
 +
* '''Query Parameters:''' SPARQL select-query string
 +
* '''returns: ''' query results according to https://www.w3.org/TR/rdf-sparql-XMLres/ but WITHOUT the head-element
 +
 +
=== Example Call ===
 +
<code>http://localhost:8080/WebCts2LE/service/crud/sparql/select?query=select%20?val%20where%20%7B%20?x%20:name%20?n.%20?x%20:designation%20?d.%20?d%20:designationRole%2</code>
 +
 +
for uncoded query
 +
<code>select ?val where { ?x :name ?n. ?x :designation ?d. ?d :designationRole 'PREFERRED'; :value ?val } limit 10</code>
 +
 +
===== Example Response Structure =====
 +
 +
<pre>
 +
<?xml version="1.0"?>
 +
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
 +
  <results>
 +
    <result>
 +
      <binding name="val">
 +
        <literal>...</literal>
 +
      </binding>
 +
    </result>
 +
    ...
 +
  </results>
 +
</sparql>
 +
</pre>
 +
 +
<!-- shifted
 
The CTS2-LE REST API implements the [http://www.w3.org/TR/2013/REC-sparql11-protocol-20130321/ SPARQL 1.1 Protocol], but is limited to the [http://www.w3.org/TR/2013/REC-sparql11-protocol-20130321/#query-operation HTTP Query] operation. Furthermore, the [http://www.w3.org/TR/sparql11-http-rdf-update/ SPARQL 1.1 Graph Store HTTP Protocol] is supported by CTS2-LE which is  restricted to [http://www.w3.org/TR/sparql11-http-rdf-update/#http-get HTTP GET] and [http://www.w3.org/TR/sparql11-http-rdf-update/#http-put HTTP PUT] operations.
 
The CTS2-LE REST API implements the [http://www.w3.org/TR/2013/REC-sparql11-protocol-20130321/ SPARQL 1.1 Protocol], but is limited to the [http://www.w3.org/TR/2013/REC-sparql11-protocol-20130321/#query-operation HTTP Query] operation. Furthermore, the [http://www.w3.org/TR/sparql11-http-rdf-update/ SPARQL 1.1 Graph Store HTTP Protocol] is supported by CTS2-LE which is  restricted to [http://www.w3.org/TR/sparql11-http-rdf-update/#http-get HTTP GET] and [http://www.w3.org/TR/sparql11-http-rdf-update/#http-put HTTP PUT] operations.
  
Zeile 139: Zeile 171:
 
=== Operation Syntax for [http://www.w3.org/TR/sparql11-http-rdf-update/#http-post HTTP Request Method POST] ===
 
=== Operation Syntax for [http://www.w3.org/TR/sparql11-http-rdf-update/#http-post HTTP Request Method POST] ===
 
This HTTP method is not implemented. Thus, CTS2-LE returns status code (501) indicating CTS2-LE does not support the functionality needed to fulfill the request.
 
This HTTP method is not implemented. Thus, CTS2-LE returns status code (501) indicating CTS2-LE does not support the functionality needed to fulfill the request.
 +
-->

Version vom 24. August 2016, 19:26 Uhr

CTS2-LE allows for SPARQL-SELECT queries within and across terminologies.

Operation

  • Path: /WebCts2LE/service/crud/sparql/select
  • Method: GET
  • Path Parameters: -
  • Query Parameters: SPARQL select-query string
  • returns: query results according to https://www.w3.org/TR/rdf-sparql-XMLres/ but WITHOUT the head-element

Example Call

http://localhost:8080/WebCts2LE/service/crud/sparql/select?query=select%20?val%20where%20%7B%20?x%20:name%20?n.%20?x%20:designation%20?d.%20?d%20:designationRole%2

for uncoded query select ?val where { ?x :name ?n. ?x :designation ?d. ?d :designationRole 'PREFERRED'; :value ?val } limit 10

Example Response Structure
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <results>
    <result>
      <binding name="val">
        <literal>...</literal>
      </binding>
    </result>
    ...
  </results>
</sparql>