Within this repository we store all the necessary to start with a Web Of Things implementation.
The file called wot_ontology.owl
contains the ontology we use to represent things. The Classes are
Thing
InteractionPattern
(Action
,Event
,Property
)DataSchema
FieldSchema
And some others that are going to be described in a paper soon.
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.
new_thing_example.py
tools/observe_event.py
tools/request_action.py
and in the tests of the cocktail package. Notice that (1) is also useful to see what happens when you start using thewotMonitor.py
tool. (2) is a nice runnable script to observe a specific event notifications.
While tools/observe_event.py
and 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
- call
discover
- call
events
- choose
http://MyFirstWebThing.com/Event1
- see that
tools/observe_event.py
is called fromwotMonitor.py
- again from
wotMonitor.py
, calldiscover
- call
actions
- choose an action available
- see that
tools/request_action.py
is called fromwotMonitor.py
and that it prompts you for some input, if the action needs it. - enjoy
Feel free to get in touch, if you have any question or suggestions