Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Example_of_RSP-QL_query #4

Merged
merged 1 commit into from
Nov 27, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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?