Skip to content

Commit

Permalink
Merge pull request #4 from jpcik/patch-1
Browse files Browse the repository at this point in the history
Update Example_of_RSP-QL_query
  • Loading branch information
emanueledellavalle committed Nov 27, 2014
2 parents d54444b + 6b7e51c commit 5aa7c44
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Example_of_RSP-QL_query
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ As output, for each bar, it streams out an RDF graph with the list of pairs and
Note that this example query covers features of C-SPARQL, CQELS, SPARQL-Stream, EP-SPARQL as well as new features missing in all RSP languages:

From C-SPARQL it takes the REGISTER clause, the FROM STREAM clause as dataset clause, the AT clause to access the timestamp (in C-SPARQL, AT is implemented with the timestamp() function) and the aggregates (which are computed in parallel without shrinking the result set, but extending it).
# so what is the AT time function doing? where is that timestamp coming from?
From CQELS it takes the idea of the STREAM keyword in the WHERE clause.
From SPARQL-Stream it takes the ISTREAM clasue that ask the RSP engine to use the R2S operator.

Expand All @@ -27,6 +28,14 @@ The new features are:
the WINDOW keyword in the WHERE clause
--> is there any shorter way to express this? for instance, just STREAM keyword inside WHERE?

# this looks a bit different than sparql in terms of order of query blocks, would it harm to make it something like:
# PREFIX ...
# CONSTRUCT ISTREAM { ...etc
# FROM ....
# WHERE { ...
# AS :GallehaultWasTheBar
# UNDER ENTAILMENT xxx...

PREFIX e: <http://somevocabulary.org/>
PREFIX s: <http://someinvasivesensornetwork.org/streams#>
PREFIX g: <http://somesocialnetwork.org/graphs#>
Expand All @@ -51,12 +60,15 @@ WHERE {
SEQ
{ ?someoneelse ex:enters ?poi } WITHIN PT4H
}
# is this equivalent to : ?
# STREAM s:1 [RANGE PT1H STEP PT5M] {
WINDOW :longWindow {
{ ?somebody e:isCloseTo ?someoneelse
MINUS { ?somebody e:isCloseTo ?yetanotherone . FILTER (?yetanotherone != ?someoneelse) }
} WITH DURATION ?longtime
FILTER (?longtime>"PT30M"^^xsd:duration)
}
# not sure if we need both WITHIN and WITH DURATION+FILTER
WINDOW :shortWindow {
{ ?somebody e:exits ?bar} AT ?t1
{ ?someoneelse e:exits ?bar } AT ?t2
Expand All @@ -72,3 +84,4 @@ AGGREGATE {
COUNT(?somebody) AS ?howmanycouples
}

#are we creating a different type of aggregate syntax? i.e. not the one from SPARQL1.1? ok, for the construct you need something else, but could it be done with a subquery right?

0 comments on commit 5aa7c44

Please sign in to comment.