SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
オ ー プ ン デ ー タ
な ん か で よ く 使 う
Tu r t l e 形 式 な ん だ け ど
X M L と 違 っ て ど う 便 利 な の ?
@ S M A G C H
h t t p : // w w w. w 3 . o r g / T R / v o c a b - d c a t / # e x a m p l e
:catalog	
a dcat:Catalog ;	
dct:title "Imaginary Catalog" ;	
rdfs:label "Imaginary Catalog" ;	
foaf:homepage <http://example.org/catalog> ;	
dct:publisher :transparency-office ;	
dct:language <http://id.loc.gov/vocabulary/iso639-1/en> ;	
dcat:dataset :dataset-001 , :dataset-002 , :dataset-003 ; 	
.
dcatのSpecificationに出てくる
RDFの例ではXMLではなく、
Turtle形式で記述されている。
英語のWikiに出てくる
RDFの例から、
XMLとTurtleの
形式の違いを見比べてみる
h t t p : // e n . w i k i p e d i a . o r g / w i k i / R e s o u r c e _ D e s c r i p t i o n _ Fr a m e w o r k
@prefix eric: <http://www.w3.org/People/EM/contact#> .	
@prefix contact: <http://www.w3.org/2000/10/swap/pim/contact#> .	
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .	
	
eric:me contact:fullName "Eric Miller" .	
eric:me contact:mailbox <mailto:e.miller123(at)example> .	
eric:me contact:personalTitle "Dr." .	
eric:me rdf:type contact:Person .
<?xml version="1.0" encoding="utf-8"?>	
<rdf:RDF xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#" xmlns:eric="http://www.w3.org/
People/EM/contact#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">	
<rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me">	
<contact:fullName>Eric Miller</contact:fullName>	
</rdf:Description>	
<rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me">	
<contact:mailbox rdf:resource="mailto:e.miller123(at)example"/>	
</rdf:Description>	
<rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me">	
<contact:personalTitle>Dr.</contact:personalTitle>	
</rdf:Description>	
<rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me">	
<rdf:type rdf:resource="http://www.w3.org/2000/10/swap/pim/contact#Person"/>	
</rdf:Description>	
</rdf:RDF>
<http://www.w3.org/People/EM/contact#me>	
	 <http://www.w3.org/2000/10/swap/pim/contact#fullName>	
	 	 "Eric Miller" .
@prefix eric: <http://www.w3.org/People/EM/contact#> .	
@prefix contact: <http://www.w3.org/2000/10/swap/pim/contact#> .	
!
eric:me contact:fullName "Eric Miller" .
XMLのxmlnsみたいに、@prefixで
エイリアスを作れる。
上の2つは同じ。
E X A M P L E 1
@base <http://example.org/> .	
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .	
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .	
@prefix foaf: <http://xmlns.com/foaf/0.1/> .	
@prefix rel: <http://www.perceive.net/schemas/relationship/> .	
!
<#green-goblin>	
rel:enemyOf <#spiderman> ;	
a foaf:Person ; # in the context of the Marvel universe	
foaf:name "Green Goblin" .	
!
<#spiderman>	
rel:enemyOf <#green-goblin> ;	
a foaf:Person ;	
foaf:name "Spiderman", "Человек-паук"@ru .
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 2 _ s e c - i n t r o
<http://example.org/#spiderman>	
	 <http://www.perceive.net/schemas/relationship/enemyOf>	
	 	 <http://example.org/#green-goblin> ;	
	 <http://xmlns.com/foaf/0.1/name>	
	 	 "Spiderman" .
<http://example.org/#spiderman>	
	 <http://www.perceive.net/schemas/relationship/enemyOf>	
	 	 <http://example.org/#green-goblin> .	
!
<http://example.org/#spiderman>	
	 <http://xmlns.com/foaf/0.1/name>	
	 	 "Spiderman" .
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ p r e d i c a t e - l i s t s
E X A M P L E 3
E X A M P L E 4
Predicate Lists
<http://example.org/#spiderman>	
	 <http://xmlns.com/foaf/0.1/name>	
	 	 "Spiderman", "Человек-паук"@ru .
<http://example.org/#spiderman>	
	 <http://xmlns.com/foaf/0.1/name> "Spiderman" .	
<http://example.org/#spiderman>	
	 <http://xmlns.com/foaf/0.1/name> "Человек-паук"@ru .
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ o b j e c t - l i s t s
E X A M P L E 5
E X A M P L E 6
Object Lists
@prefix somePrefix: <http://www.perceive.net/schemas/relationship/> .	
!
<http://example.org/#green-goblin> somePrefix:enemyOf	
	 <http://example.org/#spiderman> .
PREFIX somePrefix: <http://www.perceive.net/schemas/relationship/>	
!
<http://example.org/#green-goblin> somePrefix:enemyOf 	
	 <http://example.org/#spiderman> .
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ s e c - i r i
E X A M P L E 7
E X A M P L E 8
IRIs
@prefixと@baseは case sensitive
後からサポートされたSPARQLシンタックス。PREFIX, BASEは case insensitive。終わりのドットなし
# A triple with all absolute IRIs	
<http://one.example/subject1> <http://one.example/predicate1> <http://one.example/object1> .	
!
@base <http://one.example/> .	
<subject2> <predicate2> <object2> . # relative IRIs, e.g. http://one.example/subject2	
!
BASE <http://one.example/>	
<subject2> <predicate2> <object2> . # relative IRIs, e.g. http://one.example/subject2	
!
@prefix p: <http://two.example/> .	
p:subject3 p:predicate3 p:object3 . # prefixed name, e.g. http://two.example/subject3	
!
PREFIX p: <http://two.example/>	
p:subject3 p:predicate3 p:object3 . # prefixed name, e.g. http://two.example/subject3	
!
@prefix p: <path/> . # prefix p: now stands for http://one.example/path/	
p:subject4 p:predicate4 p:object4 . # prefixed name, e.g. http://one.example/path/subject4	
!
@prefix : <http://another.example/> . # empty prefix	
:subject5 :predicate5 :object5 . # prefixed name, e.g. http://another.example/subject5	
!
:subject6 a :subject7 . # same as :subject6 <http://www.w3.org/1999/02/22-rdf-syntax-
ns#type> :subject7 .	
!
<http://伝言.example/?user=‫&أكرم‬amp;channel=R%26D> a :subject8 . # a multi-script subject IRI .
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ s e c - i r i
E X A M P L E 9
@prefix foaf: <http://xmlns.com/foaf/0.1/> .	
!
<http://example.org/#green-goblin> foaf:name "Green Goblin" .	
!
<http://example.org/#spiderman> foaf:name "Spiderman" .
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ l i t e r a l s
E X A M P L E 1 0
Literals
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .	
@prefix show: <http://example.org/vocab/show/> .	
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .	
!
show:218 rdfs:label "That Seventies Show"^^xsd:string .	
show:218 rdfs:label "That Seventies Show"^^<http://www.w3.org/2001/XMLSchema#string> .	
show:218 rdfs:label "That Seventies Show" . 	
show:218 show:localName "That Seventies Show"@en . 	
show:218 show:localName 'Cette Série des Années Soixante-dix'@fr .	
show:218 show:localName "Cette Série des Années Septante"@fr-be . 	
show:218 show:blurb '''This is a multi-line 	
literal with many quotes (""""")	
and up to two sequential apostrophes ('').''' .
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 4 _ t u r t l e - l i t e r a l s
E X A M P L E 1 1
Quoted Literals
@prefix : <http://example.org/elements> .
<http://en.wikipedia.org/wiki/Helium>
:atomicNumber 2 ; # xsd:integer
:atomicMass 4.002602 ; # xsd:decimal
:specificGravity 1.663E-4 . # xsd:double
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 4 _ a b b r e v
E X A M P L E 1 2
Numbers & Booleans
@prefix : <http://example.org/stats> .	
<http://somecountry.example/census2007>	
:isLandlocked false . # xsd:boolean
E X A M P L E 1 3
@prefix foaf: <http://xmlns.com/foaf/0.1/> .	
!
_:alice foaf:knows _:bob .	
_:bob foaf:knows _:alice .
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ B N o d e s
E X A M P L E 1 4
Blank Nodes
@prefix foaf: <http://xmlns.com/foaf/0.1/> .	
!
# Someone knows someone else, who has the name "Bob".	
[] foaf:knows [ foaf:name "Bob" ] .
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ u n l a b e l e d - b n o d e s
E X A M P L E 1 5
Nesting Unlabeled Blank Nodes
@prefix foaf: <http://xmlns.com/foaf/0.1/> .	
!
[ foaf:name "Alice" ] foaf:knows [	
foaf:name "Bob" ;	
foaf:knows [	
foaf:name "Eve" ] ;	
foaf:mbox <bob@example.com> ] .
E X A M P L E 1 6
_:a <http://xmlns.com/foaf/0.1/name> "Alice" .	
_:a <http://xmlns.com/foaf/0.1/knows> _:b .	
_:b <http://xmlns.com/foaf/0.1/name> "Bob" .	
_:b <http://xmlns.com/foaf/0.1/knows> _:c .	
_:c <http://xmlns.com/foaf/0.1/name> "Eve" .	
_:b <http://xmlns.com/foaf/0.1/mbox> <bob@example.com> .
E X A M P L E 1 7
@prefix : <http://example.org/foo> .	
# the object of this triple is the RDF collection blank node	
:subject :predicate ( :a :b :c ) .	
!
# an empty collection value - rdf:nil	
:subject :predicate2 () .
h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ c o l l e c t i o n s
E X A M P L E 1 8
Collections
Predicates
述語
Dublin Core
h t t p : // d u b l i n c o r e . o r g / d o c u m e n t s / 2 0 1 2 / 0 6 / 1 4 / d c m i - t e r m s /
!
!
@prefix dc: <http://purl.org/dc/elements/1.1/> .	
@prefix dct: <http://purl.org/dc/terms/> .	
@prefix dctype: <http://purl.org/dc/dcmitype/> .
汎用的に使えるのが多くて便利
The Friend of a Friend (FOAF)
h t t p : // w w w. f o a f - p r o j e c t . o r g /
!
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
人間を記述するのに便利
RDF Schema
h t t p : // w w w. w 3 . o r g / T R / r d f - s c h e m a /
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
RDFの拡張で、
基本的なデータモデルの記述に便利。
ローレベルな感じ。
RDF Syntax
h t t p : // w w w. w 3 . o r g / T R / r d f - s y n t a x - g r a m m a r /
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
XML記述でなくTurtleだと、
あんまり使わないかも。
rdf:object, rdf:type, rdf:value rdf:first	
rdf:rest, rdf:nil
Data Catalog Vocabulary (DCAT)
h t t p : // w w w. w 3 . o r g / T R / v o c a b - d c a t /
@prefix dcat: <http://www.w3.org/ns/dcat#> .
データカタログのためのVocabulary
複数のデータを、
まとめて扱う時に便利
YAN Place Vocabulary
h t t p : // f p . y a f j p . o r g / y o k o h a m a _ a r t _ l o d / e v e n t _ r d f
YAN Event Vocabulary
ヨコハマ・LODのオリジナル語彙
h t t p : // f p . y a f j p . o r g / y o k o h a m a _ a r t _ l o d / p l a c e _ r d f
リ ン ク な ど
h t t p : // f p . y a f j p . o r g / y o k o h a m a _ a r t _ l o d
ヨコハマ・アート・LOD
h t t p : // o p e n d a t a . s h i g a . j p / h a n a b i 2 0 1 4 /
びわ湖大花火大会のオープンデータ。
アプリもたくさん、作られてる。
h t t p : // l o d . s fc . k e i o . a c . j p / c h a l l e n g e 2 0 1 4 /
お わ り

Contenu connexe

Tendances

Yahoo! JAPANのサービス開発を10倍早くした社内PaaS構築の今とこれから
Yahoo! JAPANのサービス開発を10倍早くした社内PaaS構築の今とこれからYahoo! JAPANのサービス開発を10倍早くした社内PaaS構築の今とこれから
Yahoo! JAPANのサービス開発を10倍早くした社内PaaS構築の今とこれから
Yahoo!デベロッパーネットワーク
 

Tendances (20)

ナレッジグラフ入門
ナレッジグラフ入門ナレッジグラフ入門
ナレッジグラフ入門
 
RDF Refineの使い方
RDF Refineの使い方RDF Refineの使い方
RDF Refineの使い方
 
Linked Open Data(LOD)の基本的な使い方
Linked Open Data(LOD)の基本的な使い方Linked Open Data(LOD)の基本的な使い方
Linked Open Data(LOD)の基本的な使い方
 
[part 2]ナレッジグラフ推論チャレンジ・Tech Live!
[part 2]ナレッジグラフ推論チャレンジ・Tech Live![part 2]ナレッジグラフ推論チャレンジ・Tech Live!
[part 2]ナレッジグラフ推論チャレンジ・Tech Live!
 
分散学習のあれこれ~データパラレルからモデルパラレルまで~
分散学習のあれこれ~データパラレルからモデルパラレルまで~分散学習のあれこれ~データパラレルからモデルパラレルまで~
分散学習のあれこれ~データパラレルからモデルパラレルまで~
 
グラフデータベース入門
グラフデータベース入門グラフデータベース入門
グラフデータベース入門
 
CRDT in 15 minutes
CRDT in 15 minutesCRDT in 15 minutes
CRDT in 15 minutes
 
NoSQLデータベースと位置情報
NoSQLデータベースと位置情報NoSQLデータベースと位置情報
NoSQLデータベースと位置情報
 
広告配信のための高速疎ベクトル検索エンジンの開発@WebDBフォーラム2015 #webdbf2015
広告配信のための高速疎ベクトル検索エンジンの開発@WebDBフォーラム2015 #webdbf2015広告配信のための高速疎ベクトル検索エンジンの開発@WebDBフォーラム2015 #webdbf2015
広告配信のための高速疎ベクトル検索エンジンの開発@WebDBフォーラム2015 #webdbf2015
 
居場所を隠すために差分プライバシーを使おう
居場所を隠すために差分プライバシーを使おう居場所を隠すために差分プライバシーを使おう
居場所を隠すために差分プライバシーを使おう
 
DockerコンテナでGitを使う
DockerコンテナでGitを使うDockerコンテナでGitを使う
DockerコンテナでGitを使う
 
Yahoo! JAPANのサービス開発を10倍早くした社内PaaS構築の今とこれから
Yahoo! JAPANのサービス開発を10倍早くした社内PaaS構築の今とこれからYahoo! JAPANのサービス開発を10倍早くした社内PaaS構築の今とこれから
Yahoo! JAPANのサービス開発を10倍早くした社内PaaS構築の今とこれから
 
Amazon RDSを参考にしたとりまチューニング
Amazon RDSを参考にしたとりまチューニングAmazon RDSを参考にしたとりまチューニング
Amazon RDSを参考にしたとりまチューニング
 
Openlink Virtuoso v01
Openlink Virtuoso v01Openlink Virtuoso v01
Openlink Virtuoso v01
 
SSII2020SS: 微分可能レンダリングの最新動向 〜「見比べる」ことによる3次元理解 〜​
SSII2020SS:  微分可能レンダリングの最新動向 〜「見比べる」ことによる3次元理解 〜​SSII2020SS:  微分可能レンダリングの最新動向 〜「見比べる」ことによる3次元理解 〜​
SSII2020SS: 微分可能レンダリングの最新動向 〜「見比べる」ことによる3次元理解 〜​
 
汎用Web API“SPARQL”でオープンデータ検索
汎用Web API“SPARQL”でオープンデータ検索汎用Web API“SPARQL”でオープンデータ検索
汎用Web API“SPARQL”でオープンデータ検索
 
ナレッジグラフとオントロジー
ナレッジグラフとオントロジーナレッジグラフとオントロジー
ナレッジグラフとオントロジー
 
多段階計算の型システムの基礎
多段階計算の型システムの基礎多段階計算の型システムの基礎
多段階計算の型システムの基礎
 
エキスパートPythonプログラミング改訂3版の読みどころ
エキスパートPythonプログラミング改訂3版の読みどころエキスパートPythonプログラミング改訂3版の読みどころ
エキスパートPythonプログラミング改訂3版の読みどころ
 
Docker Compose 徹底解説
Docker Compose 徹底解説Docker Compose 徹底解説
Docker Compose 徹底解説
 

オープンデータなんかでよく使うTurtle形式なんだけどXMLと違ってどう便利なの?

  • 1. オ ー プ ン デ ー タ な ん か で よ く 使 う Tu r t l e 形 式 な ん だ け ど X M L と 違 っ て ど う 便 利 な の ? @ S M A G C H
  • 2. h t t p : // w w w. w 3 . o r g / T R / v o c a b - d c a t / # e x a m p l e :catalog a dcat:Catalog ; dct:title "Imaginary Catalog" ; rdfs:label "Imaginary Catalog" ; foaf:homepage <http://example.org/catalog> ; dct:publisher :transparency-office ; dct:language <http://id.loc.gov/vocabulary/iso639-1/en> ; dcat:dataset :dataset-001 , :dataset-002 , :dataset-003 ; .
  • 5. h t t p : // e n . w i k i p e d i a . o r g / w i k i / R e s o u r c e _ D e s c r i p t i o n _ Fr a m e w o r k @prefix eric: <http://www.w3.org/People/EM/contact#> . @prefix contact: <http://www.w3.org/2000/10/swap/pim/contact#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . eric:me contact:fullName "Eric Miller" . eric:me contact:mailbox <mailto:e.miller123(at)example> . eric:me contact:personalTitle "Dr." . eric:me rdf:type contact:Person . <?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#" xmlns:eric="http://www.w3.org/ People/EM/contact#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me"> <contact:fullName>Eric Miller</contact:fullName> </rdf:Description> <rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me"> <contact:mailbox rdf:resource="mailto:e.miller123(at)example"/> </rdf:Description> <rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me"> <contact:personalTitle>Dr.</contact:personalTitle> </rdf:Description> <rdf:Description rdf:about="http://www.w3.org/People/EM/contact#me"> <rdf:type rdf:resource="http://www.w3.org/2000/10/swap/pim/contact#Person"/> </rdf:Description> </rdf:RDF>
  • 6. <http://www.w3.org/People/EM/contact#me> <http://www.w3.org/2000/10/swap/pim/contact#fullName> "Eric Miller" . @prefix eric: <http://www.w3.org/People/EM/contact#> . @prefix contact: <http://www.w3.org/2000/10/swap/pim/contact#> . ! eric:me contact:fullName "Eric Miller" . XMLのxmlnsみたいに、@prefixで エイリアスを作れる。 上の2つは同じ。
  • 7. E X A M P L E 1 @base <http://example.org/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix rel: <http://www.perceive.net/schemas/relationship/> . ! <#green-goblin> rel:enemyOf <#spiderman> ; a foaf:Person ; # in the context of the Marvel universe foaf:name "Green Goblin" . ! <#spiderman> rel:enemyOf <#green-goblin> ; a foaf:Person ; foaf:name "Spiderman", "Человек-паук"@ru . h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 2 _ s e c - i n t r o
  • 8. <http://example.org/#spiderman> <http://www.perceive.net/schemas/relationship/enemyOf> <http://example.org/#green-goblin> ; <http://xmlns.com/foaf/0.1/name> "Spiderman" . <http://example.org/#spiderman> <http://www.perceive.net/schemas/relationship/enemyOf> <http://example.org/#green-goblin> . ! <http://example.org/#spiderman> <http://xmlns.com/foaf/0.1/name> "Spiderman" . h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ p r e d i c a t e - l i s t s E X A M P L E 3 E X A M P L E 4 Predicate Lists
  • 9. <http://example.org/#spiderman> <http://xmlns.com/foaf/0.1/name> "Spiderman", "Человек-паук"@ru . <http://example.org/#spiderman> <http://xmlns.com/foaf/0.1/name> "Spiderman" . <http://example.org/#spiderman> <http://xmlns.com/foaf/0.1/name> "Человек-паук"@ru . h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ o b j e c t - l i s t s E X A M P L E 5 E X A M P L E 6 Object Lists
  • 10. @prefix somePrefix: <http://www.perceive.net/schemas/relationship/> . ! <http://example.org/#green-goblin> somePrefix:enemyOf <http://example.org/#spiderman> . PREFIX somePrefix: <http://www.perceive.net/schemas/relationship/> ! <http://example.org/#green-goblin> somePrefix:enemyOf <http://example.org/#spiderman> . h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ s e c - i r i E X A M P L E 7 E X A M P L E 8 IRIs @prefixと@baseは case sensitive 後からサポートされたSPARQLシンタックス。PREFIX, BASEは case insensitive。終わりのドットなし
  • 11. # A triple with all absolute IRIs <http://one.example/subject1> <http://one.example/predicate1> <http://one.example/object1> . ! @base <http://one.example/> . <subject2> <predicate2> <object2> . # relative IRIs, e.g. http://one.example/subject2 ! BASE <http://one.example/> <subject2> <predicate2> <object2> . # relative IRIs, e.g. http://one.example/subject2 ! @prefix p: <http://two.example/> . p:subject3 p:predicate3 p:object3 . # prefixed name, e.g. http://two.example/subject3 ! PREFIX p: <http://two.example/> p:subject3 p:predicate3 p:object3 . # prefixed name, e.g. http://two.example/subject3 ! @prefix p: <path/> . # prefix p: now stands for http://one.example/path/ p:subject4 p:predicate4 p:object4 . # prefixed name, e.g. http://one.example/path/subject4 ! @prefix : <http://another.example/> . # empty prefix :subject5 :predicate5 :object5 . # prefixed name, e.g. http://another.example/subject5 ! :subject6 a :subject7 . # same as :subject6 <http://www.w3.org/1999/02/22-rdf-syntax- ns#type> :subject7 . ! <http://伝言.example/?user=‫&أكرم‬amp;channel=R%26D> a :subject8 . # a multi-script subject IRI . h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ s e c - i r i E X A M P L E 9
  • 12. @prefix foaf: <http://xmlns.com/foaf/0.1/> . ! <http://example.org/#green-goblin> foaf:name "Green Goblin" . ! <http://example.org/#spiderman> foaf:name "Spiderman" . h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ l i t e r a l s E X A M P L E 1 0 Literals
  • 13. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix show: <http://example.org/vocab/show/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . ! show:218 rdfs:label "That Seventies Show"^^xsd:string . show:218 rdfs:label "That Seventies Show"^^<http://www.w3.org/2001/XMLSchema#string> . show:218 rdfs:label "That Seventies Show" . show:218 show:localName "That Seventies Show"@en . show:218 show:localName 'Cette Série des Années Soixante-dix'@fr . show:218 show:localName "Cette Série des Années Septante"@fr-be . show:218 show:blurb '''This is a multi-line literal with many quotes (""""") and up to two sequential apostrophes ('').''' . h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 4 _ t u r t l e - l i t e r a l s E X A M P L E 1 1 Quoted Literals
  • 14. @prefix : <http://example.org/elements> . <http://en.wikipedia.org/wiki/Helium> :atomicNumber 2 ; # xsd:integer :atomicMass 4.002602 ; # xsd:decimal :specificGravity 1.663E-4 . # xsd:double h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 4 _ a b b r e v E X A M P L E 1 2 Numbers & Booleans @prefix : <http://example.org/stats> . <http://somecountry.example/census2007> :isLandlocked false . # xsd:boolean E X A M P L E 1 3
  • 15. @prefix foaf: <http://xmlns.com/foaf/0.1/> . ! _:alice foaf:knows _:bob . _:bob foaf:knows _:alice . h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ B N o d e s E X A M P L E 1 4 Blank Nodes
  • 16. @prefix foaf: <http://xmlns.com/foaf/0.1/> . ! # Someone knows someone else, who has the name "Bob". [] foaf:knows [ foaf:name "Bob" ] . h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ u n l a b e l e d - b n o d e s E X A M P L E 1 5 Nesting Unlabeled Blank Nodes
  • 17. @prefix foaf: <http://xmlns.com/foaf/0.1/> . ! [ foaf:name "Alice" ] foaf:knows [ foaf:name "Bob" ; foaf:knows [ foaf:name "Eve" ] ; foaf:mbox <bob@example.com> ] . E X A M P L E 1 6 _:a <http://xmlns.com/foaf/0.1/name> "Alice" . _:a <http://xmlns.com/foaf/0.1/knows> _:b . _:b <http://xmlns.com/foaf/0.1/name> "Bob" . _:b <http://xmlns.com/foaf/0.1/knows> _:c . _:c <http://xmlns.com/foaf/0.1/name> "Eve" . _:b <http://xmlns.com/foaf/0.1/mbox> <bob@example.com> . E X A M P L E 1 7
  • 18. @prefix : <http://example.org/foo> . # the object of this triple is the RDF collection blank node :subject :predicate ( :a :b :c ) . ! # an empty collection value - rdf:nil :subject :predicate2 () . h t t p : // w w w. w 3 . o r g / T R / t u r t l e / # h 3 _ c o l l e c t i o n s E X A M P L E 1 8 Collections
  • 20. Dublin Core h t t p : // d u b l i n c o r e . o r g / d o c u m e n t s / 2 0 1 2 / 0 6 / 1 4 / d c m i - t e r m s / ! ! @prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix dct: <http://purl.org/dc/terms/> . @prefix dctype: <http://purl.org/dc/dcmitype/> . 汎用的に使えるのが多くて便利
  • 21. The Friend of a Friend (FOAF) h t t p : // w w w. f o a f - p r o j e c t . o r g / ! @prefix foaf: <http://xmlns.com/foaf/0.1/> . 人間を記述するのに便利
  • 22. RDF Schema h t t p : // w w w. w 3 . o r g / T R / r d f - s c h e m a / @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . RDFの拡張で、 基本的なデータモデルの記述に便利。 ローレベルな感じ。
  • 23. RDF Syntax h t t p : // w w w. w 3 . o r g / T R / r d f - s y n t a x - g r a m m a r / @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . XML記述でなくTurtleだと、 あんまり使わないかも。 rdf:object, rdf:type, rdf:value rdf:first rdf:rest, rdf:nil
  • 24. Data Catalog Vocabulary (DCAT) h t t p : // w w w. w 3 . o r g / T R / v o c a b - d c a t / @prefix dcat: <http://www.w3.org/ns/dcat#> . データカタログのためのVocabulary 複数のデータを、 まとめて扱う時に便利
  • 25. YAN Place Vocabulary h t t p : // f p . y a f j p . o r g / y o k o h a m a _ a r t _ l o d / e v e n t _ r d f YAN Event Vocabulary ヨコハマ・LODのオリジナル語彙 h t t p : // f p . y a f j p . o r g / y o k o h a m a _ a r t _ l o d / p l a c e _ r d f
  • 26. リ ン ク な ど
  • 27. h t t p : // f p . y a f j p . o r g / y o k o h a m a _ a r t _ l o d ヨコハマ・アート・LOD
  • 28. h t t p : // o p e n d a t a . s h i g a . j p / h a n a b i 2 0 1 4 / びわ湖大花火大会のオープンデータ。 アプリもたくさん、作られてる。
  • 29. h t t p : // l o d . s fc . k e i o . a c . j p / c h a l l e n g e 2 0 1 4 /