Example usage of µRDF.js in a building automation application.
Servients (system components):
thermostat.local
temp-sensor.local
contact-sensor.local
humidity-sensor.local
light-sensor.local
blinds.local
light-bulb.local
energy-meter.local
beamer.local
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "tag:thermostat",
"title": "Radiator thermostat",
"properties": {
"setpoint": {
"type": "number",
"forms": [
{
"href": "https://thermostat.local/setpoint",
"op": [ "readproperty", "writeproperty" ]
}
]
}
}
}
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "tag:temp-sensor",
"title": "Temperature sensor",
"properties": {
"val": {
"type": "number",
"forms": [
{
"href": "https://temp-sensor.local/val",
"op": [ "readproperty" ]
}
]
}
}
}
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "tag:contact-sensor",
"title": "Contact sensor (window)",
"events": {
"change": {
"data": {
"type": "boolean"
},
"forms": [
{
"href": "https://contact-sensor.local/change",
"op": [ "subscribeevent" ]
}
]
}
}
}
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "tag:humidity-sensor",
"title": "Humidity sensor",
"properties": {
"val": {
"type": "number",
"forms": [
{
"href": "https://humidity-sensor.local/val",
"op": [ "readproperty" ]
}
]
}
}
}
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "tag:light-sensor",
"title": "Brightness sensor",
"properties": {
"val": {
"type": "number",
"forms": [
{
"href": "https://light-sensor.local/val",
"op": [ "readproperty" ]
}
]
}
}
}
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "tag:blinds",
"title": "Window blinds",
"actions": {
"open": {
"input": {
"type": "boolean"
},
"forms": [
{
"href": "https://blinds.local/open",
"op": [ "invokeaction" ]
}
]
}
}
}
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "tag:light-bulb",
"title": "Light bulb",
"actions": {
"turnOn": {
"input": {
"type": "boolean"
},
"forms": [
{
"href": "https://light-bulb.local/turnOn",
"op": [ "invokeaction" ]
}
]
}
}
}
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "tag:energy-meter",
"title": "Energy meter",
"properties": {
"reading": {
"type": "number",
"forms": [
{
"href": "https://energy-meter.local/reading",
"op": [ "readproperty" ]
}
]
}
}
}
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "tag:tv",
"title": "Television",
"properties": {
"status": {
"type": "boolean",
"forms": [
{
"href": "https://television.local/status",
"op": [ "readproperty" ]
}
]
},
"contrast": {
"type": "number",
"forms": [
{
"href": "https://television.local/contrast",
"op": [ "readproperty", "writeproperty" ]
}
]
}
}
}
{
"@d": "tag:conference-room",
"bot:hasElement": [
"tag:temp-sensor",
"tag:contact-sensor"
]
}
{
"@d": "tag:conference-room",
"bot:hasElement": [
"tag:temp-sensor",
"tag:thermostat"
]
}
{
"@d": "tag:conference-room",
"bot:hasElement": [
"tag:thermostat",
"tag:contact-sensor"
]
}
This tutorial was first presented as a poster at the 1st Franconian Workshop on Data Spaces and the IoT (DSIoT 2019).