Skip to content

Streaming MASSIF Prototypes

Pieter Bonte edited this page Mar 24, 2021 · 8 revisions

Info

Streaming MASSIF Prototypes allows to easily create RDF Stream Processing (RSP) and Stream Reasoning (SR) applications. The GUI can be accessed on HTTP://localhost:90000/.

Demo Use Case

To demonstrate the features of Streaming MASSIF Prototypes we build an RSP application step-by-step that loads a traffic data stream from the City Bench benchmark. We will investigate the intermediate results to verify the various processing steps.

GOAL: detect when traffic is increasing from a high traffic count to a very high traffic count.

Demo step:

  1. Define a Source to read the traffic stream (we will read it from file with a timeout of 1 second between events).
  2. Investigate the data in the stream.
  3. Map the data to the semantic model (we will use the SSN ontology).
  4. As we are only interested in high to very high vehicle counts, we want to filter out any event that is not a vehicle count event and has a count below 10.
  5. We want to abstract the high and very high vehicle count observations.
  6. These abstractions can then be used to detect temporal patterns.

Demo Video

Demo video

Try it yourself

Start Streaming MASSIF and go to HTTP://localhost:90000/. You can start building your own processing graph or load the minimal configuration below by clicking the Load button on top and copy the configuration into the text window.

{
   "configuration":{
      "0":[
         "1"
      ],
      "1":[
         "2"
      ],
      "2":[
         "3"
      ],
      "3":[
         "4"
      ],
      "4":[
         
      ]
   },
   "components":{
      "0":{
         "type":"Source",
         "impl":"fileSource",
         "fileName":"examples/citybench/AarhusTrafficData182955.stream",
         "timeout":1000
      },
      "1":{
         "type":"Mapper",
         "keepHeader":true,
         "mapping":"@prefix xsd: <http://www.w3.org/2001/XMLSchema#>. \n@prefix : <http://massif/>. \n@prefix ssn: <http://purl.oclc.org/NET/ssnx/ssn#>. \n@prefix ct: <http://www.insight-centre.org/citytraffic#>.\n@prefix ses: <http://www.insight-centre.org/dataset/SampleEventService#>.\n@prefix mas: <http://massif.streaming/ontologies/rsplab/officerepository.owl#>. \n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. \n@prefix owl: <http://www.w3.org/2002/07/owl#>.\nct:hasValue rdf:type owl:DatatypeProperty .\nssn:observedProperty rdf:type owl:ObjectProperty .\nssn:observedBy rdf:type owl:ObjectProperty .\nmas:hasDiscreteValue rdf:type owl:ObjectProperty .\n:?_id a ssn:Observation ; :eventTime \"?TIMESTAMP\"^^xsd:dateTime ; ct:hasValue \"?vehicleCount\"^^xsd:int; ; ssn:observedProperty ses:vehicleCount ; ssn:observedBy ses:AarhusTrafficData186979 .\nses:vehicleCount a ct:CongestionLevel. "
      },
      "2":{
         "type":"window",
         "size":10,
         "slide":1
      },
      "3":{
         "type":"Filter",
         "impl":"jena",
         "ontology":"",
         "queries":[
            "PREFIX ct: <http://www.insight-centre.org/citytraffic#>\n\nSelect (AVG(?val) AS ?avg) WHERE{\n ?obs ct:hasValue ?val \n}"
         ]
      },
      "4":{
         "type":"Sink",
         "impl":"httpGetSinkCombined",
         "path":"5",
         "config":""
      }
   }
}
Clone this wiki locally