Created
October 29, 2012 12:41
-
-
Save chamerling/3973301 to your computer and use it in GitHub Desktop.
Dispatcher Analyse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # $Revision: 34045 $ | |
| # $Id: play-epsparql-m12-jeans-example-query.eprq 34045 2012-10-08 16:54:48Z stuehmer $ | |
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
| PREFIX user: <http://graph.facebook.com/schema/user#> | |
| PREFIX s: <http://streams.event-processing.org/ids/> | |
| PREFIX : <http://events.event-processing.org/types/> | |
| CONSTRUCT { | |
| :e rdf:type :FacebookCepResult . | |
| :e :stream <http://streams.event-processing.org/ids/FacebookCepResults#stream> . | |
| :e user:name ?friend1 . | |
| } | |
| WHERE { | |
| WINDOW { | |
| EVENT ?id1 { | |
| ?e1 rdf:type :FacebookStatusFeedEvent . | |
| ?e1 :stream <http://streams.event-processing.org/ids/FacebookStatusFeed#stream> . | |
| ?e1 :status ?about1 . | |
| ?e1 user:name ?friend1 . | |
| } | |
| FILTER contains(?about1, "JEANS") | |
| SEQ | |
| EVENT ?id2 { | |
| ?e2 rdf:type :FacebookStatusFeedEvent . | |
| ?e2 :stream <http://streams.event-processing.org/ids/FacebookStatusFeed#stream> . | |
| ?e2 :status ?about2 . | |
| ?e2 user:name ?friend2 . | |
| } | |
| FILTER contains(?about2, "JEANS") | |
| SEQ | |
| EVENT ?id3 { | |
| ?e3 rdf:type :FacebookStatusFeedEvent . | |
| ?e3 :stream <http://streams.event-processing.org/ids/FacebookStatusFeed#stream> . | |
| ?e3 :status ?about3 . | |
| ?e3 user:name ?friend3 . | |
| } | |
| FILTER contains(?about3, "JEANS") | |
| } ("PT30M"^^xsd:duration, sliding) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| File f = new File(ComplexPatternServiceImplTest.class.getResource("/fb.txt").toURI()); | |
| String pattern = FileUtils.readFileToString(f); | |
| System.out.println(pattern); | |
| //service.getTopics("http://facebook.com/foo#stream", pattern); | |
| QName serviceName = new QName("http://play_platformservices.play_project.eu/", "QueryDispatchApi"); | |
| Service s = Service.create(new URL("http://demo.play-project.eu:8084/play/QueryDispatchApi?wsdl"), serviceName); | |
| QueryDispatchApi queryDispatchApi = s.getPort(QueryDispatchApi.class); | |
| try { | |
| QueryDetails qd = queryDispatchApi.analyseQuery("http://patterns.event-processing.org/ids/webapp_" + Math.random(), pattern); | |
| System.out.println(qd); | |
| } catch (Exception e) { | |
| e.printStackTrace(); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results :
INPUT [http://streams.event-processing.org/ids/FacebookStatusFeed, http://streams.event-processing.org/ids/FacebookStatusFeed, http://streams.event-processing.org/ids/FacebookStatusFeed]
OUTPUT http://streams.event-processing.org/ids/FacebookCepResults