FIWARE Banner



これは、4つのエンティティで構成される単純な "supermarket" NGSI-LD データモデルの説明です:

このチュートリアルで定義されている各エンティティに関するヒューマン・リーダブルな詳細情報は、リンクをクリックして見つけることができます。

スーパーマーケット向けの完全な NGSI-LD @context

チュートリアルの完全な NGSI-LD @context は、次の場所で公開されています: https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld

@context@graph のスニペットは、以下にあります (詳細を見るためにスクロールしてください):

	
{
  "@context": {
    "type": "@type",
    "id": "@id",
    "schema": "https://schema.org/",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "fiware": "https://uri.fiware.org/ns/data-models#",
    "tutorial": "https://fiware.github.io/tutorials.Step-by-Step/schema/",
    "Building": "fiware:Building",
    "Product": "tutorial:Product",
    "Shelf": "tutorial:Shelf",
    "StockOrder": "tutorial:StockOrder",
    "Person": "schema:Person",
    "address": "schema:address",
    "category": "fiware:category",
    "containedInPlace": "fiware:containedInPlace",
    "dataProvider": "fiware:dataProvider",
    "description": "fiware:description",
    "floorsAboveGround": "fiware:floorsAboveGround",
    "floorsBelowGround": "fiware:floorsBelowGround",
    "owner": {
      "@id": "fiware:owner",   
      "@type": "@id"
    },
    "occupier": {
      "@id": "fiware:occupier",   
      "@type": "@id"
    },
    "refMap": "fiware:refMap",
    "source": "fiware:source", 
    "installedBy": {
      "@id": "tutorial:installedBy",   
      "@type": "@id"
    },  
    "locatedIn": {
      "@id": "tutorial:locatedIn",   
      "@type": "@id"
    },
    "maxCapacity":  {
      "@id": "tutorial:maxCapacity",
      "@type": "xsd:integer"
    },  
    "statusOfWork": "tutorial:statusOfWork",
    "stocks": {
      "@id": "tutorial:stocks",   
      "@type": "@id"
    },
    "currency": {
      "@id": "tutorial:currency",
      "@type": "xsd:string"
    }, 
    "price": {
      "@id": "tutorial:price",
      "@type": "xsd:decimal"
    }, 
    "size":  {
      "@id": "tutorial:size",
      "@type": "xsd:string"
    },
    "furniture": {
      "@id": "tutorial:furniture",   
      "@type": "@id"
    },
    "verified": {
      "@id": "tutorial:verified",
      "@type": "xsd:boolean"
    },
    "requestedFor": {
      "@id": "tutorial:requestedFor",   
      "@type": "@id"
    },
    "requestedBy": {
      "@id": "tutorial:requestedBy",   
      "@type": "@id"
    },
    "orderedProduct": {
      "@id": "tutorial:orderedProduct",   
      "@type": "@id"
    },
    "orderDate": {
      "@id": "tutorial:orderDate",   
      "@type": "https://uri.etsi.org/ngsi-ld/DateTime"
    },
    "stockCount":  {
      "@id": "tutorial:stockCount",
      "@type": "xsd:integer"
    }, 
    "numberOfItems":  {
      "@id": "tutorial:numberOfItems",
      "@type": "xsd:integer"
    }
  },
  "@graph": [
    {
      "@id": "tutorial:Product",
      "@type": "rdfs:Class",
      "rdfs:comment": "製品はストアで販売されている物",
      "rdfs:label": "製品",
      "rdfs:subClassOf": {
        "@id": "http://schema.org/Thing"
      }
    },
    {
      "@id": "tutorial:Shelf",
      "@type": "rdfs:Class",
      "rdfs:comment": "棚はストア用家具のユニット",
      "rdfs:label": "棚",
      "rdfs:subClassOf": {
        "@id": "http://schema.org/Thing"
      }
    },
    {
      "@id": "tutorial:StockOrder",
      "@type": "rdfs:Class",
      "rdfs:comment": "在庫注文は1つ以上のストアで販売されるアイテムの一覧のエントリ",
      "rdfs:label": "在庫注文",
      "rdfs:subClassOf": {
        "@id": "http://schema.org/Intangible"
      }
    },
    {
      "@id": "schema:Person",
      "@type": "rdfs:Class",
      "http://purl.org/dc/terms/source": {
        "@id": "http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_rNews"
      },
      "http://www.w3.org/2002/07/owl#equivalentClass": {
        "@id": "http://xmlns.com/foaf/0.1/Person"
      },
      "rdfs:comment": "人 (生きている, 死んでいる, 完全に死んでいない, または架空の人)",
      "rdfs:label": "人",
      "rdfs:subClassOf": {
        "@id": "http://schema.org/Thing"
      }
    },
    {
      "@id": "tutoral:requestedBy",
      "@type": "https://uri.etsi.org/ngsi-ld/Relationship",
      "schema:domainIncludes": [
        {
          "@id": "tutorial:Shelf"
        },
        {
          "@id": "tutorial:StockOrder"
        }
      ],
      "schema:rangeIncludes": [
        {
          "@id": "schema:Person"
        }
      ],
      "rdfs:comment": "人が要求したオブジェクト",
      "rdfs:label": "要求者"
    },
    {
      "@id": "tutoral:installedBy",
      "@type": "https://uri.etsi.org/ngsi-ld/Relationship",
      "schema:domainIncludes": [
        {
          "@id": "tutorial:Shelf"
        }
      ],
      "schema:rangeIncludes": [
        {
          "@id": "schema:Person"
        }
      ],
      "rdfs:comment": "オブジェクトを設置する人",
      "rdfs:label": "設置者"
    },
    {
      "@id": "tutorial:furniture",
      "@type": "https://uri.etsi.org/ngsi-ld/Relationship",
      "schema:domainIncludes": [
        {
          "@id": "fiware:Building"
        }
      ],
      "schema:rangeIncludes": [
        {
          "@id": "tutorial:Shelf"
        }
      ],
      "rdfs:comment": "建物内で見つかったユニット",
      "rdfs:label": "家具"
    },
    {
      "@id": "tutorial:locatedIn",
      "@type": "https://uri.etsi.org/ngsi-ld/Relationship",
      "schema:domainIncludes": [
        {
          "@id": "tutorial:Shelf"
        }
      ],
      "schema:rangeIncludes": [
        {
          "@id": "fiware:Building"
        }
      ],
      "rdfs:comment": "アイテムが見つかった建物",
      "rdfs:label": "置き場所"
    },
    {
      "@id": "tutorial:stocks",
      "@type": "https://uri.etsi.org/ngsi-ld/Relationship",
      "schema:domainIncludes": [
        {
          "@id": "tutorial:Shelf"
        }
      ],
      "schema:rangeIncludes": [
        {
          "@id": "tutorial:Product"
        }
      ],
      "rdfs:comment": "棚の上にある製品",
      "rdfs:label": "在庫"
    },
    {
      "@id": "tutorial:requestedFor",
      "@type": "https://uri.etsi.org/ngsi-ld/Relationship",
      "schema:domainIncludes": [
        {
          "@id": "tutorial:StockOrder"
        }
      ],
      "schema:rangeIncludes": [
        {
          "@id": "fiware:Building"
        }
      ],
      "rdfs:comment": "アイテムが要求されたストア",
      "rdfs:label": "要求対象"
    },
    {
      "@id": "tutorial:orderedProduct",
      "@type": "https://uri.etsi.org/ngsi-ld/Relationship",
      "schema:domainIncludes": [
        {
          "@id": "tutorial:StockOrder"
        }
      ],
      "schema:rangeIncludes": [
        {
          "@id": "tutorial:Product"
        }
      ],
      "rdfs:comment": "ストアで注文された製品",
      "rdfs:label": "注文された製品"
    }
  ]
}
 	
 

@context の読み方 - 構文トークンとキーワード

JSON-LD 1.0 仕様 で定義されているように、 JSON-LD は NGSI-LD で使用されるいくつかの構文トークンとキーワードを指定します。チュートリアルの NGSI-LD データモデルの理解を容易にするために、主なキーワードを以下にリストします:

JSON-LD および NSGI-LD のすべての Keys (キー), keywords (キーワード)、および values (値) は大文字と小文字が区別されることに注意してください。

NGSI-LD と JSON-LD のリレーションシップ

NGSI-LD 仕様は NGSI-LD はリンクト・データをシリアル化する JSON ベースのフォーマットの JSON-LD に基づいていると規定されています。JSON-LD の @context は、 文字列として提供される用語を URI として指定された概念にマッピングするために使用されます。Core NGSI-LD (JSON-LD) @context は、以下を含む JSON-LD @context として定義されます:

NGSI-LD 準拠のすべての実装は、コンテキスト情報の処理または生成時に暗黙的に存在する Core @context の使用をサポートします。ただし、NGSI-LD 要素をレンダリングするときは、Core @context を常に明示的に参照する必要があります。これにより、必要に応じて、JSON-LD プロセッサは API 実装によって提供される JSON-LD ドキュメントを適切に展開できます。

完全な core NGSI-LD @context は、次の場所で公開されています: http://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld