Skip to content
Permalink
Browse files
Updates for revised SPARQL APIs
  • Loading branch information
afs committed Nov 15, 2021
1 parent 4292074 commit 98502db66446b725ddf4e6b97c8e618dc711dba4
Showing 21 changed files with 297 additions and 285 deletions.
@@ -9,3 +9,6 @@ target/
*.iml
.idea
.java-version

# Hugo
.hugo_build.lock
@@ -1,5 +1,9 @@
---
title: HTTP Authentication in ARQ
title: HTTP Authentication in ARQ (Superseded)
---

<i>Documentation for HTTP Authentication (Jena3.1.1 to Jena 4.2.0) using Apache Commons HttpClient.</i>

---

After [Jena 3.1.0](#http-authentication-from-jena-311), Jena exposes the underlying HTTP Commons functionality to support a range of authentication mechanisms as well as [other HTTP configuration][16]. From [Jena 3.0.0 through Jena 3.1.0](#http-authentication-from-jena-300-through-310) there is a Jena-specific framework that provides a uniform mechanism for HTTP authentication. This documentation is therefore divided into two sections. The first explains how to use HTTP Commons code, and the second explains the older Jena-specific functionality.
@@ -34,7 +34,7 @@ or read the dataset and see any updates made by remote systems:
// Read transaction.
Txn.execRead(dsg, ()->{
Dataset ds = DatasetFactory.wrap(dsg) ;
try (QueryExecution qExec = QueryExecutionFactory.create("SELECT * { ?s ?o}", ds) ) {
try (QueryExecution qExec = QueryExecution.create("SELECT * { ?s ?o}", ds) ) {
ResultSet rs = qExec.execSelect() ;
ResultSetFormatter.out(rs) ;
}
@@ -0,0 +1,13 @@
---
title: Security in Fuseki2 server
---
This page covers security for Fuseki Main.

See other [documentation](./fusek0-security.html) for the webapp packaging of Fuseki.

## Serving RDF

For any use of users-password information, and especially HTTP basic
authentication, information is visible in the HTTP headers. When serving RDF and SPARQL requests, using HTTPS is necessary to avoid snooping.
Digest authentication is also stronger over HTTPS
because it protects against man-in-the-middle attacks.
@@ -107,7 +107,7 @@ To query a Model with GeoSPARQL or standard SPARQL:
Model model = .....;
String query = ....;

try (QueryExecution qe = QueryExecutionFactory.create(query, model)) {
try (QueryExecution qe = QueryExecution.create(query, model)) {
ResultSet rs = qe.execSelect();
ResultSetFormatter.outputAsTSV(rs);
}
@@ -94,7 +94,7 @@ Once the default server is running it can be queried using Jena as follows:

String service = "http://localhost:3030/ds";
String query = ....;
try (QueryExecution qe = QueryExecutionFactory.sparqlService(service, query)) {
try (QueryExecution qe = QueryExecution.service(service).query(query).build()) {
ResultSet rs = qe.execSelect();
ResultSetFormatter.outputAsTSV(rs);
}
@@ -11,80 +11,80 @@ SPARQL is the query language developed by the W3C

## ARQ Features

- Standard SPARQL
- Free text search via Lucene
- SPARQL/Update
- Access and extension of the SPARQL algebra
- Support for custom filter functions, including javascript functions
- Property functions for custom processing of semantic
- Standard SPARQL
- Free text search via Lucene
- SPARQL/Update
- Access and extension of the SPARQL algebra
- Support for custom filter functions, including javascript functions
- Property functions for custom processing of semantic
relationships
- Aggregation, GROUP BY and assignment as SPARQL extensions
- Support for federated query
- Support for extension to other storage systems
- Client-support for remote access to any SPARQL endpoint
- Aggregation, GROUP BY and assignment as SPARQL extensions
- Support for federated query
- Support for extension to other storage systems
- Client-support for remote access to any SPARQL endpoint

## Introduction

- [A Brief Tutorial on SPARQL](/tutorials/sparql.html)
- [Application API](app_api.html) - covers the majority of
- [A Brief Tutorial on SPARQL](/tutorials/sparql.html)
- [Application API](app_api.html) - covers the majority of
application usages
- [Frequently Asked Questions](faq.html)
- [ARQ Support](support.html)
- Application [javadoc](/documentation/javadoc/arq/index.html)
- [Command line utilities](cmds.html)
- [Querying remote SPARQL services](sparql-remote.html)
- [HTTP Authentication for ARQ](http-auth.html)
- [Logging](logging.html)
- [Explaining queries](explain.html)
- [Tutorial: manipulating SPARQL using ARQ](manipulating_sparql_using_arq.html)
- [Basic federated query (`SERVICE`)](service.html)
- [Property paths](property_paths.html)
- [GROUP BY and counting](group-by.html)
- [SELECT expressions](select_expr.html)
- [Sub-SELECT](sub-select.html)
- [Negation](negation.html)
- [Frequently Asked Questions](faq.html)
- [ARQ Support](support.html)
- Application [javadoc](/documentation/javadoc/arq/index.html)
- [Command line utilities](cmds.html)
- [Querying remote SPARQL services](sparql-remote.html)
- [HTTP Authentication for ARQ](http-auth.html)
- [Logging](logging.html)
- [Explaining queries](explain.html)
- [Tutorial: manipulating SPARQL using ARQ](manipulating_sparql_using_arq.html)
- [Basic federated query (`SERVICE`)](service.html)
- [Property paths](property_paths.html)
- [GROUP BY and counting](group-by.html)
- [SELECT expressions](select_expr.html)
- [Sub-SELECT](sub-select.html)
- [Negation](negation.html)

Features of ARQ that are legal SPARQL syntax

- [Conditions in FILTERs](function_forms.html)

- [Free text searches](text-query.html)
- [Accessing lists](rdf_lists.html) (RDF collections)
- [Extension mechanisms](extension.html)
- [Custom Expression Functions](extension.html#valueFunctions)
- [Property Functions](extension.html#property-functions)
- Library
- [Expression function library](library-function.html)
- [Property function library](library-propfunc.html)
- [Writing SPARQL functions](writing_functions.html)
- [Writing SPARQL functions in JavaScript](javascript-functions.html)
- [Constructing queries programmatically](programmatic.html)
- [Parameterized query strings](parameterized-sparql-strings.html)
- [ARQ and the SPARQL algebra](algebra.html)
- [Extending ARQ query execution and accessing different storage implementations](arq-query-eval.html)
- [Custom aggregates](custom_aggregates.html)
- [Conditions in FILTERs](function_forms.html)

- [Free text searches](text-query.html)
- [Accessing lists](rdf_lists.html) (RDF collections)
- [Extension mechanisms](extension.html)
- [Custom Expression Functions](extension.html#valueFunctions)
- [Property Functions](extension.html#property-functions)
- Library
- [Expression function library](library-function.html)
- [Property function library](library-propfunc.html)
- [Writing SPARQL functions](writing_functions.html)
- [Writing SPARQL functions in JavaScript](javascript-functions.html)
- [Constructing queries programmatically](programmatic.html)
- [Parameterized query strings](parameterized-sparql-strings.html)
- [ARQ and the SPARQL algebra](algebra.html)
- [Extending ARQ query execution and accessing different storage implementations](arq-query-eval.html)
- [Custom aggregates](custom_aggregates.html)

## Extensions

Feature of ARQ that go beyond SPARQL syntax. The default query
language is standard SPARQL. These features require the query to be
parsed with an explicit declaration of `Syntax.syntaxARQ`.

- [RDF-star](https://w3c.github.io/rdf-star/)
- Operators and functions
- [RDF-star](https://w3c.github.io/rdf-star/)
- Operators and functions
`[MOD](https://www.w3.org/TR/xpath-functions/#func-numeric-mod)`
and `[IDIV](https://www.w3.org/TR/xpath-functions/#func-numeric-integer-divide)` for modulus and integer division.
- [LET variable assignment](assignment.html)
- [Order results using a Collation](collation.html)
- [Construct Quad](construct-quad.html)
- [Generate JSON from SPARQL](generate-json-from-sparql.html)
- [LET variable assignment](assignment.html)
- [Order results using a Collation](collation.html)
- [Construct Quad](construct-quad.html)
- [Generate JSON from SPARQL](generate-json-from-sparql.html)

## Update

ARQ supports the W3C standard SPARQL Update language.

- [SPARQL Update](http://www.w3.org/TR/sparql11-update/)
- [The ARQ SPARQL/Update API](update.html)
- [SPARQL Update](http://www.w3.org/TR/sparql11-update/)
- [The ARQ SPARQL/Update API](update.html)

## See Also

@@ -94,30 +94,29 @@ ARQ supports the W3C standard SPARQL Update language.

## W3C Documents

- [SPARQL Query Language specification](http://www.w3.org/TR/sparql11-query/)
- [SPARQL Query Results JSON Format](https://www.w3.org/TR/sparql11-results-json/)
- [SPARQL Protocol](http://www.w3.org/TR/rdf-sparql-protocol/)
- [SPARQL Query Language specification](http://www.w3.org/TR/sparql11-query/)
- [SPARQL Query Results JSON Format](https://www.w3.org/TR/sparql11-results-json/)
- [SPARQL Protocol](http://www.w3.org/TR/rdf-sparql-protocol/)

## Articles

Articles and documentation elsewhere:

- [Introducing SPARQL: Querying the Semantic Web](http://xml.com/lpt/a/2005/11/16/introducing-sparql-querying-semantic-web-tutorial.html)
- [Introducing SPARQL: Querying the Semantic Web](http://xml.com/lpt/a/2005/11/16/introducing-sparql-querying-semantic-web-tutorial.html)
([xml.com](http://www.xml.com/) article by Leigh Dodds)
- [Search RDF data with SPARQL](http://www.ibm.com/developerworks/xml/library/j-sparql/)
- [Search RDF data with SPARQL](http://www.ibm.com/developerworks/xml/library/j-sparql/)
(by Phil McCarthy) - article published on IBM developer works about
SPARQL and Jena.
- [SPARQL reference card](http://www.dajobe.org/2005/04-sparql/)
- [SPARQL reference card](http://www.dajobe.org/2005/04-sparql/)
(by [Dave Beckett](http://www.dajobe.org/))
- [Parameterised Queries with SPARQL and ARQ](http://www.ldodds.com/blog/archives/000251.html)
- [Parameterised Queries with SPARQL and ARQ](http://www.ldodds.com/blog/archives/000251.html)
(by Leigh Dodds)
- [Writing an ARQ Extension Function](http://www.ldodds.com/blog/archives/000252.html)
- [Writing an ARQ Extension Function](http://www.ldodds.com/blog/archives/000252.html)
(by Leigh Dodds)

## RDF Syntax Specifications

- [Turtle](https://www.w3.org/TR/turtle/)
- [N-Triples](https://www.w3.org/TR/n-triples)
- [TriG](https://www.w3.org/TR/trig/)
- [N-Quads](https://www.w3.org/TR/n-quads/)

- [Turtle](https://www.w3.org/TR/turtle/)
- [N-Triples](https://www.w3.org/TR/n-triples)
- [TriG](https://www.w3.org/TR/trig/)
- [N-Quads](https://www.w3.org/TR/n-quads/)
@@ -182,8 +182,8 @@ The steps from algebra generation to query evaluation are carried
out when a query is executed via the `QueryExecution.execSelect` or
other `QueryExecution` exec operation. It is possible to carry out
storage-specific operations when the query execution is created. A
query engine works in conjunction with a `QueryExecution` created
by the `QueryExecutionFactory` to provide the evaluation of a query
query engine works in conjunction with a `QueryExecution`
to provide the evaluation of a query
pattern. `QueryExecutionBase` provides all the machinery for the
different result types and does not need to be modified by
extensions to query execution.
@@ -490,8 +490,7 @@ While it is possible to replace the entire process of query
evaluation, this is a substantial endeavour. `QueryExecutionBase`
provides the machinery for result presentation (`SELECT`,
`CONSTRUCT`, `DESCRIBE`, `ASK`), leaving the work of pattern
evaluation to the custom query engine. `QueryExecutionFactory`
assumes that `QueryExecutionBase` will be used.
evaluation to the custom query engine.

## Algebra Extensions

@@ -119,7 +119,7 @@ previous sections, e.g.

String queryString = " CONSTRUCT { GRAPH <http://example/ns#g1> {?s ?p ?o} } WHERE {?s ?p ?o}" ;
Query query = QueryFactory.create(queryString, Syntax.syntaxARQ);
try ( QueryExecution qExec = QueryExecutionFactory.sparqlService(serviceQuery, query) ) { // serviceQuery is the URL of the remote service
try ( QueryExecution qExec = QueryExecution.service(serviceQuery).query(query).build() ) { // serviceQuery is the URL of the remote service
Iterator<Quad> result = qExec.execConstructQuads();
...
}
@@ -74,8 +74,7 @@ globally:
and it may also be set on an individual query execution using its local
context.

try(QueryExecution qExec = QueryExecutionFactory.create(...)) {
qExec.getContext().set(ARQ.symLogExec, Explain.InfoLevel.ALL) ;
try(QueryExecution qExec = QueryExecution.create() ... .set(ARQ.symLogExec, Explain.InfoLevel.ALL).build() ) {
ResultSet rs = qExec.execSelect() ;
...
}
@@ -96,8 +96,7 @@ globally:
and it may also be set on an individual query execution using its local
context.

try(QueryExecution qExec = QueryExecutionFactory.create(...)) {
qExec.getContext().set(ARQ.symLogExec, Explain.InfoLevel.ALL) ;
try(QueryExecution qExec = QueryExecution.create()... .set(ARQ.symLogExec, Explain.InfoLevel.ALL).build) {
...
}

@@ -5,8 +5,7 @@ title: ARQ - Querying Remote SPARQL Services
SPARQL is a
[query language](http://www.w3.org/TR/sparql11-query/) and a
[remote access protocol](http://www.w3.org/2001/sw/DataAccess/proto-wd/).
The remote access protocol can be used with plain HTTP or over
[SOAP](http://www.w3.org/TR/soap12-part0/).
The remote access protocol runs over HTTP.

See [Fuseki](../fuseki2/index.html) for an implementation of the
SPARQL protocol over HTTP. Fuseki uses ARQ to provide SPARQL
@@ -16,12 +15,9 @@ ARQ includes a query engine capable of using the HTTP version.

## From your application

The `QueryExecutionFactory` has methods for creating a
`QueryExecution` object for remote use.
`QueryExecutionFactory.sparqlService`

These methods build a query execution object that uses the query
engine in `org.apache.jena.sparql.engine.http`.
The `QueryExecutionHTTP` has methods for creating a
`QueryExecution` object for remote use. There are various
HTTP specific settings; the default should work in most cases.

The remote request is made when the `execSelect`, `execConstruct`,
`execDescribe` or `execAsk` method is called.
@@ -43,7 +39,7 @@ sending.

## Authentication

ARQ provides a flexible API for authenticating against remote services, see the [HTTP Authentication](http-auth.html) documentation for more details.
ARQ provides a flexible API for authenticating against remote services, see the [HTTP Authentication](../sparql-apis/http-auth.html) documentation for more details.

## Firewalls and Proxies

0 comments on commit 98502db

Please sign in to comment.