如何用Schema.org来描述温度?
How to describe the temperature with Schema.org?
我想用Schema.org(配合JSON-LD)来标注温度传感器中的值/描述温度属性(单位)。
我找不到关于 Schema.org 处温度的解释。我通过MQTT获取传感器值,这里是MQTT输出的数据。
{
"@context": "http://example/temperature.jsonld",
"_UTC_timestamp": "2017-11-18 08:56:51",
"temperature": 25.12
}
<script type="application/ld+json">
"@context": {
"Thing": "@type",
"CreativeWork": "@subtype",
"Thing": [{
"name": "temperature",
"@type": "number",
"@value": "CreativeWork"
"minimum": 0,
"maximum": 80,
"description": "a physical quantity that expresses the subjective perceptions of hot and cold",
"url": "https://en.wikipedia.org/wiki/Temperature",
"unit": "Celsius",
CreativeWork[{
"name": "measure temperature",
"description": "Get the sensor temperature value" ,
"Celsius" "https://en.wikipedia.org/wiki/Celsius"
"link": [{
"href": "http://iwilr3-3.campus.fhludwigshafen.de/iotsemantic/tinkerforge/temperature.jsonld"
}
]
}
]
}
]
}
</script>
首先,在turtle format
中写出你的陈述(三元组)
@Dataset name text
dateCreated @DateTime
about @Thing
variableMeasured @PropertyValue
@Thing name "sample from a sensor"
mainEntityOfPage @CreativeWork
@CreativeWork name sample
description text about sampling
@PropertyValue value @Number
unitText temperature
valueReference @PropertyValue
@PropertyValue unitCode http://dbpedia.org/page/Celsius
unitText celsius
然后将这些语句组合成图表
这是您的@Types 及其属性的@Graph
{
"@graph": [
{
"@type": "Dataset",
"@id": "DFI-1",
"name": "label you use for the Dataset",
"dateCreated": "2017-11-19T:04:30:40+06:00",
"about":
{
"@type": "Thing",
"@id": "Thing-1"
},
"variableMeasured":
{
"@type": "PropertyValue",
"@id": "PV-1"
}
},
{
"@type": "Thing",
"@id": "Thing-1",
"name": "sample from a sensor",
"mainEntityOfPage":
{
"@type": "CreativeWork",
"@id": "CW-1"
}
},
{
"@type": "CreativeWork",
"@id": "CW-1",
"name": "label you use for the creative work to describe Thing-1",
"description": "Thing-1 documentation"
},
{
"@type": "PropertyValue",
"@id": "PV-1",
"name": "temperature",
"value": "10",
"valueReference":
{
"@type": "PropertyValue",
"@id": "PV-2"
}
},
{
"@type": "PropertyValue",
"@id": "PV-2",
"unitCode": "http://dbpedia.org/page/Celsius",
"unitText": "celsius"
}
],
"@context": "http://schema.org/"
}
在这里查看
GSDTT
我想用Schema.org(配合JSON-LD)来标注温度传感器中的值/描述温度属性(单位)。
我找不到关于 Schema.org 处温度的解释。我通过MQTT获取传感器值,这里是MQTT输出的数据。
{
"@context": "http://example/temperature.jsonld",
"_UTC_timestamp": "2017-11-18 08:56:51",
"temperature": 25.12
}
<script type="application/ld+json">
"@context": {
"Thing": "@type",
"CreativeWork": "@subtype",
"Thing": [{
"name": "temperature",
"@type": "number",
"@value": "CreativeWork"
"minimum": 0,
"maximum": 80,
"description": "a physical quantity that expresses the subjective perceptions of hot and cold",
"url": "https://en.wikipedia.org/wiki/Temperature",
"unit": "Celsius",
CreativeWork[{
"name": "measure temperature",
"description": "Get the sensor temperature value" ,
"Celsius" "https://en.wikipedia.org/wiki/Celsius"
"link": [{
"href": "http://iwilr3-3.campus.fhludwigshafen.de/iotsemantic/tinkerforge/temperature.jsonld"
}
]
}
]
}
]
}
</script>
首先,在turtle format
中写出你的陈述(三元组)@Dataset name text
dateCreated @DateTime
about @Thing
variableMeasured @PropertyValue
@Thing name "sample from a sensor"
mainEntityOfPage @CreativeWork
@CreativeWork name sample
description text about sampling
@PropertyValue value @Number
unitText temperature
valueReference @PropertyValue
@PropertyValue unitCode http://dbpedia.org/page/Celsius
unitText celsius
然后将这些语句组合成图表
这是您的@Types 及其属性的@Graph
{
"@graph": [
{
"@type": "Dataset",
"@id": "DFI-1",
"name": "label you use for the Dataset",
"dateCreated": "2017-11-19T:04:30:40+06:00",
"about":
{
"@type": "Thing",
"@id": "Thing-1"
},
"variableMeasured":
{
"@type": "PropertyValue",
"@id": "PV-1"
}
},
{
"@type": "Thing",
"@id": "Thing-1",
"name": "sample from a sensor",
"mainEntityOfPage":
{
"@type": "CreativeWork",
"@id": "CW-1"
}
},
{
"@type": "CreativeWork",
"@id": "CW-1",
"name": "label you use for the creative work to describe Thing-1",
"description": "Thing-1 documentation"
},
{
"@type": "PropertyValue",
"@id": "PV-1",
"name": "temperature",
"value": "10",
"valueReference":
{
"@type": "PropertyValue",
"@id": "PV-2"
}
},
{
"@type": "PropertyValue",
"@id": "PV-2",
"unitCode": "http://dbpedia.org/page/Celsius",
"unitText": "celsius"
}
],
"@context": "http://schema.org/"
}
在这里查看 GSDTT