com.weblyzard.sparql:streaming-sparql

Cross-server SPARQL query library with support for incremental, streaming result processing.

License

License

GroupId

GroupId

com.weblyzard.sparql
ArtifactId

ArtifactId

streaming-sparql
Last Version

Last Version

0.0.7.2
Release Date

Release Date

Type

Type

jar
Description

Description

Cross-server SPARQL query library with support for incremental, streaming result processing.
Project Organization

Project Organization

webLyzard technology
Source Code Management

Source Code Management

https://github.com/weblyzard/streaming-sparql/tree/master/streaming-sparql

Download streaming-sparql

How to add to project

<!-- https://jarcasting.com/artifacts/com.weblyzard.sparql/streaming-sparql/ -->
<dependency>
    <groupId>com.weblyzard.sparql</groupId>
    <artifactId>streaming-sparql</artifactId>
    <version>0.0.7.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.weblyzard.sparql/streaming-sparql/
implementation 'com.weblyzard.sparql:streaming-sparql:0.0.7.2'
// https://jarcasting.com/artifacts/com.weblyzard.sparql/streaming-sparql/
implementation ("com.weblyzard.sparql:streaming-sparql:0.0.7.2")
'com.weblyzard.sparql:streaming-sparql:jar:0.0.7.2'
<dependency org="com.weblyzard.sparql" name="streaming-sparql" rev="0.0.7.2">
  <artifact name="streaming-sparql" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.weblyzard.sparql', module='streaming-sparql', version='0.0.7.2')
)
libraryDependencies += "com.weblyzard.sparql" % "streaming-sparql" % "0.0.7.2"
[com.weblyzard.sparql/streaming-sparql "0.0.7.2"]

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.jena : jena-arq jar 3.10.0
org.slf4j : slf4j-api jar 1.7.25

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.8

test (5)

Group / Artifact Type Version
com.google.guava : guava jar 30.1.1-jre
com.google.code.gson : gson jar 2.8.5
junit : junit jar 4.13.1
io.github.stephenc.docker : junit-docker-rule jar 0.5.2
org.apache.logging.log4j : log4j-slf4j-impl jar 2.11.1

Project Modules

There are no modules declared in this project.

Streaming SPARQL

Build Status

Provides a robust, incremental processing of streaming results received from SPARQL servers. The StreamingResultSet iterator yields results as they are received from the server.

Javadoc

http://javadoc.io/doc/com.weblyzard.sparql/streaming-sparql/

Example code:

try (StreamingResultSet s = StreamingQueryExecutor.getResultSet("http://dbpedia.org/sparql", "SELECT ?s ?p ?o WHERE { ?s ?p ?o. } LIMIT 5")) {
    while (s.hasNext()) {
        System.out.println("Tupel " + s.getRowNumber() + ": " + s.next())
    }
}

Command line client

Streaming SPARQL also provides a command line client for testing queries.

Usage

java -jar ./streaming-client-0.0.7-SNAPSHOT.jar
QueryEntitites [URL] [Query]
  URL   ... URL to the linked data repository
  Query ... The query to perform on the server

Example

java -jar ./streaming-client-0.0.7-SNAPSHOT.jar http://localhost:8080/rdf4j-sesame/test "SELECT ?s ?p ?o WHERE { ?s ?p ?o. } LIMIT 5"

Background

We have been using Fuseki and RDF4j together with comprehensive result sets (> 100 Mio. tuple) which lead to instabilities with the native libraries that have been extremely difficult to debug.

Example error messages on the server site have been:

[2017-05-04 19:50:14] Fuseki     WARN  [1450] Runtime IO Exception (client left?) RC = 500 : org.eclipse.jetty.io.EofException      
org.apache.jena.atlas.RuntimeIOException: org.eclipse.jetty.io.EofException                                                         
[2017-05-04 19:50:14] Fuseki    WARN  (HttpChannel.java:468) (and one from ServletHandler.java:631):
java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 30001/30000 m

These problems triggered the development of Streaming SPARQL which has proven to be very robust - even for queries that take more than one hour to process and transfer multiple gigabytes of results. (Note: you will need to call getResultSet with a higher timeout to prevent TimeoutExceptions on the server).

Compatiblity

Streaming SPARQL is known to work with Jena, OpenRDF, RDF4j and Virtuoso.

Changelog

Please refer to the release page.

com.weblyzard.sparql

webLyzard technology

Versions

Version
0.0.7.2
0.0.7.1
0.0.7
0.0.3
0.0.2