RDF をプロパティグラフに
変換するマッピング言語 G2GML
2017/11/02
PGXユーザ勉強会#5
松本 翔太(matsusho)
1
RDF[1]とは?
Resource Description Framework
• セマンティックウェブ[2]のための枠組み
• 主語 述語 目的語の3つ組で関係グラフを記述
[1] W3C.org, https://www.w3.org/RDF/
[2] W3C.org, https://www.w3.org/2001/sw/
New York has the postal abbreviation NY.
urn:states:
New_York
NY
http://purl.org/dc/terms/alternative
例
各ノードやエッジのラベルは
文字列やURI
2
RDFの実用例
京都市オープンデータ
(https://data.city.kyoto.lg.jp/)
データ利活用のために多くの機関が公開
Wikidata(https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service)
Data.gov(https://www.data.gov/)
neXt prot (https://www.nextprot.org/)
3
RDFのクエリ言語SPARQL
PREFIX abc: <http://mynamespace.com/exampleOntologie#>
SELECT ?capital ?country
WHERE {
?x abc:cityname ?capital.
?y abc:countryname ?country.
?x abc:isCapitalOf ?y.
?y abc:isInContinent abc:africa.
}
※Wikipedia (https://ja.wikipedia.org/wiki/SPARQL) より引用
例:アフリカの国々の首都を得るSPARQL
?capital や ?country は変数
4
RDF vs Property Graph
どちらもグラフ構造を表現
• W3Cによって標準化
• セマンティックウェブの実現手段として
広まりつつある
• 基本構造(トリプル)が覚えやすい
RDFの利点
• ノードやエッジがプロパティを直接持てない
(回避策はあるが・・・)
=> 検索性能や構造の煩雑さにつながる
RDFの欠点
※他にもいくつか違いはあります。多重辺の有無など
5
G2GML Project (https://github.com/ryotas/g2gml)
RDFグラフ(の一部)をグラフDBに簡単にインポート!
目的
 マッピング言語G2GML
 プロパティグラフのための汎用フォーマットGPG
 G2GMLの処理エンジン
目標成果物
 ryotas
 matsusho
メンバー
6
G2GML Project (https://github.com/ryotas/g2gml)
RDFグラフ(の一部)をグラフDBに簡単にインポート!
目的
 マッピング言語G2GML
 プロパティグラフのための汎用フォーマットGPG
 G2GMLの処理エンジン
目標成果物
 ryotas
 matsusho
 他募集中!
メンバー
7
Implemented
in Node.js
インポートまでの流れ
G2GML
Engine
SPARQL
エンドポイント
G2GML
SPARQL
GPG
Translators
Import
Files
8
例:Linked ICGC の RDF スキーマ
※Linked ICGC (http://icgc.link/) より引用 9
例:Linked ICGC の RDF スキーマ
10
Example of G2GML
PREFIX icgc: <http://icgc.link/vocab/>
PREFIX icgc-class: <http://icgc.link/>
PREFIX faldo: <http://biohackathon.org/resource/faldo>
nodes:
donor:
type: S rdf:type icgc-class:Donor
label: S rdfs:label O
age: S icgc:age_at_diagnosis O
gender: S icgc:sex O
mutation:
type: S rdf:type icgc-class:Mutation
label: S rdfs:label O
start_position:
S faldo:region ?r . ?r faldo:begin ?b . ?b faldo:position O
edges:
has_mutation (donor, mutation):
?det icgc:donor ?donor . ?det icgc:mutation ?mutation
affects (mutation, effect):
?mutation ^icgc:mutation ?effect . ?effect icgc:gene_affected ?gene
Prefix定義
ノード定義
エッジ定義
11
Example of G2GML
PREFIX icgc: <http://icgc.link/vocab/>
PREFIX icgc-class: <http://icgc.link/>
PREFIX faldo: <http://biohackathon.org/resource/faldo>
nodes:
donor:
type: S rdf:type icgc-class:Donor
label: S rdfs:label O
age: S icgc:age_at_diagnosis O
gender: S icgc:sex O
mutation:
type: S rdf:type icgc-class:Mutation
label: S rdfs:label O
start_position:
S faldo:region ?r . ?r faldo:begin ?b . ?b faldo:position O
edges:
has_mutation (donor, mutation):
?det icgc:donor ?donor . ?det icgc:mutation ?mutation
affects (mutation, effect):
?mutation ^icgc:mutation ?effect . ?effect icgc:gene_affected ?gene
12
Nodes in G2GML
nodes:
donor:
type: S rdf:type icgc-class:Donor
label: S rdfs:label O
age: S icgc:age_at_diagnosis O
gender: S icgc:sex O
mutation:
type: S rdf:type icgc-class:Mutation
label: S rdfs:label O
start_position:
S faldo:region ?r . ?r faldo:begin ?b . ?b faldo:position O
13
Edges in G2GML
edges:
has_mutation (donor, mutation):
?det icgc:donor ?donor . ?det icgc:mutation ?mutation
affects (mutation, effect):
?mutation ^icgc:mutation ?effect . ?effect icgc:gene_affected ?gene
14
GPG
"nid" "property" "value"
"http://icgc.link/Donor/DO1" "type" "donor”
"http://icgc.link/Donor/DO10" "type" "donor”
…
"http://icgc.link/Donor/DO1" "age" "7"
"http://icgc.link/Donor/DO10" "age" "3"
…
"s_nid” "d_nid" "label"
"http://icgc.link/Donor/DO162" "http://icgc.link/Mutation/MU28469480" "has_mutation"
"http://icgc.link/Donor/DO162" "http://icgc.link/Mutation/MU40447273" "has_mutation”
…
15
デモを行います!
16
今後の展望
言語仕様の洗練、明確化
あわよくばW3Cに・・・
G2GMLエンジンの強化
性能調査
グラフDB間の比較、およびSPARQLとの比較
性能以外の面での比較
RDFより簡潔に表現できているか?
17

More Related Content

PPTX
PDF
PPTX
LODI/Linked Open Data連続講義 第1回 「オープンデータからLinked Open Dataへ」
PDF
ナレッジグラフ/LOD利用技術の入門(後編)
PDF
2013-05-29_FRBR&RDA勉強会復習スライド
PDF
Linked Open Data 作成支援ツールの紹介
PDF
RDF/OWLの概要及びOSS実装、及び活用イメージについて
LODI/Linked Open Data連続講義 第1回 「オープンデータからLinked Open Dataへ」
ナレッジグラフ/LOD利用技術の入門(後編)
2013-05-29_FRBR&RDA勉強会復習スライド
Linked Open Data 作成支援ツールの紹介
RDF/OWLの概要及びOSS実装、及び活用イメージについて

What's hot (7)

PPTX
GTFS (General Transit Feed Specification) について
PPTX
1st LODandOntology studysession aboutRDF
PDF
Linked Open Data勉強会2020 前編:LODの基礎・作成・公開
PPT
FOSS4G 2009 Tokyo (R and Geo) in Japanese
PPTX
PPT
LOD for Yokohama city budget plan
PDF
2013-06-13_FRBR&RDA勉強会復習スライド
GTFS (General Transit Feed Specification) について
1st LODandOntology studysession aboutRDF
Linked Open Data勉強会2020 前編:LODの基礎・作成・公開
FOSS4G 2009 Tokyo (R and Geo) in Japanese
LOD for Yokohama city budget plan
2013-06-13_FRBR&RDA勉強会復習スライド
Ad

Similar to RDF をプロパティグラフに 変換するマッピング言語 G2GML (20)

PDF
つながるデータShare
PDF
セマンテックウェブとRDFDB
PDF
ナレッジグラフ/LOD利用技術の入門(前編)
PDF
ナレッジグラフ入門
PDF
セマンティック・ウェブのためのRDF/OWL 入門 6章 後半
PDF
SPARQLから入門するLinked Open Data(LOD)ハンズオン 第1回
PDF
Rdf入門handout
PDF
SPARQLとMashup環境 (年岡先生)
PDF
XLWrapについてのご紹介
KEY
第5回LinkedData勉強会@yayamamo
PDF
汎用Web API“SPARQL”でオープンデータ検索
PDF
SPARQLでマッシュアップ -LOD活用のための技術紹介-
PPT
リンクトオープンデータ(LOD)の紹介と、その先にある参画・協働・復興促進
PDF
SPARQLから入門するLinked Open Data(LOD)ハンズオン 第2回
PPTX
Silkについて
PDF
SPARQLとMashup環境
PDF
セマンティック・ウェブのためのRDF/OWL入門 読書会 -3章-
PDF
LOD技術の概要と LinkData.orgを用いたLOD公開
PDF
『入門 ソーシャルデータ』9章
つながるデータShare
セマンテックウェブとRDFDB
ナレッジグラフ/LOD利用技術の入門(前編)
ナレッジグラフ入門
セマンティック・ウェブのためのRDF/OWL 入門 6章 後半
SPARQLから入門するLinked Open Data(LOD)ハンズオン 第1回
Rdf入門handout
SPARQLとMashup環境 (年岡先生)
XLWrapについてのご紹介
第5回LinkedData勉強会@yayamamo
汎用Web API“SPARQL”でオープンデータ検索
SPARQLでマッシュアップ -LOD活用のための技術紹介-
リンクトオープンデータ(LOD)の紹介と、その先にある参画・協働・復興促進
SPARQLから入門するLinked Open Data(LOD)ハンズオン 第2回
Silkについて
SPARQLとMashup環境
セマンティック・ウェブのためのRDF/OWL入門 読書会 -3章-
LOD技術の概要と LinkData.orgを用いたLOD公開
『入門 ソーシャルデータ』9章
Ad

RDF をプロパティグラフに 変換するマッピング言語 G2GML