A connector proxying sparql over HTTP to the gRPC federated graph of an IOTICS network.
Build with
mvn clean package
java -jar iotics-sparql-http-<version>.jar
The following variables are either read from the environment or via program arguments. Environment values will always be preferred if not null.
Property | default | optional | description |
---|---|---|---|
HOST_DNS | n/a | yes | the DNS of the host where to forward gRPC requests to. If omitted, the host will be taken via the X-IOTICS-HOST |
PORT | 8080 | yes | port where the porxy http listener is deployed |
TOKEN | n/a | yes | a valid token passed on by the proxy in lieu of the one extracted via the Authorization header. The latter will always override this value. |
Example:
java -jar iotics-sparql-http-<version>.jar HOST_DNS=myhost.iotics.space PORT=80
To run the integration tests(manually, from within the IDE), you need to create an .env file with the following content
PORT=<the port where the HTTP endpoint is listening>
HOST_DNS=<the host DNS where to forward the gRPC requests>
RESOLVER_URL=<the resolver used to manage identities (find it at https://{HOST_DNS}/index.json)>
SEED=<a valid identity seed>
The proxy should implement most of https://www.w3.org/TR/sparql11-protocol/ for SELECT
.
The following endpoints are supported for GET and POST
Endpoint | description |
---|---|
/sparql/local |
for requests scoped to the local IOTICSpace only |
/sparql |
for requests scoped to the network |
Authorization: Bearer <token>
Accept: application/sparql-results+json
for an unencoded body
Content-Type: application/sparql-query
for a form encoded query in the body
Content-Type: application/x-www-form-urlencoded
X-IOTICS-HOST: <host DNS>
Assuming the proxy is deployed on localhost:8080
GET /sparql/local?query=<urlencoded query> HTTP/1.1
Host: localhost
Accept: application/sparql-results+json
Authorization: Bearer eyJhbG...sjc4Q_Q
POST /sparql/local HTTP/1.1
Host: localhost
Accept: application/sparql-results+json
Authorization: Bearer eyJhbG...sjc4Q_Q
Content-Type: application/sparql-query
<query>
- No support for
default-graph-uri
andnamed-graph-uri
- No support for CORS and OPTION (pre-flight requests)