In [1]:
from rsplib.processing import RSPSource, StreamReasoner
In [2]:
jasper = StreamReasoner("http://jasper", 8182);
jasper.status()
Out[2]:
In [3]:
with open('rdfs.rules.txt', 'r') as rule_file:
rdfs=rule_file.read()
rdfs
Out[3]:
In [4]:
jasper.register_rules("rdfs", rdfs)
Out[4]:
In [5]:
jasper.rules()
Out[5]:
In [6]:
jasper.register_stream("AarhusTrafficData158505", "http://aarhustrafficdata158505:4001/sgraph")
Out[6]:
In [7]:
with open('q3.rspql.txt', 'r') as rspql_query:
body = rspql_query.read()
print(body)
In [8]:
tbox = "https://raw.githubusercontent.com/streamreasoning/rsplab/tutorial/collector/lab/streamapp/tbox.rdf"
In [9]:
jasper.register_query("unionstrm", "STREAM", body, "rdfs", tbox)
Out[9]:
In [10]:
jasper.register_observer("unionstrm", "default", {"host":"localhost","type":"ws","port":9103,"name":"default"})
Out[10]:
In [ ]: