You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked this again and interestingly JSON-LD playground "validates" this as well. Triples are not generated but expansion and so on works. My feeling is to not allow this but I am up for discussions
iot:Temperature and other terms are actually also valid URIs, which is why the JSON-LD playground does not throw any error. It is more a usage pitfall than a formal error and these are not easy to differentiate from intentional definitions. I started working on a small linting tool to detect common mistakes:
Following TD from Fujitsu does not define the namespace {"iot": "http://iotschema.org/"} for iot:Temperature, iot:Humidity, etc, but it passes all validations in http://plugfest.thingweb.io/playground/
{
"@context": ["https://w3c.github.io/wot/w3c-wot-td-context.jsonld"],
"@type": "Thing",
"name": "Fujitsu-WiFiAgent240AC4114764",
"id": "urn:dev:wot:com:fujitsu:wifiagent",
"base" : "http://192.168.1.21/Things/Property/",
"properties": {
"Temperature": {
"@type": "iot:Temperature",
"type": "object",
"properties": {
"temperature":{"type":"number"},
"rssi":{"type":"number"}
},
"writable": false,
"observable": false,
"forms": [{
"href" : "temperature",
"mediaType": "application/json"
}]
},
"Humidity": {
"@type": "iot:Humidity",
"type": "object",
"properties": {
"humidity":{"type":"number"},
"rssi":{"type":"number"}
},
"writable": false,
"observable": false,
"forms": [{
"href" : "humidity",
"mediaType": "application/json"
}]
},
"AirPressure": {
"@type": "iot:AirPressure",
"type": "object",
"properties": {
"airPressure":{"type":"number"},
"rssi":{"type":"number"}
},
"writable": false,
"observable": false,
"forms": [{
"href" : "airPressure",
"mediaType": "application/json"
}]
},
"Dust": {
"@type": "iot:Dust",
"type": "object",
"properties": {
"dust":{"type":"number"},
"rssi":{"type":"number"}
},
"writable": false,
"observable": false,
"forms": [{
"href" : "dust",
"mediaType": "application/json"
}]
},
"AllSensorData": {
"@type":"iot:AllSensor",
"type": "object",
"properties": {
"temperature":{"type":"number"},
"humidity":{"type":"number"},
"airPressure":{"type":"number"},
"dust":{"type":"number"},
"rssi":{"type":"number"}
},
"writable": false,
"observable": false,
"forms": [{
"href" : "allSensorData",
"mediaType": "application/json"
}]
}
},
"actions":{},
"events":{}
}
The text was updated successfully, but these errors were encountered: