Code Monkey home page Code Monkey logo

rsp4j's Introduction

RDF Stream Processing for Java (RSP4J) Alt text

DOI

RSP4J is a library to build RDF Stream Processing (RSP) Engines according with the reference model RSP-QL 1.

RSP4J is inspired by the OWL API, and other work that aim at spreading the Semantic Web (Stream Reasoning) research by means of practical and usable software tools.

In this repository, the following projects are present:

  • API, which contains the interfaces and abstractions required to develop your RSP engine.
  • yasper, which is an reference implementation that aims at showing the API usage by providing org.streamreasoning.rsp4j.yasper.examples.

Futher adoption of YASPER will be listed below.

A on-going documentation is also available.

RSP4J and YASPER are open and ongoing projects. Welcome adoption as well as suggestion or request.

Install Using Maven

 <repositories>
   <repository>
    <id>jitpack.io</id>
       <url>https://jitpack.io</url>
   </repository>

<dependency>
  <groupId>com.github.streamreasoning.rsp4j</groupId>
  <artifactId>api</artifactId>
   <version>1.0.0</version>
</dependency>
  
and 
  
<dependency>
  <groupId>com.github.streamreasoning.rsp4j</groupId>
  <artifactId>yasper</artifactId>
   <version>1.0.0</version>
</dependency>

rsp4j's People

Contributors

fpboldin avatar kabulkurniawan avatar keski avatar pbonte avatar phisco avatar riccardotommasini avatar semlanghi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rsp4j's Issues

SDS creation by query

Make sure parsed queries with dataset clause create SDS themselves, while queries missing the clause require the registration of the SDS manually in the Taskbuilder.

Missing artifact it.polimi.sr.rsp:api:jar:1.0.0

Hello!

I am trying to install RSP4J using Eclipse Maven project. As soon as I add the dependency to com.github.streamreasoning.rsp4j:yasper:1.0.0 using Maven --> Add Dependency dialog I get the following error message in the pom file: Missing artifact it.polimi.sr.rsp:api:jar:1.0.0
(I have the jitpack.io repository already added. Additionally, I could not find this library anywhere.)

Many thanks in advance for the help.

Valentina

Exception when trying to use CSPARQLEngineRSP4J with Jena related objects

In RSP4J, when I try to use CSPARQLEngineRSP4J with Jena related objects (for example, JenaRDFParsingStrategy), I get below exception.

Exception in thread "main" java.lang.NoSuchMethodError: 'java.lang.Object org.apache.jena.atlas.lib.Cache.getIfPresent(java.lang.Object)'

Code fragment :

CSPARQLEngineRSP4J csparql = new CSPARQLEngineRSP4J();

JenaRDFParsingStrategy parsingStrategy = new JenaRDFParsingStrategy(RDFBase.TTL);

String filePath = "stream.log";
FileSource fileSource = new FileSource(filePath, 100, parsingStrategy);
csparql.register(fileSource);

DataStream outputStream = new DataStreamImpl<>("http://out/stream");
csparql.setSelectOutput(outputStream);

ContinuousQuery<Graph, Graph, Binding, Binding> cq = csparql.parseCSPARQLSelect(some_query);
ContinuousQueryExecution<Graph, Graph, Binding, Binding> cqe = csparql.parseSelect(cq);

fileSource.stream();

Note that CQELSEngineRSP4J works fine with Jena related objects in RSP4J.

Task List

Pending tasks for RSP4J:

  • Task abstractions
  • Publication abstraction
  • Mapping support
  • RSP-QL query loading
  • Window generalization
  • Stateless functions (map, filter,..)
  • Remove observer pattern
  • Write javadoc
  • Update wiki
  • Write Tests

Exception when streaming triple having data value as double

In RSP4J when we stream triple having data value as double, as shown below, we get an exception.
Please note that we observe this exception when the data value is part of the select query result.

Query:
SELECT ?s ?p ?o
from stream http://test/stream [RANGE 10s STEP 1s]
WHERE {
?s ?p ?o
}

Relevant code fragment :
graph.add(instance.createTriple(instance.createIRI("http://test#S1"), instance.createIRI("http://test#hasValue"), rdf.createLiteral("56.1519", Types.XSD_DOUBLE)));
OR
graph.add(instance.createTriple(instance.createIRI("http://test#S1"), instance.createIRI("http://test#hasValue"), rdf.createLiteral("56.1519", instance.createIRI("http://www.w3.org/2001/XMLSchema#double"))));

Exception:
[com.espertech.esper.Timer-default-1] ERROR com.espertech.esper.core.StatementResultServiceImpl - Unexpected exception invoking listener update method on listener class 'QueryListener' : IllegalArgumentException : Illegal character in path at index 0: "56.1519"^^null
java.lang.IllegalArgumentException: Illegal character in path at index 0: "56.1519"^^null
at java.base/java.net.URI.create(URI.java:906)
at org.apache.commons.rdf.simple.IRIImpl.(IRIImpl.java:33)
at org.apache.commons.rdf.simple.SimpleRDF.createIRI(SimpleRDF.java:82)
at org.streamreasoning.rsp4j.api.RDFUtils.createIRI(RDFUtils.java:48)
at org.streamreasoning.rsp4j.csparql.CSPARQLEngineRSP4J$WrappedSelectListener.update(CSPARQLEngineRSP4J.java:120)

As debugging showed, the problem seems to be in repository/com/github/pbonte/CSPARQL-engine/csparql-sparql-jena/0.9.5.1-pomfix/csparql-sparql-jena-0.9.5.1-pomfix.jar!/eu/larkc/csparql/sparql/jena/JenaEngine.class in evaluateQuery function that is called by repository/com/github/pbonte/CSPARQL-engine/csparql-core/0.9.5.1-pomfix/csparql-core-0.9.5.1-pomfix.jar!/eu/larkc/csparql/core/engine/CsparqlEngineImpl.class in update function on line 437 (RDFTable result = this.sparqlEngine.evaluateQuery(csparqlquery.getSparqlQuery());)

How to execute query over data source using Csparql2 in RSP4J

In Csparql 1.0, we execute query over data source (static knowledge) as below:

String generalQuery = "SELECT ?val FROM http://localhost:8080/csparql_web_server/demo.rdf "
+ "WHERE {" + rdf.createIRI("http://test#Person") + " " + rdf.createIRI("http://test#hasBrother") + " ?val }";

String updateQuery = "PREFIX : http://www.streamreasoning.org/ontologies/sr4ld2014-onto# "
+ "INSERT DATA "
+ "{ GRAPH http://streamreasoning.org/roomConnection { :room :isConnectedTo :room2 } }";

RDFTable queryResult = engine.evaluateGeneralQueryOverDatasource(generalQuery);
engine.execUpdateQueryOverDatasource(updateQuery);

How do we do similar to above using CSparql 2.0 in RSP4J?

Support of GeoSPARQL

Hi,

We have a use case where we use geospatial coordinates and as such I was wondering if you support functions like those of GeoSPARQL (the basic SPARQL engine is not designed to calculate trigonometric functions)?

If not, it seems that you are working with JENA and maybe this module could be not too difficult to integrate:
https://jena.apache.org/documentation/geosparql/index.html

Best,

Test IO packages

The UnitTests in the IO packages are forced to time out in the automated build. They should be retaught.

Remove Strings from Task API

Currently, Task API uses strings to refer to operator names, but it is very error prone

transform this

   TaskAbstractionImpl<Graph, Graph, Binding, Binding> t =
            new TaskAbstractionImpl.TaskBuilder(prefixes)
                    .addS2R(":observations", w1, "window1")
                    .addS2R(":tracing", w2, "window2")
                    .addR2R("window1", bgp)
                    .addR2R("window2", bgp2)
                    .addR2S("out", new Rstream<Binding, Binding>())
                    .addProjectionStrings(List.of("?s","?o","?s2"))
                    .build();

into this

TaskAbstractionImpl<Graph, Graph, Binding, Binding> t =
            new TaskAbstractionImpl.TaskBuilder(prefixes)
                    .addS2R(observationStream, w1)
                    .addS2R(outStream, w2)
                    .addR2R(w1, bgp)
                    .addR2R(w2, bgp2)
                    .addR2S(outStream, new Rstream<Binding, Binding>())
                    .addProjectionStrings(List.of("?s","?o","?s2"))
                    .build();

Ticker should be brought outside the window operator

Currently, in the windowing operator, the tick is used after the report. According to SECRET semantics, tick should define when an operator acts on its input. Thus, the ticker must be brought out of the Windowing operator, and be used to regulate the operator's execution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.