2013-08-12

RDF記述フォーマット

最近はやりのLOD(Linked Open Data)のデータフォーマットについてメモ

例はWikipediaコピペもっと違いが分かりやすい例があると良いのだが。

XML

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
  <rdf:Description rdf:about="http://en.wikipedia.org/wiki/Tony_Benn">
    <dc:title>Tony Benn</dc:title>
    <dc:publisher>Wikipedia</dc:publisher>
  </rdf:Description>
</rdf:RDF>

N3: notation3

@prefix dc: <http://purl.org/dc/elements/1.1/>.

<http://en.wikipedia.org/wiki/Tony_Benn>
  dc:title "Tony Benn";
  dc:publisher "Wikipedia".

Turtle: Terse RDF Triple Language

@prefix dc: <http://purl.org/dc/elements/1.1/>.

<http://en.wikipedia.org/wiki/Tony_Benn>
  dc:title "Tony Benn";
  dc:publisher "Wikipedia".

N-Triples

<http://en.wikipedia.org/wiki/Tony_Benn> <http://purl.org/dc/elements/1.1/title> "Tony Benn".
<http://en.wikipedia.org/wiki/Tony_Benn> <http://purl.org/dc/elements/1.1/publisher> "Wikipedia".

N-Quads: Extending N-Triples with Context

<http://en.wikipedia.org/wiki/Tony_Benn> <http://purl.org/dc/elements/1.1/title> "Tony Benn" <http://en.wikipedia.org/wiki/Tony_Benn>.
<http://en.wikipedia.org/wiki/Tony_Benn> <http://purl.org/dc/elements/1.1/publisher> "Wikipedia" <http://en.wikipedia.org/wiki/Tony_Benn>.

JSON-LD

{
  "@context":
  {
    "dc": "http://purl.org/dc/elements/1.1/"
  },
  "@id": "http://en.wikipedia.org/wiki/Tony_Benn",
  "dc:title": "Tony Benn",
  "dc:publisher": "Wikipedia"
}

記事への反応(ブックマークコメント)

ログイン ユーザー登録
ようこそ ゲスト さん