Within this repository we store all the necessary to start with a Web Of Things implementation.
1. WoT Ontology
The file called
wot_ontology.owl contains the ontology we use to represent things. The Classes are
And some others that are going to be described in a paper soon.
2. Cocktail python3 framework
Requiring Sepy, you can use the framework to create applications. First you have to run a SEPA instance, then just read up the documentation of the framework.
You should not need to know SPARQL to use Cocktail. However, for very special needs, in the package there are all the basic SPARQL that the framework uses, from which you can take inspiration, and then apply
sepy to perform your queries.
$ python3 setup.py build $ python3 setup.py sdist $ sudo python3 setup.py \[install|develop\]
For now, tests are available only to check ontology consistency.
$ python3 setup.py test
To have an example on how to make a WebThing, have a look to the following files.
tools/request_action.pyand in the tests of the cocktail package. Notice that (1) is also useful to see what happens when you start using the
wotMonitor.pytool. (2) is a nice runnable script to observe a specific event notifications.
Available tools and experiments
tools/request_action.py are useful to learn how to program with Cocktail, they are also invokable from the python command line.
Please refer to their -h argument to see how to invoke them.
There is also
tools/wotMonitor.py. A typical experiment with
wotMonitor.py consists in
0. Run the SEPA
- open a terminal, and run
$ cd tools $ python3 ../new_thing_example.py
- Open another terminal, and run
$ python3 wotMonitor.py
- see that
tools/observe_event.pyis called from
- again from
- choose an action available
- see that
tools/request_action.pyis called from
wotMonitor.pyand that it prompts you for some input, if the action needs it.
Feel free to get in touch, if you have any question or suggestions