Accessor: services/SemanticRepositoryQuery

services/SemanticRepositoryQuery

Perform a SPARQL query on a semantic repository such as GraphDB.

SPARQL is a W3C standard for querying semantic repositories, playing an analogous role to SQL with respect to relational databases. Semantic repositories fall within the domain of knowledge representation in AI and typically are implemented as a triplestore: entries in the repository have the form "subject", "predicate", "object" eg. "An Apple" "IsA" "Fruit"

An example SPARQL query to get a list of up to 100 triples in the repository:

select * where { ?s ?p ?o . } limit 100

Documentation for SPARQL and the SPARQL Protocol can be found at https://www.w3.org/TR/rdf-sparql-query/

Information on GraphDB can be found at http://graphdb.ontotext.com/

SPARQL is also a protocol for communicating with RDF databases Upon receiving a query input, this accessor performs an http GET to the specified server and port with the querystring "query" set to the query input. The JSON response from the semantic repository (if any) is sent to the response output. Depending on the query type, the response will be JSON "sparql-results" or "rdf+json"

This accessor does not block waiting for the response, but if any additional query input is received before a pending request has received a response or timed out, then the new request will be queued and sent out only after the pending request has completed. This strategy ensures that outputs are produced in the same order as the input requests.

Version:
  • $$Id: SemanticRepository.js 1725 2017-05-19 22:59:11Z cxh $$
Author:
  • Matt Weber
Source:
Inputs:
Name Type Description
query string The SPARQL query to be sent to the semantic repository. Types of queries yielding a response are: SELECT, CONSTRUCT, ASK, and DESCRIBE
Outputs:
Name Type Description
response An object containing the raw response from the service conforming to the SPARQL protocol. If the query type was SELECT or ASK the response will be JSON "sparql-results". If the query type was CONSTRUCT or DESCRIBE the response will be "rdf+json".
Parameters:
Name Type Description
protocol string Either http or https.
host string The URL for the semantic repository.
port string The port for the semantic repository.
repositoryName string The name of the particular repository on the host.
authenticate boolean If true, enable authentication to an access controlled semantic repository by sending username and password with request. If false, username and password information will not be sent. An error will occur if the http protocol is selected with a true authenticate setting to avoid sending username/password information in plain text.
username string A username for an access controlled semantic repository.
password string A password for an access controlled semantic repository.
timeout int The amount of time (in milliseconds) to wait for a response before triggering a null response and an error. This defaults to 20000.

Members

(inner) base64

Set up the accessor by defining the inputs and outputs.

Source: