Upload
hoangdat
View
214
Download
0
Embed Size (px)
Citation preview
RDF
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
XML(自由)rarrRDF(固定)
bull XML文書で使用されるタグは任意
bull ソフトウェア(エージェント)にとって理解不能
bull タグ名の選択モデル使用法は千差万別
bull 単純ではあるがメタデータ記述形式を統一したものがRDF
bull RDF上に構築されるRDFスキーマオントロジー
を通してソフトウェア(エージェント)が情報の意味が理解できる
山口高平がhttpwwwyamagutiaekeioacjp
というサイトを作成した
ltis_creatorgt
ltpersongt山口高平ltpersongt
ltweb sitegthttpwwwyamagutihellipltweb sitegt
ltis_creatorgt
lthome_page_by_authorgt
ltweb sitegthttpwwwyamagutihellipltweb sitegt
ltauthorgt山口高平ltauthorgt
lthome_page_by_authorgt
RDF基本データモデル(1) (Resource Description Framework)
リソースURIで識別可能な情報資源 プロパティリソースの特徴属性 リソース間の関係を記述するもの ステートメント(文) リソース+プロパティ+値
リソース+プロパティ+リソースの組み合わせ主語(Subject)+述語or動詞(Predicate)+目的語(Object)を意味する
URI URI URI
RDF基本データモデル(2)
主語 述語(動詞) 目的語
リソース プロパティ リソース
A君 設計する 情報システムユースケース
役職スキル 入力参照出力ツール システム仕様US仕様
今は放置あとで飛んだURI先で定義すればいよい
段階的開発を可能にしている IDがURIになっていることがSWの本質
RDFの基本データモデル(3) bull RDFの基本モデルは有向ラベル付きグラフ
ndash 主語目的語をノードとし述語をアークとして連結
ndash リソースノードは楕円リテラルは長方形で示す
bull リソースはURIで参照
ndash 目的語はリソースまたはリテラル
ndash 主語述語目的語の組み合わせはステートメント
httpkanzakicom 神崎 正英
dccreator
リソース プロパティ
リテラル
ステートメント
主語 述語 目的語
RDFの基本データモデル(4)
bull 複数のステートメントを連結したRDF(構造化モデル) ndash 目的語がリソースそのリソースを主語とみたてて新たなステートメントを作成可能
ndash 目的語ノードを主語として連結
ndash ノードから複数のアークが伸びてよい
上田 猫 好き
上田 好き 猫
黒
オス 性別
色
URI URI URI
RDFの基本データモデル(5) 空白ノード
空白ノードは外部からは参照できないが「ある匿名のリソース」としてトリプルの主語や目的語になることはできる
URI参照で名前付けをしないため
外部からURIによって見つけることができない
httpwwwbb2com ホームページ
URI参照による名前付けをしないノード
空白ノードと構造化グラフ(例1)
ID 氏名 ホームページ 住所
AA1 石川 wwwaa1com 東京
BB2 今井 wwwbb2com 神奈川
CC3 手島 wwwcc3com 東京
DD4 内藤 wwwdd4com 愛知
ID欄の値は主語ではなくプロパティの一つ
BB2
httpwwwbb2com
ID
ホームページ
ホームページ BB2 httpwwwbb2com
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
XML(自由)rarrRDF(固定)
bull XML文書で使用されるタグは任意
bull ソフトウェア(エージェント)にとって理解不能
bull タグ名の選択モデル使用法は千差万別
bull 単純ではあるがメタデータ記述形式を統一したものがRDF
bull RDF上に構築されるRDFスキーマオントロジー
を通してソフトウェア(エージェント)が情報の意味が理解できる
山口高平がhttpwwwyamagutiaekeioacjp
というサイトを作成した
ltis_creatorgt
ltpersongt山口高平ltpersongt
ltweb sitegthttpwwwyamagutihellipltweb sitegt
ltis_creatorgt
lthome_page_by_authorgt
ltweb sitegthttpwwwyamagutihellipltweb sitegt
ltauthorgt山口高平ltauthorgt
lthome_page_by_authorgt
RDF基本データモデル(1) (Resource Description Framework)
リソースURIで識別可能な情報資源 プロパティリソースの特徴属性 リソース間の関係を記述するもの ステートメント(文) リソース+プロパティ+値
リソース+プロパティ+リソースの組み合わせ主語(Subject)+述語or動詞(Predicate)+目的語(Object)を意味する
URI URI URI
RDF基本データモデル(2)
主語 述語(動詞) 目的語
リソース プロパティ リソース
A君 設計する 情報システムユースケース
役職スキル 入力参照出力ツール システム仕様US仕様
今は放置あとで飛んだURI先で定義すればいよい
段階的開発を可能にしている IDがURIになっていることがSWの本質
RDFの基本データモデル(3) bull RDFの基本モデルは有向ラベル付きグラフ
ndash 主語目的語をノードとし述語をアークとして連結
ndash リソースノードは楕円リテラルは長方形で示す
bull リソースはURIで参照
ndash 目的語はリソースまたはリテラル
ndash 主語述語目的語の組み合わせはステートメント
httpkanzakicom 神崎 正英
dccreator
リソース プロパティ
リテラル
ステートメント
主語 述語 目的語
RDFの基本データモデル(4)
bull 複数のステートメントを連結したRDF(構造化モデル) ndash 目的語がリソースそのリソースを主語とみたてて新たなステートメントを作成可能
ndash 目的語ノードを主語として連結
ndash ノードから複数のアークが伸びてよい
上田 猫 好き
上田 好き 猫
黒
オス 性別
色
URI URI URI
RDFの基本データモデル(5) 空白ノード
空白ノードは外部からは参照できないが「ある匿名のリソース」としてトリプルの主語や目的語になることはできる
URI参照で名前付けをしないため
外部からURIによって見つけることができない
httpwwwbb2com ホームページ
URI参照による名前付けをしないノード
空白ノードと構造化グラフ(例1)
ID 氏名 ホームページ 住所
AA1 石川 wwwaa1com 東京
BB2 今井 wwwbb2com 神奈川
CC3 手島 wwwcc3com 東京
DD4 内藤 wwwdd4com 愛知
ID欄の値は主語ではなくプロパティの一つ
BB2
httpwwwbb2com
ID
ホームページ
ホームページ BB2 httpwwwbb2com
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
XML(自由)rarrRDF(固定)
bull XML文書で使用されるタグは任意
bull ソフトウェア(エージェント)にとって理解不能
bull タグ名の選択モデル使用法は千差万別
bull 単純ではあるがメタデータ記述形式を統一したものがRDF
bull RDF上に構築されるRDFスキーマオントロジー
を通してソフトウェア(エージェント)が情報の意味が理解できる
山口高平がhttpwwwyamagutiaekeioacjp
というサイトを作成した
ltis_creatorgt
ltpersongt山口高平ltpersongt
ltweb sitegthttpwwwyamagutihellipltweb sitegt
ltis_creatorgt
lthome_page_by_authorgt
ltweb sitegthttpwwwyamagutihellipltweb sitegt
ltauthorgt山口高平ltauthorgt
lthome_page_by_authorgt
RDF基本データモデル(1) (Resource Description Framework)
リソースURIで識別可能な情報資源 プロパティリソースの特徴属性 リソース間の関係を記述するもの ステートメント(文) リソース+プロパティ+値
リソース+プロパティ+リソースの組み合わせ主語(Subject)+述語or動詞(Predicate)+目的語(Object)を意味する
URI URI URI
RDF基本データモデル(2)
主語 述語(動詞) 目的語
リソース プロパティ リソース
A君 設計する 情報システムユースケース
役職スキル 入力参照出力ツール システム仕様US仕様
今は放置あとで飛んだURI先で定義すればいよい
段階的開発を可能にしている IDがURIになっていることがSWの本質
RDFの基本データモデル(3) bull RDFの基本モデルは有向ラベル付きグラフ
ndash 主語目的語をノードとし述語をアークとして連結
ndash リソースノードは楕円リテラルは長方形で示す
bull リソースはURIで参照
ndash 目的語はリソースまたはリテラル
ndash 主語述語目的語の組み合わせはステートメント
httpkanzakicom 神崎 正英
dccreator
リソース プロパティ
リテラル
ステートメント
主語 述語 目的語
RDFの基本データモデル(4)
bull 複数のステートメントを連結したRDF(構造化モデル) ndash 目的語がリソースそのリソースを主語とみたてて新たなステートメントを作成可能
ndash 目的語ノードを主語として連結
ndash ノードから複数のアークが伸びてよい
上田 猫 好き
上田 好き 猫
黒
オス 性別
色
URI URI URI
RDFの基本データモデル(5) 空白ノード
空白ノードは外部からは参照できないが「ある匿名のリソース」としてトリプルの主語や目的語になることはできる
URI参照で名前付けをしないため
外部からURIによって見つけることができない
httpwwwbb2com ホームページ
URI参照による名前付けをしないノード
空白ノードと構造化グラフ(例1)
ID 氏名 ホームページ 住所
AA1 石川 wwwaa1com 東京
BB2 今井 wwwbb2com 神奈川
CC3 手島 wwwcc3com 東京
DD4 内藤 wwwdd4com 愛知
ID欄の値は主語ではなくプロパティの一つ
BB2
httpwwwbb2com
ID
ホームページ
ホームページ BB2 httpwwwbb2com
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
山口高平がhttpwwwyamagutiaekeioacjp
というサイトを作成した
ltis_creatorgt
ltpersongt山口高平ltpersongt
ltweb sitegthttpwwwyamagutihellipltweb sitegt
ltis_creatorgt
lthome_page_by_authorgt
ltweb sitegthttpwwwyamagutihellipltweb sitegt
ltauthorgt山口高平ltauthorgt
lthome_page_by_authorgt
RDF基本データモデル(1) (Resource Description Framework)
リソースURIで識別可能な情報資源 プロパティリソースの特徴属性 リソース間の関係を記述するもの ステートメント(文) リソース+プロパティ+値
リソース+プロパティ+リソースの組み合わせ主語(Subject)+述語or動詞(Predicate)+目的語(Object)を意味する
URI URI URI
RDF基本データモデル(2)
主語 述語(動詞) 目的語
リソース プロパティ リソース
A君 設計する 情報システムユースケース
役職スキル 入力参照出力ツール システム仕様US仕様
今は放置あとで飛んだURI先で定義すればいよい
段階的開発を可能にしている IDがURIになっていることがSWの本質
RDFの基本データモデル(3) bull RDFの基本モデルは有向ラベル付きグラフ
ndash 主語目的語をノードとし述語をアークとして連結
ndash リソースノードは楕円リテラルは長方形で示す
bull リソースはURIで参照
ndash 目的語はリソースまたはリテラル
ndash 主語述語目的語の組み合わせはステートメント
httpkanzakicom 神崎 正英
dccreator
リソース プロパティ
リテラル
ステートメント
主語 述語 目的語
RDFの基本データモデル(4)
bull 複数のステートメントを連結したRDF(構造化モデル) ndash 目的語がリソースそのリソースを主語とみたてて新たなステートメントを作成可能
ndash 目的語ノードを主語として連結
ndash ノードから複数のアークが伸びてよい
上田 猫 好き
上田 好き 猫
黒
オス 性別
色
URI URI URI
RDFの基本データモデル(5) 空白ノード
空白ノードは外部からは参照できないが「ある匿名のリソース」としてトリプルの主語や目的語になることはできる
URI参照で名前付けをしないため
外部からURIによって見つけることができない
httpwwwbb2com ホームページ
URI参照による名前付けをしないノード
空白ノードと構造化グラフ(例1)
ID 氏名 ホームページ 住所
AA1 石川 wwwaa1com 東京
BB2 今井 wwwbb2com 神奈川
CC3 手島 wwwcc3com 東京
DD4 内藤 wwwdd4com 愛知
ID欄の値は主語ではなくプロパティの一つ
BB2
httpwwwbb2com
ID
ホームページ
ホームページ BB2 httpwwwbb2com
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDF基本データモデル(1) (Resource Description Framework)
リソースURIで識別可能な情報資源 プロパティリソースの特徴属性 リソース間の関係を記述するもの ステートメント(文) リソース+プロパティ+値
リソース+プロパティ+リソースの組み合わせ主語(Subject)+述語or動詞(Predicate)+目的語(Object)を意味する
URI URI URI
RDF基本データモデル(2)
主語 述語(動詞) 目的語
リソース プロパティ リソース
A君 設計する 情報システムユースケース
役職スキル 入力参照出力ツール システム仕様US仕様
今は放置あとで飛んだURI先で定義すればいよい
段階的開発を可能にしている IDがURIになっていることがSWの本質
RDFの基本データモデル(3) bull RDFの基本モデルは有向ラベル付きグラフ
ndash 主語目的語をノードとし述語をアークとして連結
ndash リソースノードは楕円リテラルは長方形で示す
bull リソースはURIで参照
ndash 目的語はリソースまたはリテラル
ndash 主語述語目的語の組み合わせはステートメント
httpkanzakicom 神崎 正英
dccreator
リソース プロパティ
リテラル
ステートメント
主語 述語 目的語
RDFの基本データモデル(4)
bull 複数のステートメントを連結したRDF(構造化モデル) ndash 目的語がリソースそのリソースを主語とみたてて新たなステートメントを作成可能
ndash 目的語ノードを主語として連結
ndash ノードから複数のアークが伸びてよい
上田 猫 好き
上田 好き 猫
黒
オス 性別
色
URI URI URI
RDFの基本データモデル(5) 空白ノード
空白ノードは外部からは参照できないが「ある匿名のリソース」としてトリプルの主語や目的語になることはできる
URI参照で名前付けをしないため
外部からURIによって見つけることができない
httpwwwbb2com ホームページ
URI参照による名前付けをしないノード
空白ノードと構造化グラフ(例1)
ID 氏名 ホームページ 住所
AA1 石川 wwwaa1com 東京
BB2 今井 wwwbb2com 神奈川
CC3 手島 wwwcc3com 東京
DD4 内藤 wwwdd4com 愛知
ID欄の値は主語ではなくプロパティの一つ
BB2
httpwwwbb2com
ID
ホームページ
ホームページ BB2 httpwwwbb2com
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
URI URI URI
RDF基本データモデル(2)
主語 述語(動詞) 目的語
リソース プロパティ リソース
A君 設計する 情報システムユースケース
役職スキル 入力参照出力ツール システム仕様US仕様
今は放置あとで飛んだURI先で定義すればいよい
段階的開発を可能にしている IDがURIになっていることがSWの本質
RDFの基本データモデル(3) bull RDFの基本モデルは有向ラベル付きグラフ
ndash 主語目的語をノードとし述語をアークとして連結
ndash リソースノードは楕円リテラルは長方形で示す
bull リソースはURIで参照
ndash 目的語はリソースまたはリテラル
ndash 主語述語目的語の組み合わせはステートメント
httpkanzakicom 神崎 正英
dccreator
リソース プロパティ
リテラル
ステートメント
主語 述語 目的語
RDFの基本データモデル(4)
bull 複数のステートメントを連結したRDF(構造化モデル) ndash 目的語がリソースそのリソースを主語とみたてて新たなステートメントを作成可能
ndash 目的語ノードを主語として連結
ndash ノードから複数のアークが伸びてよい
上田 猫 好き
上田 好き 猫
黒
オス 性別
色
URI URI URI
RDFの基本データモデル(5) 空白ノード
空白ノードは外部からは参照できないが「ある匿名のリソース」としてトリプルの主語や目的語になることはできる
URI参照で名前付けをしないため
外部からURIによって見つけることができない
httpwwwbb2com ホームページ
URI参照による名前付けをしないノード
空白ノードと構造化グラフ(例1)
ID 氏名 ホームページ 住所
AA1 石川 wwwaa1com 東京
BB2 今井 wwwbb2com 神奈川
CC3 手島 wwwcc3com 東京
DD4 内藤 wwwdd4com 愛知
ID欄の値は主語ではなくプロパティの一つ
BB2
httpwwwbb2com
ID
ホームページ
ホームページ BB2 httpwwwbb2com
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFの基本データモデル(3) bull RDFの基本モデルは有向ラベル付きグラフ
ndash 主語目的語をノードとし述語をアークとして連結
ndash リソースノードは楕円リテラルは長方形で示す
bull リソースはURIで参照
ndash 目的語はリソースまたはリテラル
ndash 主語述語目的語の組み合わせはステートメント
httpkanzakicom 神崎 正英
dccreator
リソース プロパティ
リテラル
ステートメント
主語 述語 目的語
RDFの基本データモデル(4)
bull 複数のステートメントを連結したRDF(構造化モデル) ndash 目的語がリソースそのリソースを主語とみたてて新たなステートメントを作成可能
ndash 目的語ノードを主語として連結
ndash ノードから複数のアークが伸びてよい
上田 猫 好き
上田 好き 猫
黒
オス 性別
色
URI URI URI
RDFの基本データモデル(5) 空白ノード
空白ノードは外部からは参照できないが「ある匿名のリソース」としてトリプルの主語や目的語になることはできる
URI参照で名前付けをしないため
外部からURIによって見つけることができない
httpwwwbb2com ホームページ
URI参照による名前付けをしないノード
空白ノードと構造化グラフ(例1)
ID 氏名 ホームページ 住所
AA1 石川 wwwaa1com 東京
BB2 今井 wwwbb2com 神奈川
CC3 手島 wwwcc3com 東京
DD4 内藤 wwwdd4com 愛知
ID欄の値は主語ではなくプロパティの一つ
BB2
httpwwwbb2com
ID
ホームページ
ホームページ BB2 httpwwwbb2com
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFの基本データモデル(4)
bull 複数のステートメントを連結したRDF(構造化モデル) ndash 目的語がリソースそのリソースを主語とみたてて新たなステートメントを作成可能
ndash 目的語ノードを主語として連結
ndash ノードから複数のアークが伸びてよい
上田 猫 好き
上田 好き 猫
黒
オス 性別
色
URI URI URI
RDFの基本データモデル(5) 空白ノード
空白ノードは外部からは参照できないが「ある匿名のリソース」としてトリプルの主語や目的語になることはできる
URI参照で名前付けをしないため
外部からURIによって見つけることができない
httpwwwbb2com ホームページ
URI参照による名前付けをしないノード
空白ノードと構造化グラフ(例1)
ID 氏名 ホームページ 住所
AA1 石川 wwwaa1com 東京
BB2 今井 wwwbb2com 神奈川
CC3 手島 wwwcc3com 東京
DD4 内藤 wwwdd4com 愛知
ID欄の値は主語ではなくプロパティの一つ
BB2
httpwwwbb2com
ID
ホームページ
ホームページ BB2 httpwwwbb2com
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFの基本データモデル(5) 空白ノード
空白ノードは外部からは参照できないが「ある匿名のリソース」としてトリプルの主語や目的語になることはできる
URI参照で名前付けをしないため
外部からURIによって見つけることができない
httpwwwbb2com ホームページ
URI参照による名前付けをしないノード
空白ノードと構造化グラフ(例1)
ID 氏名 ホームページ 住所
AA1 石川 wwwaa1com 東京
BB2 今井 wwwbb2com 神奈川
CC3 手島 wwwcc3com 東京
DD4 内藤 wwwdd4com 愛知
ID欄の値は主語ではなくプロパティの一つ
BB2
httpwwwbb2com
ID
ホームページ
ホームページ BB2 httpwwwbb2com
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
空白ノードと構造化グラフ(例1)
ID 氏名 ホームページ 住所
AA1 石川 wwwaa1com 東京
BB2 今井 wwwbb2com 神奈川
CC3 手島 wwwcc3com 東京
DD4 内藤 wwwdd4com 愛知
ID欄の値は主語ではなくプロパティの一つ
BB2
httpwwwbb2com
ID
ホームページ
ホームページ BB2 httpwwwbb2com
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
空白ノードと構造化グラフ(例2)
bull 「httpwwwbb2comの作者は今井良でそのメールアドレスはwebmasterimaicom」をRDFのグラフ図で表す場合
「ある人物」を表す匿名の空白ノード
httpwwwbb2com
今井良
webmasterimaicom
作者
氏名
メールアドレス
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFの構文(1)
httpkanzakicom 神崎正英
dccreator
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsdc=httppurlorgdcelements11gt
ltrdfDescription rdfabout=httpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfRDFgt
prefix dc lthttppurlorgdcelements11gt
prefix rdf lthttpwwww3org19990222-rdf-syntax-nsgt
lthttpkanzakicomgt
dccreator 神崎正英
lthttpkanzakicomgt lthttppurlorgdcelements11creatorgt
ldquo神崎正英
モデル
XML
Notation3
N-Triple
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFのXML構文(基本モデル)
rdf RDF ModelampSyntax name space
Description要素ステートメント
about属性主語となるリソースのURI
Description要素内容プロパティ(dccreator)+値(神崎正英)
httpkanzakicom 神崎正英 dccreator
ltrdfDescription rdfabout=ldquohttpkanzakicomgt
ltdccreatorgt神崎正英ltdccreatorgt
ltrdfDescriptiongt
ltrdfDescription
rdfabout=ldquohttpkanzakicomldquo dccreator=ldquo神崎正英rdquogt
短縮構文(要素内容を書かずに属性として記述)
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFのXML構文(構造化モデル)
ltrdfRDF gt
ltrdfDescription rdfabout=ldquournisbn4-8399-0454-5gt
ltdccreatorgt神崎正英ltdccreatorgt
ltdcpublishergt
ltrdfDescription rdfabout= httpwwwmycomcojp gt
ltexwebmastergtSomeonersquos nameltexwebmastergt
ltrdfDescriptiongt
ltdcpublishergt
ltrdfDescriptiongt
ltrdfRDFgt
urnisbn4-8399-0454-5
httpwwwmycomcojp
神崎正英
Someonersquos name
dccreator
dcpublisher
exwebmaster
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
練習問題1
bull 「William の年齢は22歳である」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはAgeとする
bull 発生する問題は
William
Age 22
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3Agegt22ltmr3Agegt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
練習問題2
bull 「William の父はCharlesである」という内容をRDFモデルとXML構文で記述せよ
bull プロパティはhasFatherとする
William Charles hasFather
ltxml version=10gt
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsmr3=httpmmmsemanticweborgmr3
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfDescription rdfID=Williamgt
ltmr3hasFather rdfresource=Charlesgt
ltrdfDescriptiongt
ltrdfRDFgt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
練習問題3
bull こころの作者は夏目漱石である
bull こころは小説である
bull 夏目漱石は作家である
bull すべての作家は人間である
bull 小説の作者は作家のみである
bull 作者を表すプロパティとして「httppurlorgdcelements11creator」を用いる
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
練習問題3 RDF(S)モデル
小説 作家 dccreator
こころ 夏目漱石
小説 作家 dccreator
人間
RDFS
RDF リソースのタイプ
クラス プロパティ
rdfsdomain 小説
rdfsrange 作家
dc rarr httppurlorgdcelements11
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
練習問題3 RDFXML
ltxml version=10gt
ltrdfRDF xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema
xmlnsowl=httpwwww3org200207owl
xmlnsmr3=httpmmmsemanticweborgmr3
xmlnsdc=httppurlorgdcelements11
xmlbase=httpmmmsemanticweborgmr3gt
ltrdfsClass rdfID=作家gt
ltrdfssubClassOfgt
ltrdfsClass rdfID=人間gt
ltrdfssubClassOfgt
ltrdfsClassgt
ltrdfsClass rdfID=小説gt
ltrdfProperty rdfabout=httppurlorgdcelements11creatorgt
ltrdfsdomain rdfresource=小説gt
ltrdfsrange rdfresource=作家gt
ltrdfPropertygt
ltmr3作家 rdfID=夏目漱石gt
ltmr3小説 rdfID=こころgt
ltdccreator rdfresource=夏目漱石gt
ltmr3小説gt
ltrdfRDFgt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFS
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFS(スキーマ)
上田 好き たま
黒
オス 性別
色
上田リソースたまリソースは
どのようなカテゴリに属するのか
rarr 上田リソースは人間クラスに属する
rarr たまリソースは猫クラスに属する
クラスの定義方法は
リソースがクラスに属することを
表明方法は
好き性別色などのプロパティ(述語)は
どのように定義するのか
プロパティやリソースの
カテゴリを定義するための
基本的なメカニズムを提供
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFS語彙(タグ)に関するメタ知識
bull RDFのモデル構文に基づいてRDFSが提供する以下のリソース及びプロパティを用いてプロパティ定義クラス定義クラスのインスタンスの定義を行う ndash rdfはhttpwwww3org19990222-rdf-syntax-nsの接頭辞を示す
ndash rdfsはhttpwwww3org200001rdf-schemaの接頭辞を示す
bull RDFSの4基本クラス ndash rdfsResource すべてのものはリソース
ndash rdfsClass クラス=基本的なものごとのカテゴリ
ndash rdfProperty プロパティ=物事の性質関係
ndash rdfsLiteral 文字列などのリテラル
bull RDFSの7基本プロパティ ndash あるクラスのインスタンスであることを示すrdftype
ndash クラスプロパティの派生関係を示す rdfssubClassOfrdfssubPropertyOf
ndash プロパティの限量定義 rdfsrange rdfsdomain
ndash 人間に理解できる情報 rdfslabel rdfscomment
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFSクラスの作り方
RDFSもRDFモデル(SPO)的に考えて作成する
① rdftypeプロパティの値をrdfsClassとしてクラスを
作る(クラスはrdfsClassのインスタンスとする)
②簡略法ltrdfsClass hellipgtltrdfsClassgt
ltrdfDescription rdfID=ldquo動物gt
ltrdftype rdfresource=httpwwww3org200001rdf-schema Classgt
or ltrdftype rdfresoucre=ldquoamprdfsClassrdquogt
ltrdfssubClassOf rdfresource=ldquo生物gt
ltrdfDescriptiongt
ltrdfsClass rdfID=ldquo犬gt
ltrdfssubClassOf rdfresource=ldquo動物gt
ltrdfsClassgt
生物
動物
犬
is-a
is-a
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFXMLの省略記述
bull RDFのXML構文ではrdftypeでタイプを指定したノード(型付きノード)はrdfDescription要素をタイプ名で置き換えることができる
ltrdfDescription rdfID=Symphonygt
ltrdftype rdfresource= httpwwww3org200001rdf-schemaClassgt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfDescriptiongt
ltrdfsClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltrdfsClassgt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
EXPersonクラスを作ろう
ltrdfDescription rdfID=ldquoPersonrdquogt
ltrdftype rdfresource=ldquoamprdfsClassrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClass ID=ldquoPersonrdquogt
ltrdfssubClassof rdfresource=ldquordfsResourcerdquogt
ltrdfsClassgt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFSプロパティ定義
bull プロパティはクラスに従属せずグローバル
ndash OOP言語のクラスにおけるプロパティ定義と異なる概念
bull プロパティの継承適用範囲の定義
ndash 上位プロパティを継承するrdfssubPropertyOf
ndash 定義域(主語の範囲)を定義するrdfsdomain
ndash 値域(目的語の範囲)を定義するrdfsrange
ltrdfProperty rdfID=ldquo好きgt
ltrdfssubPropertyOf rdfresource=ldquogt
ltrdfsdomain rdfresource=ldquo人間gt
ltrdfsrange rdfresource=ldquo猫gt
ltrdfPropertygt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFSインスタンス定義
bull rdftypeによる型指定
ndash 定義したクラスのインスタンスであることをrdftypeによって示す
ltrdfRDF
xmlnsrdf=httpwwww3org19990222-rdf-syntax-ns
xmlnsrdfs=httpwwww3org200001rdf-schema gt
ltrdfDescription rdfabout=たまgt
ltrdftype rdfresource=猫gt
ltrdfDescriptiongt
ltrdfDescription rdfabout=上田gt
ltrdftype rdfresource=人間gt
lt好き rdfresource=たまgt
ltrdfDescriptiongt
ltrdfRDFgt
上田 好き
rdftype
「上田」というリソースのカテゴリが人間
「たま」というリソースのカテゴリが猫
であることをあらわしている
たま
人間 猫
rdftype
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
プロパティのdomainとrange は
rdftype はrdfProperty の一種でありrdfsdomainはresourceであり
rdfsrangeはclassである
rdfssubClassOfrdfssubPropertyOf
rdfslabel rdfscommentも同様に考えよ
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
RDFRDFS
William Charles
subject
(Resource) predicate
(Property) object(Literal)
hasFather
statement
Model
Syntax
ltrdfDescription about=ldquoWilliamrdquogt
lthasFathergtCharleslthasFathergt
ltrdftype resource=ldquoPersonrdquogt
ltrdfDescriptiongt
Resource
Property
Literal
Person rdftype
object(Resource)
ltrdfClass rdfabout=ldquoPersonrdquogt
ltrdfssubClassOf resource=ldquoamprdfsResourcerdquogt
ltrdfClassgt
ltrdfProperty rdfabout=ldquohasFatherrdquogt
ltrdfPropertygt
Syntax
Model
Person
hasFather
rdfsClass
rdfProperty
rdftype
rdftype rdfsResource
rdfssubClassOf
(Class)
(Property)
RDF RDFS
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
W3Cから提供されているRDFツール IsaViz
ltrdfRDF xmlnsrdfs=ldquohelliprdf-schemagt
ltrdfsClass rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfsClassgt
ltrdfProperty rdfabout=httppurlorgrss10
rdfslabel=ldquohellipldquogtltrdfPropertygt
ltrdfRDFgt
ltrdfRDF xmlnsrdfs=ldquohelliprdf-syntax-nsrdquogt
ltimage rdfabout=httpgt
lttitlegthelliplttitlegt
ltlinkgthttphellipltlinkgt
ltimagegthellip
ltrdfRDFgt
RDFSXML
RDFXML
RDF + RDFS
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
wwwyamaguticompaekeioacjp
MMM project をクリック
RDFグラフィカルエディター MR3
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
OWL
Web Ontology Language
2004年2月10日に仕様確定
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
OWL bull RDFとRDFSを基礎としてWebに存在するものごとの分類体系(クラス)やその関係さらにはそれを推論していくためのルールを定義するオントロジー言語
bull 中央集約でない語彙のネットワーク
ndash Webでは各地で独自の語彙定義が行われる
ndash これらを変更することなく統合発展させるメカニズム
ndash 継承関係相互関係などに基づく簡単な推論
ndash OWL-Lite OWL-DL OWL-Full
Symphony Sinfonie
ASymphony = BSinfonie
A B
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
OWLの基本構成
bull ヘッダ要素
ndash バージョン情報と他のオントロジーのインポートを記述
bull クラス要素
ndash オブジェクトのクラスを定義
bull プロパティ要素
ndash プロパティを定義
bull インスタンス(個体 Individual)
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
ヘッダ要素
bull ヘッダはowlOntology要素として記述 ndash owlはhttpwwww3org200207owlの接頭辞
bull OWL以外のRDF要素を使ったメタデータなども埋め込むことができる ndash 例 Dublin Core
bull owlversionInfo要素の内容は任意の文字列でオントロジーの意味には無関係
bull owlimports要素は他のオントロジーを再利用することができ拡張性や相互運用性のための機能
bull その他の要素 ndash owlpriorVersionowlbackwardCompatibleWithowlincompatibleWith
ltowlOntology rdfabout=gt
ltowlversionInfogtwebonthtml v09 2002-08-25 ExpltowlversionInfogt
ltowlimports rdfresource=httpwwww3org200207owlgt
ltdccreatorgtKANZAKI Masahideltdccreatorgt
ltowlOntologygt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
OWLクラス定義の概要
bull スキーマとは異なるレイヤーとしてのClass ndash owlClass要素によるクラス定義
bull クラス同士の関係 ndash rdfssubClassOf owldisjointWith owlequivalentClass
owloneOf
bull クラスの集合(論理組合せ)としての定義 ndash owlintersectionOf owlunionOf owlcomplementOf
bull クラス内でのプロパティの限定 ndash 制約のタイプ
bull owlallValuesFrom owlsomeValuesFrom owlhasValue
ndash 出現回数の制約 bull owlcardinality owlminCardinality owlmaxCardinality
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
OWLクラス定義の例
bull クラス同士の関係
bull クラスの組み合わせ
ltowlClass rdfID=Symphonygt
ltrdfssubClassOf rdfresource=Musicgt
ltowlequivalentClass rdfresource=httphellipSinfoniegt
ltowlClassgt
ltowlClass rdfID=XHTMLgt
ltowlintersectionOf rdfparseType=Collectiongt
ltowlClass rdfabout=XMLgt
ltowlClass rdfabout=HTMLgt
ltowlintersectionOfgt
ltowlClassgt
Symphonyクラスは
Sinfonieクラスと
等しい関係
XHTMLクラスは
XMLクラスと
HTMLクラスの
共通部分に一致
論理積
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
クラスでのプロパティの制約
bull クラス内のowlonRestriction要素
ndash 対象とするプロパティをowlonProperty要素で指定
ndash グローバルなプロパティがこのクラス内で受ける制約を定義
ltowlClass rdfID=Persongt
ltrdfssubClassOf rdfresource=Animalgt
ltrdfssubClassOfgt
ltowlRestriction owlcardinarity=1gt
ltowlonProperty rdfresource=hasRealNamegt
ltowlRestrictiongt
ltrdfssubClassOfgt
ltowlClassgt
「Person」というクラスは
「Animal」のサブクラスで
「hasRealName」というプロパティ
の値は1つだけである
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
OWLプロパティ定義の概要 bull RDFSを用いた基本定義
ndash rdfssubPropertyOf rdfsrange rdfsdomain
bull プロパティ同士の関係 ndash equivalentProperty inverseOf
bull プロパティのタイプ ndash ObjectProperty
bull オブジェクトを別のオブジェクトと関連づける
bull TransitiveProperty SymmetricProperty FunctionalProperty InverseFunctionalProperty
ndash DatatypeProperty bull オブジェクトをデータタイプ値に結びつける
ltowlObjectProperty rdfID=hasChildgt
ltowlinverseOf rdfresource=hasParentgt
ltowlObjectPropertygt
「hasChild」というプロパティは
「hasParent」の反対の関係
データタイプ値
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
OWLプロパティの例
bull owlTransitiveProperty
ndash 「子孫」プロパティのようにP(xy)とP(yz)が真ならP(xz)も真であるという具合に関係が推移していくプロパティ
bull owlSymmetricProperty
ndash 「夫婦」プロパティのようにP(xy)hArrP(yx)が成り立つプロパティ
bull owlFunctionalProperty
ndash P(xy)においてxについてただひとつのyしか対応しない
ndash maxCardinality=1と同じ
bull owlInverseFunctionalProperty
ndash P(xy)においてyの値は特定のxにしか適用できない
ndash IDとして機能するプロパティ
ltowlTransitiveProperty rdfID=hasOffspringgt
ltowlinverseOf rdfresource=hasAncestorgt
ltowlTransitivePropertygt
「hasOffspring」というプロパティは
推移プロパティでかつ
「hasAncestor」の反対の関係
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt
インスタンスあるいは個体 (Individual)
bull クラスやプロパティの定義(抽象構文では公理 (Axioms) ) ndash 用語集推論などを行うためのルール集のようなもの
bull インスタンスを記述する部分(抽象構文では事実 (Facts) ) ndash クラスやプロパティを用いて(Webに)実際に存在するものを具体的に描く
bull 通常のrdfDescription要素として記述 ndash rdftype 型付ノードで属するクラスを表現
ndash 他の個体との関係を示 bull owlsameIndividualAs
ndash 2つの個体が同一であることを示す
bull owldifferentFrom ndash 2つの個体が別物であることを示す
bull owlallDifferentm ndash 列挙した一連の個体が互いに別物であることを示す
ndash そのほか任意のプロパティ要素を記述
ltrdfDescription rdfID=Lewis_Carrollgt
ltowlsameIndividualAs rdfresource=Charles_Lutwidge_Dodgsongt
ltrdftype rdfresource=exNovelistgt
ltexisAuthorOf rdfresource=Alice_in_Wonderlandgt
ltrdfDescriptiongt