如何用Schema.org描述温度?

问题描述 投票:2回答:1

我想使用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>
schema.org json-ld temperature
1个回答
2
投票

首先,在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

© www.soinside.com 2019 - 2024. All rights reserved.