• 検索結果がありません。

PowerPoint Presentation

N/A
N/A
Protected

Academic year: 2021

シェア "PowerPoint Presentation"

Copied!
41
0
0

読み込み中.... (全文を見る)

全文

(1)
(2)

2001年

2006年

2010年

Web ページ Google リッチスニペット YAHOO! SearchMonkey Dapper Piggy Bank スクレイピング GRDDL RDFa HTML5 microdata アノテーション microformats 生命科学・医療 地図・政府 メディア ライブラリ

Linked Open Data (LOD) オープン・データ

政府データ 科学データ 音楽データ 写真データ 米国連邦政府 英国政府 Science Commons MusicBrainz Flickr Folksonomy Wikipedia 集合知

(3)

XML(自由)→RDF(固定)

• XML文書で使用されるタグは任意.

• ソフトウェア(エージェント)にとって理解不能.

• タグ名の選択,モデル使用法は千差万別.

• 単純ではあるがメタデータ記述形式を統一したも

のがRDF

• RDF上に構築されるRDFスキーマ,オントロジー

を通してソフトウェア(エージェント)が情報の意味

が理解できる

(4)

山口高平が

http://www.yamaguti.ae.keio.ac.jp

というサイトを作成した

<is_creator>

<person>山口高平</person>

<web site>http://www.yamaguti…</web site>

</is_creator>

<home_page_by_author>

<web site>http://www.yamaguti…</web site>

<author>山口高平</author>

(5)

RDF基本データモデル(1)

(Resource Description Framework)

リソース:URIで識別可能な情報資源

プロパティ:リソースの特徴・属性,

リソース間の関係を記述するもの

ステートメント(文):

リソース+プロパティ+値,

リソース+プロパティ+リソースの組み合わせ

主語(Subject)+述語or動詞(Predicate)+目的語

(Object)を意味する.

(6)

URI

URI

URI

RDF基本データモデル(2)

主語 述語(動詞) 目的語

リソース プロパティ リソース

A君 設計する 情報システムユースケース

役職,スキル,... 入力,参照,出力,ツール, システム仕様,US仕様... 今は放置.あとで飛んだURI先で定義すればいよい. 段階的開発を可能にしている. IDがURIになっていることがSWの本質

(7)

RDFの基本データモデル(3)

• RDFの基本モデルは有向ラベル付きグラフ

– 主語,目的語をノードとし,述語をアークとして連結

– リソースノードは楕円,リテラルは長方形で示す

• リソースは,URIで参照

– 目的語はリソースまたはリテラル

– 主語,述語,目的語の組み合わせは,ステートメント

http://kanzaki.com

神崎 正英

dc:creator

リソース

プロパティ

リテラル

ステートメント

主語 述語 目的語

(8)

RDFの基本データモデル(4)

• 複数のステートメントを連結したRDF

(構造化モデル)

– 目的語がリソース:そのリソースを主語とみたてて新たなステート メントを作成可能 – 目的語ノードを主語として連結 – ノードから複数のアークが伸びてよい 上田 好き 猫 上田 好き 猫 黒 オス 性別 色

(9)

RDFの基本データモデル(5)

空白ノード

空白ノードは外部からは参照できないが、

「あ

る匿名のリソース」

としてトリプルの主語や目

的語になることはできる。

URI参照で名前付けをしないため、 外部からURIによって見つけることができない http://www.bb2.com ホームページ

URI参照による名前付けをしないノード

(10)

空白ノードと構造化グラフ(例1)

ID 氏名 ホームページ 住所 AA1 石川 www.aa1.com 東京 BB2 今井 www.bb2.com 神奈川 CC3 手島 www.cc3.com 東京 DD4 内藤 www.dd4.com 愛知

ID欄の値は主語ではなくプロパティの一つ。

BB2 http://www.bb2.com ID ホームページ ホームページ BB2 http://www.bb2.com

(11)

空白ノードと構造化グラフ(例2)

• 「

http://www.bb2.com

の作者は今井良で、そ

のメールアドレスは[email protected]」を

RDFのグラフ図で表す場合

「ある人物」を表す匿名の空白ノード

http://www.bb2.com 今井良 [email protected] 作者 氏名 メールアドレス

(12)

RDFの構文(1)

http://kanzaki.com 神崎正英 dc:creator <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://kanzaki.com"> <dc:creator>神崎正英</dc:creator> </rdf:Description> </rdf:RDF> @prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . <http://kanzaki.com> dc:creator "神崎正英" . <http://kanzaki.com> <http://purl.org/dc/elements/1.1/creator> “神崎正英" .

モデル

XML

Notation3

N-Triple

(13)

RDFのXML構文(基本モデル)

rdf: RDF Model&Syntax name space

Description要素:ステートメント

about属性:主語となるリソースのURI

Description要素内容:プロパティ(dc:creator)+値(神崎正英)

http://kanzaki.com

dc:creator

神崎正英

<rdf:Description rdf:about=“http://kanzaki.com">

<

dc:creator

>神崎正英</

dc:creator

>

</rdf:Description>

<rdf:Description

rdf:about=“http://kanzaki.com“

dc:creator

=“神崎正英”/>

短縮構文(要素内容を書かずに属性として記述)

(14)

RDFのXML構文(構造化モデル)

<rdf:RDF ...>

<rdf:Description rdf:about=“urn:isbn:4-8399-0454-5">

<dc:creator>神崎正英</dc:creator> <dc:publisher>

<rdf:Description rdf:about=" http://www.mycom.co.jp "> <ex:webmaster>Someone’s name</ex:webmaster> </rdf:Description> </dc:publisher> </rdf:Description> </rdf:RDF> urn:isbn:4-8399-0454-5 http://www.mycom.co.jp

神崎正英

Someone’s name

dc:creator dc:publisher ex:webmaster

(15)

練習問題1

• 「William の年齢は22歳である」という内

容をRDFモデルとXML構文で記述せよ.

• プロパティはAgeとする.

• 発生する問題は?

William

Age

22

<?xml version="1.0"?> <rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:mr3=http://mmm.semanticweb.org/mr3# xml:base="http://mmm.semanticweb.org/mr3#"> <rdf:Description rdf:ID="William"> <mr3:Age>22</mr3:Age> </rdf:Description> </rdf:RDF>

(16)

練習問題2

• 「William の父はCharlesである」という内容

をRDFモデルとXML構文で記述せよ.

• プロパティはhasFatherとする.

William

Charles

hasFather

<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:mr3=http://mmm.semanticweb.org/mr3# xml:base="http://mmm.semanticweb.org/mr3#"> <rdf:Description rdf:ID="William"> <mr3:hasFather rdf:resource="#Charles"/> </rdf:Description> </rdf:RDF>

(17)

練習問題3

• こころの作者は夏目漱石である.

• こころは小説である.

• 夏目漱石は作家である.

• すべての作家は人間である.

• 小説の作者は作家のみである.

• 作者を表すプロパティとして,

http://purl.org/dc/elements/1.1/creator

」を用いる

(18)

練習問題3 RDF(S)モデル

小説

作家

dc:creator

こころ

夏目漱石

小説

作家

dc:creator

人間

RDFS

RDF

リソースのタイプ

クラス

プロパティ

rdfs:domain: 小説

rdfs:range: 作家

dc → http://purl.org/dc/elements/1.1/

(19)

練習問題3 RDF/XML

<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:mr3="http://mmm.semanticweb.org/mr3#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="http://mmm.semanticweb.org/mr3#"> <rdfs:Class rdf:ID="作家"> <rdfs:subClassOf> <rdfs:Class rdf:ID="人間"/> </rdfs:subClassOf> </rdfs:Class> <rdfs:Class rdf:ID="小説"/> <rdf:Property rdf:about="http://purl.org/dc/elements/1.1/creator"> <rdfs:domain rdf:resource="#小説"/> <rdfs:range rdf:resource="#作家"/> </rdf:Property> <mr3:作家 rdf:ID="夏目漱石"/> <mr3:小説 rdf:ID="こころ"> <dc:creator rdf:resource="#夏目漱石"/> </mr3:小説> </rdf:RDF>

(20)
(21)

RDFS(スキーマ)

上田 好き たま 黒 オス 性別 色 上田リソース,たまリソースは, どのようなカテゴリに属するのか? → 上田リソースは,人間クラスに属する → たまリソースは,猫クラスに属する  クラスの定義方法は?  リソースがクラスに属することを 表明方法は? 好き,性別,色などのプロパティ(述語)は, どのように定義するのか?

プロパティやリソースの

カテゴリを定義するための

基本的なメカニズムを提供

(22)

RDFS:語彙(タグ)に関するメタ知識

• RDFのモデル・構文に基づいて,RDFSが提供する以下のリ

ソース及びプロパティを用いて,プロパティ定義,クラス定義,

クラスのインスタンスの定義を行う

– rdf:は,http://www.w3.org/1999/02/22-rdf-syntax-ns#の接頭辞を示す – rdfs:は,http://www.w3.org/2000/01/rdf-schema#の接頭辞を示す

• RDFSの4基本クラス

– rdfs:Resource: すべてのものはリソース – rdfs:Class: クラス=基本的なものごとのカテゴリ – rdf:Property: プロパティ=物事の性質、関係 – rdfs:Literal: 文字列などのリテラル

• RDFSの7基本プロパティ

– あるクラスのインスタンスであることを示す:rdf:type – クラス,プロパティの派生関係を示す: rdfs:subClassOf,rdfs:subPropertyOf – プロパティの限量定義: rdfs:range, rdfs:domain – 人間に理解できる情報: rdfs:label, rdfs:comment

(23)

RDFSクラスの作り方

RDFSもRDFモデル(SPO)的に考えて作成する.

① rdf:typeプロパティの値をrdfs:Classとしてクラスを

作る(クラスはrdfs:Classのインスタンスとする)

②簡略法<rdfs:Class …></rdfs:Class>

<rdf:Description rdf:ID=“動物">

<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema #Class"/> or <rdf:type rdf:resoucre=“&rdfs;Class”/> <rdfs:subClassOf rdf:resource=“#生物"/> </rdf:Description> <rdfs:Class rdf:ID=“犬"> <rdfs:subClassOf rdf:resource=“#動物"/> </rdfs:Class> 生物 動物 犬

is-a

is-a

(24)

RDF/XMLの省略記述

• RDFのXML構文では,rdf:typeでタイプを指定し

たノード(型付きノード)は,rdf:Description要素を

タイプ名で置き換えることができる

<rdf:Description rdf:ID="Symphony">

<rdf:type rdf:resource=" http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Music"/>

</rdf:Description>

<rdfs:Class rdf:ID="Symphony">

<rdfs:subClassOf rdf:resource="#Music"/> </rdfs:Class>

(25)

EX:Personクラスを作ろう

<rdf:Description rdf:ID=“Person”>

<rdf:type rdf:resource=“&rdfs;Class”/>

<rdfs:subClassof rdf:resource=“rdfs;Resource”/>

<rdfs:Class ID=“Person”>

<rdfs:subClassof rdf:resource=“rdfs;Resource”/>

</rdfs:Class>

(26)

RDFSプロパティ定義

• プロパティはクラスに従属せずグローバル

– OOP言語のクラスにおけるプロパティ定義と異なる概念

• プロパティの継承、適用範囲の定義

– 上位プロパティを継承する

rdfs:subPropertyOf

– 定義域(主語の範囲)を定義する

rdfs:domain

– 値域(目的語の範囲)を定義する

rdfs:range

<rdf:Property rdf:ID=“好き"> <rdfs:subPropertyOf rdf:resource=“..."/> <rdfs:domain rdf:resource=“#人間"/> <rdfs:range rdf:resource=“#猫"/> </rdf:Property>

(27)

RDFSインスタンス定義

• rdf:typeによる型指定

– 定義したクラスのインスタンスであることを

rdf:typeによって示す

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="#たま"> <rdf:type rdf:resource="#猫"/> </rdf:Description> <rdf:Description rdf:about="#上田"> <rdf:type rdf:resource="#人間"/> <好き rdf:resource="#たま"/> </rdf:Description> </rdf:RDF> 上田 好き rdf:type 「上田」というリソースのカテゴリが人間, 「たま」というリソースのカテゴリが猫 であることをあらわしている たま 人間 猫 rdf:type

(28)

プロパティのdomainとrange は?

rdf:type はrdf:Property の一種であり,

rdfs:domainはresourceであり,

rdfs:rangeはclassである.

rdfs:subClassOf,rdfs:subPropertyOf

rdfs:label, rdfs:commentも同様に考えよ.

(29)

RDF/RDFS

William

Charles

subject Resourcepredicate

Property) object(Literal) hasFather statement

Model

Syntax

<rdf:Description about=“William”> <hasFather>Charles<hasFather/> <rdf:type resource=“Person”/> </rdf:Description> Resource Property Literal

Person

rdf:type object(Resource) <rdf:Class rdf:about=“Person”> <rdfs:subClassOf resource=“&rdfs;Resource”/> </rdf:Class> <rdf:Property rdf:about=“hasFather”> </rdf:Property>

Syntax

Model

Person

hasFather

rdfs:Class

rdf:Property

rdf:type rdf:type

rdfs:Resource

rdfs:subClassOf (Class) (Property)

RDF

RDFS

(30)

W3Cから提供されているRDFツール IsaViz

<rdf:RDF xmlns:rdfs=“…rdf-schema#"> <rdfs:Class rdf:about="http://purl.org/rss/1.0..." rdfs:label=“…“></rdfs:Class> <rdf:Property rdf:about="http://purl.org/rss/1.0..." rdfs:label=“…“></rdf:Property> </rdf:RDF> <rdf:RDF xmlns:rdfs=“…rdf-syntax-ns”> <image rdf:about="http://..."> <title>…</title> <link>http://…</link> </image>… </rdf:RDF>

RDFS/XML

RDF/XML

RDF + RDFS

(31)

www.yamaguti.comp.ae.keio.ac.jp

MMM project をクリック

(32)

OWL

Web Ontology Language

(33)

OWL

• RDFとRDFSを基礎として,

Webに存在するものご

との分類体系(クラス)やその関係,

さらにはそれ

を推論していくためのルールを定義するオントロ

ジー言語

• 中央集約でない語彙のネットワーク

– Webでは各地で独自の語彙定義が行われる

– これらを変更することなく,統合・発展させるメカニズム

– 継承関係、相互関係などに基づく簡単な推論

– OWL-Lite, OWL-DL, OWL-Full

Symphony

Sinfonie

A:Symphony = B:Sinfonie

(34)

OWLの基本構成

• ヘッダ要素

– バージョン情報と他のオントロジーのインポー

トを記述

• クラス要素

– オブジェクトのクラスを定義

• プロパティ要素

– プロパティを定義

• インスタンス(個体: Individual)

(35)

ヘッダ要素

• ヘッダはowl:Ontology要素として記述 – owl:は,http://www.w3.org/2002/07/owl#の接頭辞 • OWL以外のRDF要素を使ったメタデータなども埋め込むことができる – 例: Dublin Core • owl:versionInfo要素の内容は任意の文字列で,オントロジーの意味に は無関係 • owl:imports要素は他のオントロジーを再利用することができ,拡張性や 相互運用性のための機能 • その他の要素 – owl:priorVersion、owl:backwardCompatibleWith、owl:incompatibleWith <owl:Ontology rdf:about=""> <owl:versionInfo>webont.html, v.0.9; 2002-08-25 Exp</owl:versionInfo> <owl:imports rdf:resource="http://www.w3.org/2002/07/owl"/> <dc:creator>KANZAKI, Masahide</dc:creator> </owl:Ontology>

(36)

OWLクラス定義の概要

• スキーマとは異なるレイヤーとしてのClass

– owl:Class要素によるクラス定義

• クラス同士の関係

– rdfs:subClassOf, owl:disjointWith, owl:equivalentClass ,

owl:oneOf

• クラスの集合(論理組合せ)としての定義

– owl:intersectionOf, owl:unionOf, owl:complementOf

• クラス内でのプロパティの限定

– 制約のタイプ

• owl:allValuesFrom, owl:someValuesFrom, owl:hasValue

– 出現回数の制約

(37)

OWLクラス定義の例

• クラス同士の関係

• クラスの組み合わせ

<owl:Class rdf:ID="Symphony"> <rdfs:subClassOf rdf:resource="#Music"/> <owl:equivalentClass rdf:resource="http://….#Sinfonie"/> </owl:Class> <owl:Class rdf:ID="XHTML"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#XML"/> <owl:Class rdf:about="#HTML"/> </owl:intersectionOf> </owl:Class> Symphonyクラスは Sinfonieクラスと 等しい関係 XHTMLクラスは XMLクラスと HTMLクラスの 共通部分に一致. 論理積.

(38)

クラスでのプロパティの制約

• クラス内のowl:onRestriction要素

– 対象とするプロパティをowl:onProperty要素で

指定

– グローバルなプロパティがこのクラス内で受け

る制約を定義

<owl:Class rdf:ID="Person"> <rdfs:subClassOf rdf:resource="#Animal"/> <rdfs:subClassOf> <owl:Restriction owl:cardinarity="1"> <owl:onProperty rdf:resource="#hasRealName"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> 「Person」というクラスは 「Animal」のサブクラスで、 「hasRealName」というプロパティ の値は1つだけである

(39)

OWLプロパティ定義の概要

• RDFSを用いた基本定義

– rdfs:subPropertyOf, rdfs:range, rdfs:domain

• プロパティ同士の関係

– equivalentProperty , inverseOf

• プロパティのタイプ

– ObjectProperty

• オブジェクトを別のオブジェクトと関連づける

• TransitiveProperty, SymmetricProperty, FunctionalProperty, InverseFunctionalProperty

– DatatypeProperty

• オブジェクトをデータタイプ値に結びつける <owl:ObjectProperty rdf:ID="hasChild"> <owl:inverseOf rdf:resource="#hasParent"/> </owl:ObjectProperty> 「hasChild」というプロパティは 「hasParent」の反対の関係 データタイプ値

(40)

OWLプロパティの例

• owl:TransitiveProperty

– 「子孫」プロパティのように、P(x,y)とP(y,z)が真ならP(x,z)も真であ るという具合に関係が推移していくプロパティ。

• owl:SymmetricProperty

– 「夫婦」プロパティのように、P(x,y)⇔P(y,x)が成り立つプロパティ

• owl:FunctionalProperty

– P(x,y)において、xについてただひとつのyしか対応しない – maxCardinality="1"と同じ

• owl:InverseFunctionalProperty

– P(x,y)において、yの値は特定のxにしか適用できない – IDとして機能するプロパティ <owl:TransitiveProperty rdf:ID="hasOffspring"> <owl:inverseOf rdf:resource="#hasAncestor"/> </owl:TransitiveProperty> 「hasOffspring」というプロパティは 推移プロパティでかつ 「hasAncestor」の反対の関係

(41)

インスタンスあるいは個体 (Individual)

• クラスやプロパティの定義(抽象構文では公理 (Axioms) ) – 用語集,推論などを行うためのルール集のようなもの • インスタンスを記述する部分(抽象構文では事実 (Facts) ) – クラスやプロパティを用いて,(Webに)実際に存在するものを具体的に 描く • 通常のrdf:Description要素として記述 – rdf:type / 型付ノードで属するクラスを表現 – 他の個体との関係を示 • owl:sameIndividualAs – 2つの個体が同一であることを示す • owl:differentFrom – 2つの個体が別物であることを示す • owl:allDifferentm – 列挙した一連の個体が互いに別物であることを示す – そのほか任意のプロパティ要素を記述 <rdf:Description rdf:ID="Lewis_Carroll">

<owl:sameIndividualAs rdf:resource="#Charles_Lutwidge_Dodgson"/> <rdf:type rdf:resource="ex:Novelist"/>

<ex:isAuthorOf rdf:resource="#Alice_in_Wonderland"/> </rdf:Description>

参照

関連したドキュメント

&lt;7:3&gt; Remote 1 Temp T MIN R/W Contains the minimum temperature value for automatic fan speed control based on local temperature readings. T MIN can be programmed to

[r]

Type of notification: Customers must notify ON Semiconductor (&lt;[email protected] &gt;) in writing within 90 days of receipt of this notification if they consider

Type of notification: Customers must notify ON Semiconductor (&lt;[email protected] &gt;) in writing within 90 days of receipt of this notification if they consider

Type of notification: Customers must notify ON Semiconductor (&lt;[email protected] &gt;) in writing within 90 days of receipt of this notification if they consider

When value of &lt;StThr[3:0]&gt; is different from 0 and measured back emf signal is lower than &lt;StThr[3:0]&gt; threshold for 2 succeeding coil current zero−crossings (including