Cookie の設定を選択する

当社は、当社のサイトおよびサービスを提供するために必要な必須 Cookie および類似のツールを使用しています。当社は、パフォーマンス Cookie を使用して匿名の統計情報を収集することで、お客様が当社のサイトをどのように利用しているかを把握し、改善に役立てています。必須 Cookie は無効化できませんが、[カスタマイズ] または [拒否] をクリックしてパフォーマンス Cookie を拒否することはできます。

お客様が同意した場合、AWS および承認された第三者は、Cookie を使用して便利なサイト機能を提供したり、お客様の選択を記憶したり、関連する広告を含む関連コンテンツを表示したりします。すべての必須ではない Cookie を受け入れるか拒否するには、[受け入れる] または [拒否] をクリックしてください。より詳細な選択を行うには、[カスタマイズ] をクリックしてください。

Mapping RDF triples to LPG concepts

フォーカスモード
Mapping RDF triples to LPG concepts - Neptune Analytics
このページはお客様の言語に翻訳されていません。 翻訳のリクエスト

There are three rules that define how RDF triples correspond to LPG concepts:

Case RDF triple ⇆ LPG concept ----------------------------------------------------------------- Case #1 { <iri> rdf:type <iri> } ⇆ vertex with id + label Case #2 { <iri> <iri> "literal"} ⇆ vertex property Case #3 { <iri> <iri> <iri> } ⇆ edge with label

Case #1: Vertex with id and label

A triple like:

<http://example.com/Alice> rdf:type <http://xmlns.com/foaf/0.1/Person>

is equivalent to creating the vertex in openCypher like:

CREATE (:`<http://xmlns.com/foaf/0.1/Person>` {`~id`: "<http://example.com/Alice>"})

In this example, the vertex label <http://xmlns.com/foaf/0.1/Person> is interpreted and stored as an IRI.

Note

The back quote syntax `` is part of openCypher which allows inserting characters that normally cannot be used in labels. Using this mechanism, it’s possible to include complete IRIs in a query.

Using PREFIX, the same CREATE query could look like:

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX ex: <http://example.com/> CREATE (: foaf::Person {`~id`: ex::Alice})

To match the newly created vertex based on its id:

MATCH (v {`~id`: "<http://example.com/Alice>"}) RETURN v

or equivalently:

PREFIX ex: <http://example.com/> MATCH (v {`~id`: ex::Alice}) RETURN v

To find vertices with that RDF Class/LPG Label:

MATCH (v:`<http://xmlns.com/foaf/0.1/Person>`) RETURN v

or equivalently:

PREFIX foaf: <http://xmlns.com/foaf/0.1/> MATCH (v : foaf::Person) RETURN v

Case #2: Vertex property

A triple like:

<http://example.com/Alice> <http://xmlns.com/foaf/0.1/name> "Alice Smith"

is equivalent to defining with openCypher node with a given ~id and property, where both the ~id and the property key are IRIs:

CREATE ({`~id`: "<http://example.com/Alice>", `<http://xmlns.com/foaf/0.1/name>`: "Alice Smith" })

or equivalently:

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX ex: <http://example.com/> CREATE ({`~id`: ex::Alice, foaf::name: "Alice Smith" })

To match the vertex with that property:

MATCH (v {`<http://xmlns.com/foaf/0.1/name>`: "Alice Smith"}) RETURN v

or equivalently:

PREFIX foaf: <http://xmlns.com/foaf/0.1/> MATCH (v { foaf::name : "Alice Smith"}) RETURN v

Case #3: Edge

A triple like:

<http://example.com/Alice> <http://example.com/knows> <http://example.com/Bob>

is equivalent to defining with OpenCypher an edge like this, where the edge label and vertices ids are all IRIs:

CREATE ({`~id`: "<http://example.com/Alice>"}) -[:`<http://example.com/knows>`]->({`~id`: "<http://example.com/Bob>"})

or equivalently:

PREFIX ex: <http://example.com/> CREATE ({`~id`: ex::Alice })-[: ex::knows ]->({`~id`: ex::Bob })

To match the edges with that label:

MATCH (v)-[:`<http://example.com/knows>`]->(w) RETURN v, w

or equivalently:

PREFIX ex: <http://example.com/> MATCH (v)-[: ex::knows ]->(w) RETURN v, w

Query Examples

Matching language-tagged literals

If this triple was loaded from a dataset:

<http://example.com/German> <http://example.com/greeting> "Hallo"@de

then it will not be matched by this query:

MATCH (n) WHERE n.`<http://example.com/greeting>` = "Hallo"

because the language-tagged literal "Hallo"@de and the string “Hallo” are not equal. For more information, see Language-tagged literals. The query can use TOSTRING() in order to find the match:

MATCH (n) WHERE TOSTRING(n.`<http://example.com/greeting>`) = "Hallo"

このページの内容

プライバシーサイト規約Cookie の設定
© 2025, Amazon Web Services, Inc. or its affiliates.All rights reserved.