セマンティックWeb - yamaguti.comp.ae.keio.ac.jp›ž目(Semantic... · HTML5 microdata...
-
Upload
trinhtuyen -
Category
Documents
-
view
216 -
download
0
Transcript of セマンティックWeb - yamaguti.comp.ae.keio.ac.jp›ž目(Semantic... · HTML5 microdata...
セマンティックWeb
TBLの当初のWeb構想
bull Information Management A Proposal (1989) by Tim Berners-Lee
httpwwww3orgHistory1989proposal-mswhtml bull 数千人が働く
bull 人々が入れ替わる
bull 組織は常に変化している
bull 情報欠落が起こっている ndash Where is this module used
ndash Who wrote this code Where does he work
ndash What documents exist about that concept
ndash Which laboratories are included in that project
ndash Which systems depend on this device
ndash What documents refer to this one
bull Hypertextによる情報の管理を提案
bull 一つの文書で巨大な組織のすべてのことを書くことは不可能
bull 組織は階層的で木構造だが情報は階層的には管理しにくい
bull キーワードでの検索では探しにくい
TBL 1st Proposal
Information Management A Proposal (1989)
bull リンクにタイプがあった ndash depends on
ndash is part of
ndash made
ndash refers to
ndash uses
ndash is an example of
bull データ解析を行いたかった ndash 自動的な解析
ndash 人の居ないdivisionやドキュメントのないソフトウェアの検索
ndash メーリングリストの自動生成
ndash 実際の組織の構造を導き出す
TBL 2nd Proposal (2001) Tim Berners Lee James Hendler Ora Lassila The Semantic Web httpwwwsciamcomarticlecfmarticleID=00048144-10D2-1C70-84A9809EC588EF21ampsc=I10032
bull Semantic Web
ndash Webを正しいHypertextシステムにする
ndash リンクにタイプがある
ndashデータ間の関係を書く
ndash文書だけでなくデータを取り扱う
ndashデータにも型がある
bull 自動的な解析を行うことができる
ndash推論可能にする
ldquoThe Semantic Web will globalize KR
just as the WWW globalized hypertext
WWWが登場する以前ハイパーテキストは一部の「理想家」だけが
熱心に取り組んでいる特殊な道具でした
知識表現や機械に理解可能な知識というコンセプトの現在も
とてもよく似た状況と言えそうです
「絶対の真実全ての物事を網羅する知識あらゆる可能性といった
中央集約型のコンセプト」から離れて限られた知識で何ができるか
というところからスタートすることで知識表現におけるWWW
すなわちセマンティックウェブへの未知が開けてくるというのです
By TBL
httpwwwsemanticweborgabouthtmlbigpicture
Big Picture for Semantic Web (2001)
セマンティックWebの世界(1)
①電話が鳴ったときエンターテインメントシステムは
ビートルズの 「We Can Work It Out 」を大音量で再生し
ていたPeteが電話に出るとボリューム設定ができる
他のローカル機器すべてにその電話機がメッセージを送信
し自動的に音量を下げた
②電話の相手は妹のLucyで病院からの連絡だった
「ママは専門医のところへ行って物理療法のための
診察を受けなくてはならないの週に2回程度ね
私はエージェントにアポイントを取ってもらうつもりよ」
と彼女は話したPeteは即座に車での送迎は自分が
請け負うと申し出た
セマンティックWebの世界(2)
③医師の推薦 私たちのエージェントはママに処方された治療法についての 情報を医師エージェントから即座に入手しその提供者の複数の リストを調べママの自宅から半径20マイル以内で信頼できる 評価サービスにおいて「きわめて良い」または「とても良い」という 評価を得ている加入済みの保険のプランでカバーできるところを チェックした ④スケジューリング アポイント設定が可能な日時(各提供者のウェブサイトを通じて (エージェントが配信している)とPeteやLucyの多忙な スケジュールを突き合わせて実際に設定可能なアポイント日時 を探し始めた
ZDNetエンタープライズ (20021217) httpwwwzdnetcojpenterprise
Opinion現実のものとなるセマンティックWeb
bull 人がHTMLページを要求するのではなく離れたコンピュータ同士が意味のある方法で会話できるWebをXMLよりさらに高いレベルでつくりあげようという「セマンティックWeb」が現実味を帯びてきたW3Cが取り組んでいるほか国防総省のDARPAも後押ししている
bull セマンティックWebは単なる騒動かもしれないしインターネットの将来かもしれない
人により意見が異なる
デビッドワインバーグの批判 (2002)
私が危惧するのはセマンティツクウェブがSGMLと同じ末路を辿る
のではないか-それも基本的に同じ理由でということである
メタデータの正規化が真に機能するのは高い報酬(Benefit)が得られ
管理権限が一カ所に集約されておりユーザに規範を遵守させやすい
ような限定的なアプリケーションにおいてである
そうでなければWebにおいてはうまく機能しないということだ
David Weinberge The Semantic Argument Web
Tim Berners-Lees dream of a Web of meaning is unlikely to happen
at least the way he thinks hellip
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
TBLの当初のWeb構想
bull Information Management A Proposal (1989) by Tim Berners-Lee
httpwwww3orgHistory1989proposal-mswhtml bull 数千人が働く
bull 人々が入れ替わる
bull 組織は常に変化している
bull 情報欠落が起こっている ndash Where is this module used
ndash Who wrote this code Where does he work
ndash What documents exist about that concept
ndash Which laboratories are included in that project
ndash Which systems depend on this device
ndash What documents refer to this one
bull Hypertextによる情報の管理を提案
bull 一つの文書で巨大な組織のすべてのことを書くことは不可能
bull 組織は階層的で木構造だが情報は階層的には管理しにくい
bull キーワードでの検索では探しにくい
TBL 1st Proposal
Information Management A Proposal (1989)
bull リンクにタイプがあった ndash depends on
ndash is part of
ndash made
ndash refers to
ndash uses
ndash is an example of
bull データ解析を行いたかった ndash 自動的な解析
ndash 人の居ないdivisionやドキュメントのないソフトウェアの検索
ndash メーリングリストの自動生成
ndash 実際の組織の構造を導き出す
TBL 2nd Proposal (2001) Tim Berners Lee James Hendler Ora Lassila The Semantic Web httpwwwsciamcomarticlecfmarticleID=00048144-10D2-1C70-84A9809EC588EF21ampsc=I10032
bull Semantic Web
ndash Webを正しいHypertextシステムにする
ndash リンクにタイプがある
ndashデータ間の関係を書く
ndash文書だけでなくデータを取り扱う
ndashデータにも型がある
bull 自動的な解析を行うことができる
ndash推論可能にする
ldquoThe Semantic Web will globalize KR
just as the WWW globalized hypertext
WWWが登場する以前ハイパーテキストは一部の「理想家」だけが
熱心に取り組んでいる特殊な道具でした
知識表現や機械に理解可能な知識というコンセプトの現在も
とてもよく似た状況と言えそうです
「絶対の真実全ての物事を網羅する知識あらゆる可能性といった
中央集約型のコンセプト」から離れて限られた知識で何ができるか
というところからスタートすることで知識表現におけるWWW
すなわちセマンティックウェブへの未知が開けてくるというのです
By TBL
httpwwwsemanticweborgabouthtmlbigpicture
Big Picture for Semantic Web (2001)
セマンティックWebの世界(1)
①電話が鳴ったときエンターテインメントシステムは
ビートルズの 「We Can Work It Out 」を大音量で再生し
ていたPeteが電話に出るとボリューム設定ができる
他のローカル機器すべてにその電話機がメッセージを送信
し自動的に音量を下げた
②電話の相手は妹のLucyで病院からの連絡だった
「ママは専門医のところへ行って物理療法のための
診察を受けなくてはならないの週に2回程度ね
私はエージェントにアポイントを取ってもらうつもりよ」
と彼女は話したPeteは即座に車での送迎は自分が
請け負うと申し出た
セマンティックWebの世界(2)
③医師の推薦 私たちのエージェントはママに処方された治療法についての 情報を医師エージェントから即座に入手しその提供者の複数の リストを調べママの自宅から半径20マイル以内で信頼できる 評価サービスにおいて「きわめて良い」または「とても良い」という 評価を得ている加入済みの保険のプランでカバーできるところを チェックした ④スケジューリング アポイント設定が可能な日時(各提供者のウェブサイトを通じて (エージェントが配信している)とPeteやLucyの多忙な スケジュールを突き合わせて実際に設定可能なアポイント日時 を探し始めた
ZDNetエンタープライズ (20021217) httpwwwzdnetcojpenterprise
Opinion現実のものとなるセマンティックWeb
bull 人がHTMLページを要求するのではなく離れたコンピュータ同士が意味のある方法で会話できるWebをXMLよりさらに高いレベルでつくりあげようという「セマンティックWeb」が現実味を帯びてきたW3Cが取り組んでいるほか国防総省のDARPAも後押ししている
bull セマンティックWebは単なる騒動かもしれないしインターネットの将来かもしれない
人により意見が異なる
デビッドワインバーグの批判 (2002)
私が危惧するのはセマンティツクウェブがSGMLと同じ末路を辿る
のではないか-それも基本的に同じ理由でということである
メタデータの正規化が真に機能するのは高い報酬(Benefit)が得られ
管理権限が一カ所に集約されておりユーザに規範を遵守させやすい
ような限定的なアプリケーションにおいてである
そうでなければWebにおいてはうまく機能しないということだ
David Weinberge The Semantic Argument Web
Tim Berners-Lees dream of a Web of meaning is unlikely to happen
at least the way he thinks hellip
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
TBL 1st Proposal
Information Management A Proposal (1989)
bull リンクにタイプがあった ndash depends on
ndash is part of
ndash made
ndash refers to
ndash uses
ndash is an example of
bull データ解析を行いたかった ndash 自動的な解析
ndash 人の居ないdivisionやドキュメントのないソフトウェアの検索
ndash メーリングリストの自動生成
ndash 実際の組織の構造を導き出す
TBL 2nd Proposal (2001) Tim Berners Lee James Hendler Ora Lassila The Semantic Web httpwwwsciamcomarticlecfmarticleID=00048144-10D2-1C70-84A9809EC588EF21ampsc=I10032
bull Semantic Web
ndash Webを正しいHypertextシステムにする
ndash リンクにタイプがある
ndashデータ間の関係を書く
ndash文書だけでなくデータを取り扱う
ndashデータにも型がある
bull 自動的な解析を行うことができる
ndash推論可能にする
ldquoThe Semantic Web will globalize KR
just as the WWW globalized hypertext
WWWが登場する以前ハイパーテキストは一部の「理想家」だけが
熱心に取り組んでいる特殊な道具でした
知識表現や機械に理解可能な知識というコンセプトの現在も
とてもよく似た状況と言えそうです
「絶対の真実全ての物事を網羅する知識あらゆる可能性といった
中央集約型のコンセプト」から離れて限られた知識で何ができるか
というところからスタートすることで知識表現におけるWWW
すなわちセマンティックウェブへの未知が開けてくるというのです
By TBL
httpwwwsemanticweborgabouthtmlbigpicture
Big Picture for Semantic Web (2001)
セマンティックWebの世界(1)
①電話が鳴ったときエンターテインメントシステムは
ビートルズの 「We Can Work It Out 」を大音量で再生し
ていたPeteが電話に出るとボリューム設定ができる
他のローカル機器すべてにその電話機がメッセージを送信
し自動的に音量を下げた
②電話の相手は妹のLucyで病院からの連絡だった
「ママは専門医のところへ行って物理療法のための
診察を受けなくてはならないの週に2回程度ね
私はエージェントにアポイントを取ってもらうつもりよ」
と彼女は話したPeteは即座に車での送迎は自分が
請け負うと申し出た
セマンティックWebの世界(2)
③医師の推薦 私たちのエージェントはママに処方された治療法についての 情報を医師エージェントから即座に入手しその提供者の複数の リストを調べママの自宅から半径20マイル以内で信頼できる 評価サービスにおいて「きわめて良い」または「とても良い」という 評価を得ている加入済みの保険のプランでカバーできるところを チェックした ④スケジューリング アポイント設定が可能な日時(各提供者のウェブサイトを通じて (エージェントが配信している)とPeteやLucyの多忙な スケジュールを突き合わせて実際に設定可能なアポイント日時 を探し始めた
ZDNetエンタープライズ (20021217) httpwwwzdnetcojpenterprise
Opinion現実のものとなるセマンティックWeb
bull 人がHTMLページを要求するのではなく離れたコンピュータ同士が意味のある方法で会話できるWebをXMLよりさらに高いレベルでつくりあげようという「セマンティックWeb」が現実味を帯びてきたW3Cが取り組んでいるほか国防総省のDARPAも後押ししている
bull セマンティックWebは単なる騒動かもしれないしインターネットの将来かもしれない
人により意見が異なる
デビッドワインバーグの批判 (2002)
私が危惧するのはセマンティツクウェブがSGMLと同じ末路を辿る
のではないか-それも基本的に同じ理由でということである
メタデータの正規化が真に機能するのは高い報酬(Benefit)が得られ
管理権限が一カ所に集約されておりユーザに規範を遵守させやすい
ような限定的なアプリケーションにおいてである
そうでなければWebにおいてはうまく機能しないということだ
David Weinberge The Semantic Argument Web
Tim Berners-Lees dream of a Web of meaning is unlikely to happen
at least the way he thinks hellip
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
TBL 2nd Proposal (2001) Tim Berners Lee James Hendler Ora Lassila The Semantic Web httpwwwsciamcomarticlecfmarticleID=00048144-10D2-1C70-84A9809EC588EF21ampsc=I10032
bull Semantic Web
ndash Webを正しいHypertextシステムにする
ndash リンクにタイプがある
ndashデータ間の関係を書く
ndash文書だけでなくデータを取り扱う
ndashデータにも型がある
bull 自動的な解析を行うことができる
ndash推論可能にする
ldquoThe Semantic Web will globalize KR
just as the WWW globalized hypertext
WWWが登場する以前ハイパーテキストは一部の「理想家」だけが
熱心に取り組んでいる特殊な道具でした
知識表現や機械に理解可能な知識というコンセプトの現在も
とてもよく似た状況と言えそうです
「絶対の真実全ての物事を網羅する知識あらゆる可能性といった
中央集約型のコンセプト」から離れて限られた知識で何ができるか
というところからスタートすることで知識表現におけるWWW
すなわちセマンティックウェブへの未知が開けてくるというのです
By TBL
httpwwwsemanticweborgabouthtmlbigpicture
Big Picture for Semantic Web (2001)
セマンティックWebの世界(1)
①電話が鳴ったときエンターテインメントシステムは
ビートルズの 「We Can Work It Out 」を大音量で再生し
ていたPeteが電話に出るとボリューム設定ができる
他のローカル機器すべてにその電話機がメッセージを送信
し自動的に音量を下げた
②電話の相手は妹のLucyで病院からの連絡だった
「ママは専門医のところへ行って物理療法のための
診察を受けなくてはならないの週に2回程度ね
私はエージェントにアポイントを取ってもらうつもりよ」
と彼女は話したPeteは即座に車での送迎は自分が
請け負うと申し出た
セマンティックWebの世界(2)
③医師の推薦 私たちのエージェントはママに処方された治療法についての 情報を医師エージェントから即座に入手しその提供者の複数の リストを調べママの自宅から半径20マイル以内で信頼できる 評価サービスにおいて「きわめて良い」または「とても良い」という 評価を得ている加入済みの保険のプランでカバーできるところを チェックした ④スケジューリング アポイント設定が可能な日時(各提供者のウェブサイトを通じて (エージェントが配信している)とPeteやLucyの多忙な スケジュールを突き合わせて実際に設定可能なアポイント日時 を探し始めた
ZDNetエンタープライズ (20021217) httpwwwzdnetcojpenterprise
Opinion現実のものとなるセマンティックWeb
bull 人がHTMLページを要求するのではなく離れたコンピュータ同士が意味のある方法で会話できるWebをXMLよりさらに高いレベルでつくりあげようという「セマンティックWeb」が現実味を帯びてきたW3Cが取り組んでいるほか国防総省のDARPAも後押ししている
bull セマンティックWebは単なる騒動かもしれないしインターネットの将来かもしれない
人により意見が異なる
デビッドワインバーグの批判 (2002)
私が危惧するのはセマンティツクウェブがSGMLと同じ末路を辿る
のではないか-それも基本的に同じ理由でということである
メタデータの正規化が真に機能するのは高い報酬(Benefit)が得られ
管理権限が一カ所に集約されておりユーザに規範を遵守させやすい
ような限定的なアプリケーションにおいてである
そうでなければWebにおいてはうまく機能しないということだ
David Weinberge The Semantic Argument Web
Tim Berners-Lees dream of a Web of meaning is unlikely to happen
at least the way he thinks hellip
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
ldquoThe Semantic Web will globalize KR
just as the WWW globalized hypertext
WWWが登場する以前ハイパーテキストは一部の「理想家」だけが
熱心に取り組んでいる特殊な道具でした
知識表現や機械に理解可能な知識というコンセプトの現在も
とてもよく似た状況と言えそうです
「絶対の真実全ての物事を網羅する知識あらゆる可能性といった
中央集約型のコンセプト」から離れて限られた知識で何ができるか
というところからスタートすることで知識表現におけるWWW
すなわちセマンティックウェブへの未知が開けてくるというのです
By TBL
httpwwwsemanticweborgabouthtmlbigpicture
Big Picture for Semantic Web (2001)
セマンティックWebの世界(1)
①電話が鳴ったときエンターテインメントシステムは
ビートルズの 「We Can Work It Out 」を大音量で再生し
ていたPeteが電話に出るとボリューム設定ができる
他のローカル機器すべてにその電話機がメッセージを送信
し自動的に音量を下げた
②電話の相手は妹のLucyで病院からの連絡だった
「ママは専門医のところへ行って物理療法のための
診察を受けなくてはならないの週に2回程度ね
私はエージェントにアポイントを取ってもらうつもりよ」
と彼女は話したPeteは即座に車での送迎は自分が
請け負うと申し出た
セマンティックWebの世界(2)
③医師の推薦 私たちのエージェントはママに処方された治療法についての 情報を医師エージェントから即座に入手しその提供者の複数の リストを調べママの自宅から半径20マイル以内で信頼できる 評価サービスにおいて「きわめて良い」または「とても良い」という 評価を得ている加入済みの保険のプランでカバーできるところを チェックした ④スケジューリング アポイント設定が可能な日時(各提供者のウェブサイトを通じて (エージェントが配信している)とPeteやLucyの多忙な スケジュールを突き合わせて実際に設定可能なアポイント日時 を探し始めた
ZDNetエンタープライズ (20021217) httpwwwzdnetcojpenterprise
Opinion現実のものとなるセマンティックWeb
bull 人がHTMLページを要求するのではなく離れたコンピュータ同士が意味のある方法で会話できるWebをXMLよりさらに高いレベルでつくりあげようという「セマンティックWeb」が現実味を帯びてきたW3Cが取り組んでいるほか国防総省のDARPAも後押ししている
bull セマンティックWebは単なる騒動かもしれないしインターネットの将来かもしれない
人により意見が異なる
デビッドワインバーグの批判 (2002)
私が危惧するのはセマンティツクウェブがSGMLと同じ末路を辿る
のではないか-それも基本的に同じ理由でということである
メタデータの正規化が真に機能するのは高い報酬(Benefit)が得られ
管理権限が一カ所に集約されておりユーザに規範を遵守させやすい
ような限定的なアプリケーションにおいてである
そうでなければWebにおいてはうまく機能しないということだ
David Weinberge The Semantic Argument Web
Tim Berners-Lees dream of a Web of meaning is unlikely to happen
at least the way he thinks hellip
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
httpwwwsemanticweborgabouthtmlbigpicture
Big Picture for Semantic Web (2001)
セマンティックWebの世界(1)
①電話が鳴ったときエンターテインメントシステムは
ビートルズの 「We Can Work It Out 」を大音量で再生し
ていたPeteが電話に出るとボリューム設定ができる
他のローカル機器すべてにその電話機がメッセージを送信
し自動的に音量を下げた
②電話の相手は妹のLucyで病院からの連絡だった
「ママは専門医のところへ行って物理療法のための
診察を受けなくてはならないの週に2回程度ね
私はエージェントにアポイントを取ってもらうつもりよ」
と彼女は話したPeteは即座に車での送迎は自分が
請け負うと申し出た
セマンティックWebの世界(2)
③医師の推薦 私たちのエージェントはママに処方された治療法についての 情報を医師エージェントから即座に入手しその提供者の複数の リストを調べママの自宅から半径20マイル以内で信頼できる 評価サービスにおいて「きわめて良い」または「とても良い」という 評価を得ている加入済みの保険のプランでカバーできるところを チェックした ④スケジューリング アポイント設定が可能な日時(各提供者のウェブサイトを通じて (エージェントが配信している)とPeteやLucyの多忙な スケジュールを突き合わせて実際に設定可能なアポイント日時 を探し始めた
ZDNetエンタープライズ (20021217) httpwwwzdnetcojpenterprise
Opinion現実のものとなるセマンティックWeb
bull 人がHTMLページを要求するのではなく離れたコンピュータ同士が意味のある方法で会話できるWebをXMLよりさらに高いレベルでつくりあげようという「セマンティックWeb」が現実味を帯びてきたW3Cが取り組んでいるほか国防総省のDARPAも後押ししている
bull セマンティックWebは単なる騒動かもしれないしインターネットの将来かもしれない
人により意見が異なる
デビッドワインバーグの批判 (2002)
私が危惧するのはセマンティツクウェブがSGMLと同じ末路を辿る
のではないか-それも基本的に同じ理由でということである
メタデータの正規化が真に機能するのは高い報酬(Benefit)が得られ
管理権限が一カ所に集約されておりユーザに規範を遵守させやすい
ような限定的なアプリケーションにおいてである
そうでなければWebにおいてはうまく機能しないということだ
David Weinberge The Semantic Argument Web
Tim Berners-Lees dream of a Web of meaning is unlikely to happen
at least the way he thinks hellip
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
セマンティックWebの世界(1)
①電話が鳴ったときエンターテインメントシステムは
ビートルズの 「We Can Work It Out 」を大音量で再生し
ていたPeteが電話に出るとボリューム設定ができる
他のローカル機器すべてにその電話機がメッセージを送信
し自動的に音量を下げた
②電話の相手は妹のLucyで病院からの連絡だった
「ママは専門医のところへ行って物理療法のための
診察を受けなくてはならないの週に2回程度ね
私はエージェントにアポイントを取ってもらうつもりよ」
と彼女は話したPeteは即座に車での送迎は自分が
請け負うと申し出た
セマンティックWebの世界(2)
③医師の推薦 私たちのエージェントはママに処方された治療法についての 情報を医師エージェントから即座に入手しその提供者の複数の リストを調べママの自宅から半径20マイル以内で信頼できる 評価サービスにおいて「きわめて良い」または「とても良い」という 評価を得ている加入済みの保険のプランでカバーできるところを チェックした ④スケジューリング アポイント設定が可能な日時(各提供者のウェブサイトを通じて (エージェントが配信している)とPeteやLucyの多忙な スケジュールを突き合わせて実際に設定可能なアポイント日時 を探し始めた
ZDNetエンタープライズ (20021217) httpwwwzdnetcojpenterprise
Opinion現実のものとなるセマンティックWeb
bull 人がHTMLページを要求するのではなく離れたコンピュータ同士が意味のある方法で会話できるWebをXMLよりさらに高いレベルでつくりあげようという「セマンティックWeb」が現実味を帯びてきたW3Cが取り組んでいるほか国防総省のDARPAも後押ししている
bull セマンティックWebは単なる騒動かもしれないしインターネットの将来かもしれない
人により意見が異なる
デビッドワインバーグの批判 (2002)
私が危惧するのはセマンティツクウェブがSGMLと同じ末路を辿る
のではないか-それも基本的に同じ理由でということである
メタデータの正規化が真に機能するのは高い報酬(Benefit)が得られ
管理権限が一カ所に集約されておりユーザに規範を遵守させやすい
ような限定的なアプリケーションにおいてである
そうでなければWebにおいてはうまく機能しないということだ
David Weinberge The Semantic Argument Web
Tim Berners-Lees dream of a Web of meaning is unlikely to happen
at least the way he thinks hellip
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
セマンティックWebの世界(2)
③医師の推薦 私たちのエージェントはママに処方された治療法についての 情報を医師エージェントから即座に入手しその提供者の複数の リストを調べママの自宅から半径20マイル以内で信頼できる 評価サービスにおいて「きわめて良い」または「とても良い」という 評価を得ている加入済みの保険のプランでカバーできるところを チェックした ④スケジューリング アポイント設定が可能な日時(各提供者のウェブサイトを通じて (エージェントが配信している)とPeteやLucyの多忙な スケジュールを突き合わせて実際に設定可能なアポイント日時 を探し始めた
ZDNetエンタープライズ (20021217) httpwwwzdnetcojpenterprise
Opinion現実のものとなるセマンティックWeb
bull 人がHTMLページを要求するのではなく離れたコンピュータ同士が意味のある方法で会話できるWebをXMLよりさらに高いレベルでつくりあげようという「セマンティックWeb」が現実味を帯びてきたW3Cが取り組んでいるほか国防総省のDARPAも後押ししている
bull セマンティックWebは単なる騒動かもしれないしインターネットの将来かもしれない
人により意見が異なる
デビッドワインバーグの批判 (2002)
私が危惧するのはセマンティツクウェブがSGMLと同じ末路を辿る
のではないか-それも基本的に同じ理由でということである
メタデータの正規化が真に機能するのは高い報酬(Benefit)が得られ
管理権限が一カ所に集約されておりユーザに規範を遵守させやすい
ような限定的なアプリケーションにおいてである
そうでなければWebにおいてはうまく機能しないということだ
David Weinberge The Semantic Argument Web
Tim Berners-Lees dream of a Web of meaning is unlikely to happen
at least the way he thinks hellip
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
ZDNetエンタープライズ (20021217) httpwwwzdnetcojpenterprise
Opinion現実のものとなるセマンティックWeb
bull 人がHTMLページを要求するのではなく離れたコンピュータ同士が意味のある方法で会話できるWebをXMLよりさらに高いレベルでつくりあげようという「セマンティックWeb」が現実味を帯びてきたW3Cが取り組んでいるほか国防総省のDARPAも後押ししている
bull セマンティックWebは単なる騒動かもしれないしインターネットの将来かもしれない
人により意見が異なる
デビッドワインバーグの批判 (2002)
私が危惧するのはセマンティツクウェブがSGMLと同じ末路を辿る
のではないか-それも基本的に同じ理由でということである
メタデータの正規化が真に機能するのは高い報酬(Benefit)が得られ
管理権限が一カ所に集約されておりユーザに規範を遵守させやすい
ような限定的なアプリケーションにおいてである
そうでなければWebにおいてはうまく機能しないということだ
David Weinberge The Semantic Argument Web
Tim Berners-Lees dream of a Web of meaning is unlikely to happen
at least the way he thinks hellip
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
デビッドワインバーグの批判 (2002)
私が危惧するのはセマンティツクウェブがSGMLと同じ末路を辿る
のではないか-それも基本的に同じ理由でということである
メタデータの正規化が真に機能するのは高い報酬(Benefit)が得られ
管理権限が一カ所に集約されておりユーザに規範を遵守させやすい
ような限定的なアプリケーションにおいてである
そうでなければWebにおいてはうまく機能しないということだ
David Weinberge The Semantic Argument Web
Tim Berners-Lees dream of a Web of meaning is unlikely to happen
at least the way he thinks hellip
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
知識工学とセマンティックWebにおける
オントロジーの研究開発
知識工学 1991-現在
bull 概念化の明示的仕様 (Tom Gruber オントロジーの定義)
bull オントロジー記述言語(Ontolingua)
bull 知識交換言語(KIF)
bull PSM
bull Task Ontology
bull Generic Ontology
bull CYC WordNet EDRhellip
bull オントロジー構築方法論
セマンティックWeb 1997-現在
bull 95-97 XML as arbitrary
structures
bull 97-98 RDF
bull 98-99 RDFS
bull 00-01 DAML+OIL
bull 2004210 OWL
bull 20091027 OWL2
bull 2010622 RIF
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
Semantic Web Stack 2001
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
Semantic Web Stack 2006
2001年 2006年 2010年
Webページ
Googleリッチスニペット
YAHOOSearchMonkey
Dapper
Piggy Bank
スクレイピング
GRDDL RDFa
HTML5 microdata
アノテーション
microformats
生命科学医療
地図政府
メディア
ライブラリ
Linked Open Data (LOD) オープンデータ
政府データ
科学データ
音楽データ
写真データ
米国連邦政府英国政府
Science Commons
MusicBrainz
Flickr
FolksonomyWikipedia
集合知
Semantic Web Stack 2010
RDF
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
集合知
Semantic Web Stack 2010
RDF
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
RDF
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