Requires Java JDK 8 and maven 3.3. Refer to the following links to install these:
- http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- https://maven.apache.org/download.cgi
This project depends on version 0.9.7 of C-Sparql which is published for Maven at the time of writing (see streamreasoning/CSPARQL-engine#14), so you need to compile and install this locally:
cd ..
git clone https://github.com/streamreasoning/CSPARQL-engine.git
cd CSPARQL-engine
mvn install
cd ../FoodSafety
All data and configuration must reside in the config
directory. To get started, copy the example configuration:
cp -r config-example/ config
Now add/remove/update files to reflect your configuration. The structure is like this:
config/
|-- iotstreams/ Configuration for the reuseable IotStreams engine
| |-- <any name> Set up one C-SPARQL query along with the associated provenance inference
| | |-- csparql-query.rq Query for C-SPARQL
| | |-- init.ttl Ontology to initialize models with
| | |-- coldstart/
| | | |-- <any name>.rq SPARQL update to execute when no previous provenance is present
| | | |-- <any name>.rq ... any number of these ...
| | |-- warm/
| | |-- <any name>.rq SPARQL update to execute when previous provenance is present
| | |-- <any name>.rq ... any number of these ...
| |
| |-- <any name> ... any number of these ...
|-- simulator/ Configuration for the simulator used in the paper
|-- input.json.txt JSON file defining "from", "to" and "wirelessTagId"
|-- annotations.json.txt JSON files defining manual FOI annotations
|-- meatprobe/ Directory for meat probe data files
|-- <any filename> Contains data lines generated by the meat probe
|-- <any filename> ... any number of these ...
Finally, set yor wireless tag credentials in the command-line environment:
export WTCRED="[email protected] mypassword" # credentials for wirelesstag.net - no space allowed in the password
mvn clean package
mvn package && java -jar target/iotstreams-jar-with-dependencies.jar
If you would like to edit this project in Eclipse, we recommend you create a project file before starting Eclipse, like this:
mvn eclipse:clean eclipse:eclipse
To run the IotStreams engine with live data you will need to
- Change
csparql.properties
, settingesper.externaltime.enabled
tofalse
. - Write Java code that constructs an instance of
uk.ac.abdn.iotstreams.csparql.IotStreamsEngine
(call thisengine
) - Write Java code that encodes live data as SSN in a Jena
Model
(call thismodel
) and adds the data like this:engine.apply(ZonedDateTime.now()).accept(model)
.
To see if the updated code has any issues according to PMD or Findbugs, run
mvn site
then open target/site/project-reports.html