SlideShare a Scribd company logo
オ ー プ ン デ ー タ
な ん か で よ く 使 う
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 /
お わ り

More Related Content

What's hot

地図と認知プロセス -人間は地図を使って認知地図を獲得できるか-
地図と認知プロセス -人間は地図を使って認知地図を獲得できるか-地図と認知プロセス -人間は地図を使って認知地図を獲得できるか-
地図と認知プロセス -人間は地図を使って認知地図を獲得できるか-
Hirosaji
 
機械学習の定番プラットフォームSparkの紹介
機械学習の定番プラットフォームSparkの紹介機械学習の定番プラットフォームSparkの紹介
機械学習の定番プラットフォームSparkの紹介
Cloudera Japan
 
異次元のグラフデータベースNeo4j
異次元のグラフデータベースNeo4j異次元のグラフデータベースNeo4j
異次元のグラフデータベースNeo4j
昌桓 李
 
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
Takahiro Inoue
 
ナレッジグラフ入門
ナレッジグラフ入門ナレッジグラフ入門
ナレッジグラフ入門
KnowledgeGraph
 
Databricksを初めて使う人に向けて.pptx
Databricksを初めて使う人に向けて.pptxDatabricksを初めて使う人に向けて.pptx
Databricksを初めて使う人に向けて.pptx
otato
 
困らない程度のJDK入門
困らない程度のJDK入門困らない程度のJDK入門
困らない程度のJDK入門
Yohei Oda
 
Linked Open Data勉強会2020 前編:LODの基礎・作成・公開
Linked Open Data勉強会2020 前編:LODの基礎・作成・公開Linked Open Data勉強会2020 前編:LODの基礎・作成・公開
Linked Open Data勉強会2020 前編:LODの基礎・作成・公開
KnowledgeGraph
 
C22 Oracle Database を監視しようぜ! by 山下正/内山義夫
C22 Oracle Database を監視しようぜ! by 山下正/内山義夫C22 Oracle Database を監視しようぜ! by 山下正/内山義夫
C22 Oracle Database を監視しようぜ! by 山下正/内山義夫Insight Technology, Inc.
 
セマンティック・ウェブのためのRdf owl入門解説.ch5
セマンティック・ウェブのためのRdf owl入門解説.ch5セマンティック・ウェブのためのRdf owl入門解説.ch5
セマンティック・ウェブのためのRdf owl入門解説.ch5
Takahiro Kubo
 
Apache Kafka 0.11 の Exactly Once Semantics
Apache Kafka 0.11 の Exactly Once SemanticsApache Kafka 0.11 の Exactly Once Semantics
Apache Kafka 0.11 の Exactly Once Semantics
Yoshiyasu SAEKI
 
使ってみませんか?pg_hint_plan
使ってみませんか?pg_hint_plan使ってみませんか?pg_hint_plan
使ってみませんか?pg_hint_plan
NTT DATA OSS Professional Services
 
MLflowで学ぶMLOpsことはじめ
MLflowで学ぶMLOpsことはじめMLflowで学ぶMLOpsことはじめ
MLflowで学ぶMLOpsことはじめ
Kenichi Sonoda
 
1000台規模のHadoopクラスタをHive/Tezアプリケーションにあわせてパフォーマンスチューニングした話
1000台規模のHadoopクラスタをHive/Tezアプリケーションにあわせてパフォーマンスチューニングした話1000台規模のHadoopクラスタをHive/Tezアプリケーションにあわせてパフォーマンスチューニングした話
1000台規模のHadoopクラスタをHive/Tezアプリケーションにあわせてパフォーマンスチューニングした話
Yahoo!デベロッパーネットワーク
 
Siftによる特徴点抽出
Siftによる特徴点抽出Siftによる特徴点抽出
Siftによる特徴点抽出
Masato Nakai
 
[part 2]ナレッジグラフ推論チャレンジ・Tech Live!
[part 2]ナレッジグラフ推論チャレンジ・Tech Live![part 2]ナレッジグラフ推論チャレンジ・Tech Live!
[part 2]ナレッジグラフ推論チャレンジ・Tech Live!
KnowledgeGraph
 
並列分散処理基盤Hadoopの紹介と、開発者が語るHadoopの使いどころ (Silicon Valley x 日本 / Tech x Business ...
並列分散処理基盤Hadoopの紹介と、開発者が語るHadoopの使いどころ (Silicon Valley x 日本 / Tech x Business ...並列分散処理基盤Hadoopの紹介と、開発者が語るHadoopの使いどころ (Silicon Valley x 日本 / Tech x Business ...
並列分散処理基盤Hadoopの紹介と、開発者が語るHadoopの使いどころ (Silicon Valley x 日本 / Tech x Business ...
NTT DATA OSS Professional Services
 
オラクルのデータベースセキュリティへの取り組み [2021年2月版]
オラクルのデータベースセキュリティへの取り組み [2021年2月版]オラクルのデータベースセキュリティへの取り組み [2021年2月版]
オラクルのデータベースセキュリティへの取り組み [2021年2月版]
オラクルエンジニア通信
 
SQL Server 使いのための Azure Synapse Analytics - Spark 入門
SQL Server 使いのための Azure Synapse Analytics - Spark 入門SQL Server 使いのための Azure Synapse Analytics - Spark 入門
SQL Server 使いのための Azure Synapse Analytics - Spark 入門
Daiyu Hatakeyama
 
Dockerイメージ管理の内部構造
Dockerイメージ管理の内部構造Dockerイメージ管理の内部構造
Dockerイメージ管理の内部構造
Etsuji Nakai
 

What's hot (20)

地図と認知プロセス -人間は地図を使って認知地図を獲得できるか-
地図と認知プロセス -人間は地図を使って認知地図を獲得できるか-地図と認知プロセス -人間は地図を使って認知地図を獲得できるか-
地図と認知プロセス -人間は地図を使って認知地図を獲得できるか-
 
機械学習の定番プラットフォームSparkの紹介
機械学習の定番プラットフォームSparkの紹介機械学習の定番プラットフォームSparkの紹介
機械学習の定番プラットフォームSparkの紹介
 
異次元のグラフデータベースNeo4j
異次元のグラフデータベースNeo4j異次元のグラフデータベースNeo4j
異次元のグラフデータベースNeo4j
 
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
「GraphDB徹底入門」〜構造や仕組み理解から使いどころ・種々のGraphDBの比較まで幅広く〜
 
ナレッジグラフ入門
ナレッジグラフ入門ナレッジグラフ入門
ナレッジグラフ入門
 
Databricksを初めて使う人に向けて.pptx
Databricksを初めて使う人に向けて.pptxDatabricksを初めて使う人に向けて.pptx
Databricksを初めて使う人に向けて.pptx
 
困らない程度のJDK入門
困らない程度のJDK入門困らない程度のJDK入門
困らない程度のJDK入門
 
Linked Open Data勉強会2020 前編:LODの基礎・作成・公開
Linked Open Data勉強会2020 前編:LODの基礎・作成・公開Linked Open Data勉強会2020 前編:LODの基礎・作成・公開
Linked Open Data勉強会2020 前編:LODの基礎・作成・公開
 
C22 Oracle Database を監視しようぜ! by 山下正/内山義夫
C22 Oracle Database を監視しようぜ! by 山下正/内山義夫C22 Oracle Database を監視しようぜ! by 山下正/内山義夫
C22 Oracle Database を監視しようぜ! by 山下正/内山義夫
 
セマンティック・ウェブのためのRdf owl入門解説.ch5
セマンティック・ウェブのためのRdf owl入門解説.ch5セマンティック・ウェブのためのRdf owl入門解説.ch5
セマンティック・ウェブのためのRdf owl入門解説.ch5
 
Apache Kafka 0.11 の Exactly Once Semantics
Apache Kafka 0.11 の Exactly Once SemanticsApache Kafka 0.11 の Exactly Once Semantics
Apache Kafka 0.11 の Exactly Once Semantics
 
使ってみませんか?pg_hint_plan
使ってみませんか?pg_hint_plan使ってみませんか?pg_hint_plan
使ってみませんか?pg_hint_plan
 
MLflowで学ぶMLOpsことはじめ
MLflowで学ぶMLOpsことはじめMLflowで学ぶMLOpsことはじめ
MLflowで学ぶMLOpsことはじめ
 
1000台規模のHadoopクラスタをHive/Tezアプリケーションにあわせてパフォーマンスチューニングした話
1000台規模のHadoopクラスタをHive/Tezアプリケーションにあわせてパフォーマンスチューニングした話1000台規模のHadoopクラスタをHive/Tezアプリケーションにあわせてパフォーマンスチューニングした話
1000台規模のHadoopクラスタをHive/Tezアプリケーションにあわせてパフォーマンスチューニングした話
 
Siftによる特徴点抽出
Siftによる特徴点抽出Siftによる特徴点抽出
Siftによる特徴点抽出
 
[part 2]ナレッジグラフ推論チャレンジ・Tech Live!
[part 2]ナレッジグラフ推論チャレンジ・Tech Live![part 2]ナレッジグラフ推論チャレンジ・Tech Live!
[part 2]ナレッジグラフ推論チャレンジ・Tech Live!
 
並列分散処理基盤Hadoopの紹介と、開発者が語るHadoopの使いどころ (Silicon Valley x 日本 / Tech x Business ...
並列分散処理基盤Hadoopの紹介と、開発者が語るHadoopの使いどころ (Silicon Valley x 日本 / Tech x Business ...並列分散処理基盤Hadoopの紹介と、開発者が語るHadoopの使いどころ (Silicon Valley x 日本 / Tech x Business ...
並列分散処理基盤Hadoopの紹介と、開発者が語るHadoopの使いどころ (Silicon Valley x 日本 / Tech x Business ...
 
オラクルのデータベースセキュリティへの取り組み [2021年2月版]
オラクルのデータベースセキュリティへの取り組み [2021年2月版]オラクルのデータベースセキュリティへの取り組み [2021年2月版]
オラクルのデータベースセキュリティへの取り組み [2021年2月版]
 
SQL Server 使いのための Azure Synapse Analytics - Spark 入門
SQL Server 使いのための Azure Synapse Analytics - Spark 入門SQL Server 使いのための Azure Synapse Analytics - Spark 入門
SQL Server 使いのための Azure Synapse Analytics - Spark 入門
 
Dockerイメージ管理の内部構造
Dockerイメージ管理の内部構造Dockerイメージ管理の内部構造
Dockerイメージ管理の内部構造
 

オープンデータなんかでよく使う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 /