play-commons-constants.1.0.source-code.play-epsparql-contextualized-latitude-03-query.eprq Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of play-commons-constants Show documentation
Show all versions of play-commons-constants Show documentation
Some constants of important, shared values for the platform
PREFIX rdf:
PREFIX uctelco:
PREFIX geo:
PREFIX :
CONSTRUCT {
:e rdf:type :ContextualizedLatitudeEvent .
:e :stream .
:e :location [ geo:lat ?Latitude1; geo:long ?Longitude1 ] .
:e uctelco:phoneNumber ?bob .
:e uctelco:phoneNumber ?alice .
:e :message "Alice and Bob are close to a where someone tweeted." .
}
WHERE {
CONTEXT ?id1 {
?e1 rdf:type :TwitterEvent .
?e1 :endTime ?time .
?e1 :stream .
?e1 :screenName ?someone .
?e1 :location [ geo:lat ?Latitude1; geo:long ?Longitude1 ] .
}
FILTER ?time > (NOW() - xsd:duration("PT120M"))
WINDOW {
EVENT ?id2 {
?e2 rdf:type :UcTelcoGeoLocation .
?e2 :stream .
?e2 :location [ geo:lat ?Latitude2; geo:long ?Longitude2 ] .
?e2 uctelco:phoneNumber ?alice .
}
FILTER fn:abs(?Latitude1 - ?Latitude2) < 0.1 && fn:abs(?Longitude1 - ?Longitude2) < 0.5
SEQ
EVENT ?id3 {
?e3 rdf:type :UcTelcoGeoLocation .
?e3 :stream .
?e3 :location [ geo:lat ?Latitude3; geo:long ?Longitude3 ] .
?e3 uctelco:phoneNumber ?bob .
}
FILTER fn:abs(?Latitude2 - ?Latitude3) < 0.1 && fn:abs(?Longitude2 - ?Longitude3) < 0.5
&& ?alice != ?bob
} ("PT120M"^^xsd:duration, sliding)
}