Skip to content

m-markovic/FoodSafety

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FoodSafety

Requires Java JDK 8 and maven 3.3. Refer to the following links to install these:

Prerequisite

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

Configuration

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="me@myemail.com mypassword" # credentials for wirelesstag.net - no space allowed in the password

Building

mvn clean package

Running

mvn package && java -jar target/iotstreams-jar-with-dependencies.jar

Creating an Eclipse project

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

Using live data

To run the IotStreams engine with live data you will need to

  • Change csparql.properties, setting esper.externaltime.enabled to false.
  • Write Java code that constructs an instance of uk.ac.abdn.iotstreams.csparql.IotStreamsEngine (call this engine)
  • Write Java code that encodes live data as SSN in a Jena Model (call this model) and adds the data like this: engine.apply(ZonedDateTime.now()).accept(model).

Run static analyses

To see if the updated code has any issues according to PMD or Findbugs, run

mvn site

then open target/site/project-reports.html

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages