Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
2
OutlineOutline
• Introduction to the Semantic Web• Ontology Languages for the Semantic Web• An Introduction to Description Logics• Reasoning with OWL• Description Logic Reasoning• Ontology-based Rule Inferences• Summary
Where the Web are heading… (추가)
4
Semantic WebSemantic Web
• From Wikipedia– The semantic web is an evolving extension of the World
Wide Web in which web content can be expressed not only in natural language, but also in a format that can be understood, interpreted and used by software agents, thus permitting them to find, share and integrate information easily
– It derives from W3C director Tim Berners-Lee’s vision of the Web as a universal medium for data, information, andknowledge exchange.
5
Evolution of WebEvolution of Web
• Web– Web 문서에 대한 rendering 정보 markup
• HTML markup
– Human이 읽고 이해하기 쉽도록 표현
– Software agent를 위한 공간은 제공되지 않음
• Semantic web– Web 문서에 대한 의미 정보 markup– Software agent를 위한 공간을 제공
– Seamless 서비스를 위한 노력
6
Current Web Current Web 환경환경
• 기존의 웹 representation– 자연어(영어, 한국어, …), 그래픽스, 멀티미디어, …
• 기존의 웹 환경에서 human 사용자가 하는 일들– partial information으로부터 추론
– mental association을 구축
– 웹에 있는 다양한 데이터를 combine• 여행지와 호텔 정보는 다양한 sites• 여러 디지털 도서관에서 검색
• 그러나, 웹소프트웨어의 한계– Partial information 처리
– 이미지 정보 처리
– 정보를 combine 하는 문제
• <foo:creator> 와 <bar:author>가 같은 의미인지를 파악?
7
Original vision of webOriginal vision of web
• By Tim Berners-Lee– ... a goal of the Web was that, if the interaction between
person and hypertext could be so intuitive that the machine-readable information space gave an accurate representation of the state of people's thoughts, interactions, and work patterns, then machine analysiscould become a very powerful management tool, seeing patterns in our work and facilitating our working together through the typical problems which beset the management of large organizations.”
8
Web spaceWeb space
Machine Readable Space
Software Agents
MachineAnalysis
Human
delegate
Searching
service
Vision of the Semantic WebVision of the Semantic Web
9
What We See and What Machine SeesWhat We See and What Machine Sees……
⌧
10
Example: Scientific American ArticleExample: Scientific American Article
11
Machine Readable RepresentationMachine Readable Representation
Tim Berners-Lee
James Hendler
Ora Lassila
The Semantic Web
Scientific American
vcard:fn
vcard:fn
vcard:fn
dc:title
dc:title
dc:creator
akt:publishedIn dc:creator
dc:creator
2001-05dc:date
Relation and object types aredefined in a machine-understandableform – an ontology
[Gibbins]
(추가)12
<?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns="http://www.geonames.org/ontology#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:wgs84_pos="http://www.w3.org/2003/01/geo/wgs84_pos#"> <Feature rdf:about="http://sws.geonames.org/2642465/"> <name>Milton Keynes</name> <featureClass rdf:resource="http://www.geonames.org/ontology#P"/> <featureCode rdf:resource="http://www.geonames.org/ontology#P.PPLA"/> <inCountry rdf:resource="http://www.geonames.org/countries/#GB"/> <population>31967</population> <wgs84_pos:lat>52.0333333</wgs84_pos:lat> <wgs84_pos:long>-0.7</wgs84_pos:long> <parentFeature rdf:resource="http://sws.geonames.org/2635167/"/> <nearbyFeatures rdf:resource="http://sws.geonames.org/2642465/nearby.rdf"/> <locationMap>http://www.geonames.org/maps/geonameId=2642465</locationMap> </Feature> </rdf:RDF>
(추가) 13
14
Overview of Semantic Web, Ontology, and Overview of Semantic Web, Ontology, and AgentsAgents
SoftwareAgents
Web Ontology
OWL-enabledWeb pages
OWL-enabledWeb pages
15
Current Web
Semantic WebOntology
OntologyOntology
Ontology
Metadata Extraction
Databases
Media
HTML
DocumentsHuman Understandable
Machine Understandable
[Milnor]
16
Bookstore Data (Dataset Bookstore Data (Dataset ““AA””))
[bookstore 예제는 Ivan Herman 자료로 부터 채택한 것임]
17
Data Data 표현표현
18
Bookstore Data (Dataset Bookstore Data (Dataset ““FF””))
19
Dataset F Dataset F 표현표현
20
데이터데이터 MergeMerge
21
데이터데이터 MergeMerge
22
Extra Extra 지식지식 추가추가
23
QueriesQueries
• Data F 사용자의 query 처리 예– Original 원작의 title, Original 원작자의 home page– 이 query를 처리하기 위한 정보는 dataset F에는 없
음
• 동의어 처리– <a:author>와 <f:auteur>를 sameAs로 처리
24
Semantic Web Architecture (TBL, 1999)Semantic Web Architecture (TBL, 1999)
ontologyrepresentationlanguage
25
Semantic Web Architecture (TBL, 2005)Semantic Web Architecture (TBL, 2005)
26
OutlineOutline
• Introduction to the Semantic Web• Ontology Languages for the Semantic Web• An Introduction to Description Logics• Reasoning with OWL• Description Logic Reasoning• Ontology-based Rule Inferences• Summary
RDF : Resource Description FrameworkRDF : Resource Description Framework((추가추가))
• W3C’s knowledge representation standard for the semantic web.
• Semantic web is basically the Web 3.0– Meta data for content (webpages, multimedia
content, versioning) allows machines to help people search information and organize their lives.
• Quickly became standard for meta data in general
• But: nothing more than a way to serialize old-fashioned semantic networks.
27
28
RDF RDF –– Resource Description FrameworkResource Description Framework
• 웹에 있는 resource 를 표현하기 위한 graphical 언어
• 웹에있는 임의의 resources들을 연결– labelled directed connection– RDF Triples (또는 statements)
• (s,p,o)– subject, property, object
• s, p는 URI, o는 URI 또는 literal
29
RDF ExampleRDF Example
Alice is the creator of the resource http://www.ssu.ac.kr/~Alice.
Alicehttp://www.ssu.ac.kr/~Alice
creator=
http://purl.org/dc/elements/1.1/creator
Property
Resource Property Value
30
RDF ResourceRDF Resource의의 NamingNaming
• RDF는 resource를 identify하기 위해서 URIs를활용– 보다 명확히 말하면 URIRefs
• URIRef는 URI와 fragment identifier로 구성– # symbol– http://ailab.ssu.ac.kr/people#hasCollegue– ssu:hasCollegue
31
RDF RDF 예예
a:hasName
http://www.ssu.ac.kr/ailab#park
“Park”
http://www.ssu.ac.kr/ailab#kim
http://ailab.ssu.ac.kr/~sckim
a:hasAdvisor
a:hasHomepage
“Kim”
a:hasName
32
XML XML 기반의기반의 RDF RDF 표현표현
<?xml version=ʹ1.0ʹ encoding=ʹUTF‐8ʹ?><rdf:RDF xmlns:rdf=ʺhttp://www.w3.org/1999/02/22‐rdf‐syntax‐ns#ʺ
xmlns:rdfs=ʺhttp://www.w3.org/2000/01/rdf‐schema#ʺxmlns:a=ʺhttp://www.ssu.ac.kr/ailab#ʺxml:base=ʺhttp://www.ssu.ac.kr/ailab#ʺ>
<rdf:Description rdf:ID=ʺparkʺ><a:hasName>Park</a:hasName>
</rdf:Description><rdf:Description rdf:ID=ʺkimʺ>
<a:hasName>Kim</a:hasName><a:hasAdvisor rdf:resource=ʺhttp://www.ssu.ac.kr/ailab#parkʺ/><a:hasHomepage rdf:resource=ʺhttp://ailab.ssu.ac.kr/~sckimʺ/>
</rdf:Description></rdf:RDF>
<?xml version=ʹ1.0ʹ encoding=ʹUTF‐8ʹ?><rdf:RDF xmlns:rdf=ʺhttp://www.w3.org/1999/02/22‐rdf‐syntax‐ns#ʺ
xmlns:rdfs=ʺhttp://www.w3.org/2000/01/rdf‐schema#ʺxmlns:a=ʺhttp://www.ssu.ac.kr/ailab#ʺxml:base=ʺhttp://www.ssu.ac.kr/ailab#ʺ>
<rdf:Description rdf:ID=ʺkimʺ><a:hasName>Kim</a:hasName><a:hasAdvisor><rdf:Description rdf:about=“http://www.ssu.ac.kr/ailab#parkʺ><a:hasName>Park</a:hasName>
</rdf:Description></a:hasAdvisor><a:hasHomepage rdf:resource=ʺhttp://ailab.ssu.ac.kr/~sckimʺ/>
</rdf:Description></rdf:RDF>
33
RDF RDF 기반기반 RepresentationRepresentation
• RDF 지식은 schema와 data로 구분됨– Terminological axioms– Assertions
■ The schema part (“applications data types”):
<rdf:Description rdf:ID=“Novel”><rdf:type rdf:resource=“http://www.w3.org/2000/01/rdf-schema#Class”/>
</rdf:Description>
■ The RDF data on a specific novel (“using the type”):
<rdf:Description rdf:about=“http://.../isbn/000651409X”><rdf:type rdf:resource=“http://.../bookSchema.rdf#Novel”/>
</rdf:Description>
http://.../bookSchema.rdf#Novel
http://www.w3.org/2000/01/rdf-schema#Class
rdf:type
http://.../isbn/000651409X
rdf:type
A Typical Semantic Network A Typical Semantic Network ((추가추가))
34
owns
hasPet
petOfsameAs
property
Mammal
Animal
class
subclassOf
range
type type
subProperty
inverseOf
2
4
Dog
eyes
legs
subClassOf
Jans MrAasman.Robbie petOf sameAs
petOf
owns
Human
type
domain
[Franz]
The same network serialized intoThe same network serialized into<subject, predicate, object> triples <subject, predicate, object> triples ((추가추가))
• Animal type class• Mammal subclassOf Animal• Mammal eyes 2• Mammal legs 4• Dog subclassOf Mammal• owns type Property• hasPet subproperty owns• hasPet range Mammal• hasPet inverseOf petOf• Robbie petOf Jans• MrAasman sameAs Jans 35[Franz]
36[Franz]
<http://www.franz.com/simple#Animal><http://www.w3.org/1999/02/22-rdf-syntax-ns#type><http://www.w3.org/2002/07/owl#Class>
<http://www.franz.com/simple#Mammal><http://www.w3.org/2000/01/rdf-schema#subClassOf><http://www.franz.com/simple#Animal>
<http://www.franz.com/simple#Mammal><http://www.franz.com/simple#eyes> “two”
<http://www.franz.com/simple#Mammal><http://www.franz.com/simple#legs> “four”
…..
RDF: Subject, predicate, object turned intoResources (URIs) and literals ((추가추가))
Resource
literal
Triples in a triple-store.. ((추가추가))
Triples are number vectors in memory and on disk.
# (2 4 5 6)# (7 9 2 10)# (7 11 12 13)# (14 15 16 17)# (18 4 7 19)# (20 4 21 22)# (20 23 24 25)# (26 27 20 28)# (26 29 7 30)# (31 32 33 34)
Dictionary
franz:Animal = 2
rdf:type = 4owl:Class = 5franz:Eyes = 9…..
Reverse Dictionary2 = franz:Animal4 = rdf:Type5 = owl:class6 = Triple-id7 = franz:Mammal
37[Franz]
Triples are indexed in three ways… ((추가추가))
• SPO
• POS
• OSP
Get-triples(jans, ?x, ?y)
Get-triples(jans, isa, ?x)
Get-triples(jans, isa, psychologist)
Get-triples(?x, isa, ?y)
Get-triples(?x, isa, psychologist)
Get-triples(?x, ?y, psychologist)
Get-triples(jans, ?y, psychologist)
38[Franz]
39
RDF RDF 처리처리 프로그램프로그램
• HP의 Jena를 이용한 RDF 처리
• Jena API Structure
<<interface>>Property
<<interface>>Property
<<interface>>Statement
<<interface>>Statement
<<interface>>Resource
<<interface>>Resource
<<interface>>Literal
<<interface>>Literal
<<interface>>RDFNode
<<interface>>RDFNode
<<interface>>Alt
<<interface>>Alt
<<interface>>Bag
<<interface>>Bag
<<interface>>Seq
<<interface>>Seq
<<interface>>Container
<<interface>>Container
40
Jena InterfacesJena Interfaces
• Model: a set of statements– Statement: a triple of {R, P, O}
• Subject : resource로 표현됨
• Property: resource 로 표현됨
• Object: resource 또는 literal 로 표현됨
• Container: special resource, collection of things
41
Jena InterfacesJena Interfaces (cont.)(cont.)
Tutorial
June 28 2007
ssu:date
“Kim”
ssu:name
“SemanticWeb”
ssu:author ssu:title
“[email protected]”ssu:email
ssu:email
Model
Statement
Resource
Property
Literal
Object
42
Jena ExampleJena Example
• Create resource (subject, object, predicate)– Tutorial, author, firstName, lastName
// Create a ModelModel model = ModelFactory.createDefaultModel();
// Set name‐spaceString ns = ʺhttp://www.ssu.ac.kr/ailab#ʺ;model.setNsPrefix(ʺnsʺ, ns);
// Create propertiesProperty author = model.createProperty(ns+ʺautorʺ);Property firstName = model.createProperty(ns+ʺfirstNameʺ);Property lastName = model.createProperty(ns+ʺlastNameʺ);
// Create a resourceResource Tutorial = model.createResource(ns+ʺTutorialʺ)
.addProperty(author, model.createResource().addProperty(firstName, ʺYoung Tackʺ).addProperty(lastName, ʺParkʺ));
// Model printmodel.write(System.out);
“Young Tack”
ns:firstName
ns:author
“Park”
Tutorial
ns:lastName
43
Jena Example (cont.)Jena Example (cont.)
• Result
<rdf:RDFxmlns:ns=ʺhttp://www.ssu.ac.kr/ailab#ʺxmlns:rdf=ʺhttp://www.w3.org/1999/02/22‐rdf‐syntax‐ns#ʺ > <rdf:Description rdf:nodeID=ʺA0ʺ><ns:lastName>Park</ns:lastName><ns:firstName>Young Tack</ns:firstName></rdf:Description><rdf:Description rdf:about=ʺhttp://www.ssu.ac.kr/ailab#Tutorialʺ><ns:autor rdf:nodeID=ʺA0ʺ/></rdf:Description></rdf:RDF>
// Model printmodel.write(System.out);
RDFS: putting constraints on RDF ((추가추가))
• RDF allowed everything– Mammal type class– Dog subclass of Mammal– Mammal subclass of Dog
• In order to allow for systematic reasoning RDF got semantics (schema)
mammalmammal
dogdog
44
RDFS ((추가추가))
• Core classes– rdfs:resource, rdfs:class, rdfs:literal– rdfs: property, rdf:statement
• Defining relationships– rdf:type, rdfs:subClassOf, rdfs:subPropertyOf
• Core restrictions– rdfs:domain– rdfs:range
45
46
RDFSRDFS를를 이용한이용한 클래스클래스 표현표현
• 클래스를 표현하기 위해서는 RDF Schema resource를 활용– rdfs:Class– rdfs:subClassOf
rdfs:subClassOf
http://www.ssu.ac.kr/ailab#Professor
http://www.ssu.ac.kr/ailab#park
rtfs:type
http://www.w3.org/2000/01/rdf-schema#Class
http://www.ssu.ac.kr/ailab#Person
rtfs:type
47
RDFS RDFS 기반의기반의 Property Property 표현표현
• RDFS는 property를 표현할 수 있는 vocabulary 를 제공함– Property들은 rdf:Property 클래스의 인스턴스
• rdfs:domain 과 rdfs:range가 property의 domain과range를 표현하는 데 이용됨
rdfs:domain
http://www.ssu.ac.kr/ailab#hasFriends
rtfs:type
http://www.w3.org/2000/01/rdf-schema#Class
http://www.ssu.ac.kr/ailab#Person
rtfs:type
rdfs:range
http://www.w3.org/1999/02/22-rdf-syntax-ns#Property
48
RDFS InferencesRDFS Inferences
• 위의 그래프에서 다음의 RDF statement가 추론 가능– http://.../isbn/000651409X 가 Fiction이라는 것이 추론
http://.../isbn/000651409X rtfs:type
rdfs:
subC
lassO
f
#Fiction
#Novel
49
SPARQLSPARQL
• RDF를 access하기 위한 프로토콜을 제공하는query 언어– W3C RDF Access Working Group
• SPARQL 언어의 주요 기능– RDF 그래프로부터 URI, blank node, literal 등을
access– RDF subgraph access– Query를 기반으로 새로운 RDF graph construct
49
SPARQL SPARQL ((추가추가))
• A kind of mix between Prolog and SQL• Output of result lists in human-readable format and
in the SPARQL XML query result format• Evaluation of SELECT, ASK, CONSTRUCT, and
DESCRIBE queries• Creation of matchers, functions that check if a
given node satisfies a predetermined variable binding in a query.
5050
51
SPARQLSPARQL
ns:hasTitle
http://.../ailab#paper101
ns:language
ns:author
Eng“SemanticWeb”
ns:title
http://.../ailab#paper202
ns:hasTitle
ns:language
Kor“시맨틱웹”
ns:title
ns:hasTitle
ns:language
Eng“Ontology”
ns:title
ns:hasTitle
ns:language
Kor“온톨로지”
ns:title
ns:author
“Park”ns:name
SELECT ?paper ?title ?langWHERE { ?paper ns:hasTitle ?x. ?x ns:title ?title. ?x ns:language ?lang. }
■ Returns:[[<http://.../ailab#paper101>, SemanticWeb, Eng], [<http://.../ailab#paper101>, 시맨틱웹, Kor],[<http://.../ailab#paper202>, Ontology, Eng],[<http://.../ailab#paper202>, 온톨로지, Kor]]
52
SPARQL(contSPARQL(cont.).)
ns:hasTitle
http://.../ailab#paper101
ns:language
ns:author
Eng“SemanticWeb”
ns:title
http://.../ailab#paper202
ns:hasTitle
ns:language
Kor“시맨틱웹”
ns:title
ns:hasTitle
ns:language
Eng“Ontology”
ns:title
ns:hasTitle
ns:language
Kor“온톨로지”
ns:title
ns:author
“Park”ns:name
SELECT ?paper ?title ?langWHERE { ?paper ns:hasTitle ?x. ?x ns:title ?title. ?x ns:language ?lang.
FILTER(?lang == Kor) }
■ Returns:[[<http://.../ailab#paper101>, 시맨틱웹, Kor],[<http://.../ailab#paper202>, 온톨로지, Kor]]
53
Computer Science Computer Science 관점의관점의 OntologyOntology
• 철학관점의 온톨로지– the study of being or existence,
• Computer science 관점에서의 온톨로지– Data model within a domain
• Concepts• Relations
– Reasoning을 지원하는 구조• First order logic의 subset인 description logic에 기반을
둔 표현 방식
54
Tom GruberTom Gruber’’s Definitions Definition
• An ontology is a description of the concepts and relationships that can exist for an agent or a community of agents
• An ontology is a formal specification of a conceptualization– 프로그램과 같이 formal specification– 프로그램은 procedural 지식을 표현하지만 ontology는 사람의 지식,
데이터 모델을 컴퓨터가 이해하는 formal specification으로 표현
• Ontology의 consumer는 소프트웨어– Autonomous, communicative, and intelligent agent
55
온톨로지온톨로지 예예
• Primitive class– PERSON, FEMALE
• Property– hasChild
• 표현된 class– PARENT ≡ PERSON ⊓ ∃ hasChild.PERSON– WOMAN ≡ FEMALE ⊓ PERSON– MOTHER ≡ FEMALE ⊓ PARENT
56
온톨로지온톨로지 예예
57
온톨로지온톨로지 표현표현 언어언어
• 온톨로지는 사람의 지식 또는 데이터 모델이 표현된 것
• 온톨로지를 표현하기 위한 언어가 필요함
• 온톨로지 언어의 기능상 요구 사항– 표현된 온톨로지는 reasoning을 지원하기 위해서 온
톨로지 표현언어는 resaoning 지원 기능이 있어야함
– Java, C++, Database에는 없는 지원 기능
– 이와같은 부수적인 기능을 잘 활용하여 온톨로지를 구축하는 기술이 필요함
• OWL(Web Ontology Language)가 W3C recommendation
OWL ((추가추가))
• The marriage between– Object oriented type system– Well understood Description logic– Web languages like XML and RDF
• Typical reasoning– Class membership– Equivalence of classes– Consistency– Classification
58
OWL language ((추가추가))
• Richer description of objects– someValuesFrom (existential quantification), allValuesFrom
(universal quantification), hasValue• owl:sameAs• owl:inverseOf
– hasA inverseOf ownedBy• owl:TransitiveProperty
– greaterThan type TransitiveProperty• owl:SymmetricProperty
– siblingOf type SymmetricProperty• owl:FuncionalProperty
– only one value allowed: ex: age.• owl:InverseFunctionalProperty
– two different objects cannot have same value
59
The power of RDFS/OWL: our example again ((추가추가))• Animal type class• Mammal subclassOf Animal• Mammal eyes 2• Mammal legs 4• Dog subclassOf Mammal• owns type Property• owns domain Human• hasPet subproperty owns• hasPet range Mammal• hasPet inverseOf petOf• Robbie petOf Jans• MrAasman sameAs Jans
(query (MrAasman owns ?x)(?x eyes 2))
owns
hasPet
petOfsameAs
property
Mammal
Animal
class
subclassOf
range
type
subProperty
inverseOf
type2
4
Dog
eyes
legs
subClassOf
Jans MrAasman.RobbiepetOf sameAs
petOf
hasPet
Human
type
domain
owns
60[Franz]
inverseOf
subProperty
Example of RDFS(and a little bit of OWL) Reasoning ((추가추가))
owns
hasPet
petOfsameAs
property
Mammal
Animal
class
subclassOf
range
type type
subProperty
inverseOf
2
4
Dog
eyes
legs
subClassOf
Jans MrAasman.Robbie petOf sameAs
petOf
owns
Human
type
domain
61[Franz]
온톨로지 구축시 주요한 기능 예 (추가)
• Taxonomy 구축– 두개의 concept사이의 taxonomy – Subsumption
• 다음과 같은 2개의 concept이 있다고 가정
– PARENT ≡ PERSON ⊓ ∃ hasChild.PERSON– MOTHER ≡ FEMALE ⊓ PARENT
• PARENT가 MOTHER 보다 general한 concept이므로PARENT concept이 MOTHER concept 을 subsume
• PARENT ⊒ MOTHER
62
온톨로지 구축시 주요한 기능 예 (추가)
• Consistency 파악– 하나의 concept이 의미있는 지?– Satisfiable한 model이 존재하는지?
• Model theory 활용
– Satisfiable concept?• NEWCONCEPT ≡ ¬WOMAN ⊓ MOTHER
63
온톨로지 구축시 주요한 기능 예 (추가)
• Instantiation– 하나의 instance가 주어졌을 때, 이 instance가 주어
진 concept의 member인지 확인
– 다음과 같은 Concept• PARENT ≡ PERSON ⊓ ∃ hasChild.PERSON
– 주어진 instance• 영이 : Person• <영이 hasChild 철수>• 철수 : Person
– 영이 는 PARENT 의 member
64
65
온톨로지온톨로지 활용성활용성 결정결정
• OWL 온톨로지가 보유하고 있는 기능을 미리 파악하고 사용 여부를 결정– What OWL can and cannot?
• OWL 의 기능을 파악하지 못하면 불필요하게OWL 온톨로지를 구축하는 노력을 낭비하게 되고, 경우에 따라서는 OWL 온톨로지가 필요없는데도 불필요하게 온톨로지를 구축하는 부작용이있을 수 있음
• OWL의 기능?– OWL의 근본인 description logic의 기능
– 데이터베이스에는 없는 기능, Prolog와는 목적이 다른 기능, FOPC와는 expression power의 차이
OWL 온톨로지의 기능 (추가)
• OWL 온톨로지는 description logic 기반– 그러나, DB, Prolog, Java는 이러한 기반을 이루고 있
지 못함
– 그럼, description logic의 기능은?– 자동화를 위한 도구를 제공함. 이와같은 기능은 DB나
Prolog, Java에는 없기 때문에 DB, Prolog, Java 사용자들은 이 기능을 구현하는 code를 작성해야함
– 그러나, OWL 사용자는 code를 작성하지 않고reasoner라는 도구를 사용하면 됨
• 그러면 description logic의 기능은?– Subsumption, instantitaion, …
66
OWL 사용자의 이점(추가)
DB 온톨로지
Prolog 온톨로지
Java 온톨로지
OWL 온톨로지
ComplexCode for
SubsumptionInstantiation
etc.
DL reasoner
67
시맨틱 Reasoning 간단한 예(추가)
• 상황인지 기반 시맨틱 reasoning– Description logic 기반의 reasoning – SWRL reasoning
• 상황 온톨로지
• 상황인지 기반 SWRL 규칙
Context Interpreter Context Observer
DL ReasoningEngine
Rule Engine
A Simple Framework (추가)
Context Ontology
BlackboardBlackboard
ContextRule
Context Rule (추가)
If[the alarm clock is set for the person] AND[the current time is 5 minutes before the set time] AND[the Person hasCurrentContext NotAtHomeContext]
Then[notify alarm-clock not to ring]
Context Ontology (추가)
TravelingCarContext
NotAtHomeContext
DrivingCarContext
owl:subclassOf
owl:subclassOf
Person
Activity
DrivingCar
owl:subclassOf
isEngagedInActivity
∃hasCurrentContext.DrivingCarContext
∃isEngagedInActivity.DrivingCar
owl:subclassOf∃isEngagedInActivity
∃hasCurrentContext
Context Instance (추가)
TravelingCarContext
NotAtHomeContext
DrivingCarContext
owl:subclassOf
owl:subclassOf
Person
Activity
DrivingCar
owl:subclassOf
isEngagedInActivity
∃hasCurrentContext.DrivingCarContext
∃isEngagedInActivity.DrivingCar
owl:subclassOf
isEngagedInActivity
hasCurrentContext
Tom
TomsActivity
isEngagedInActivity
TomsContext
isEngagedInActivity
hasCurrentContext∃hasCurrentContext.DrivingCarContext
∃isEngagedInActivity.DrivingCar
owl:subclassOf
73
OWL OWL 온톨로지의온톨로지의 특성특성
• 온톨로지는 많은 concept들로 표현
• Concept들 사이의 중요한 정보– Taxonomy– Consistency– etc
74
OWL OWL 온톨로지가온톨로지가 지원하는지원하는 기능기능
• 표현된 class 사이의 taxonomy를 자동으로 추론
• 새로운 class의 consistency 추론– NEWCONCEPT ≡ ¬WOMAN ⊓ MOTHER– NEWCONCEPT이 가능?– 자동으로 추론
75
OWL Ontology OWL Ontology 효용성효용성
• OWL 온톨로지가 필요한 이유?• OWL 온톨로지를 활용하기 위한 pre-requisite• OWL 온톨로지 overhead
76
OWL OWL 온톨로지의온톨로지의 필요성필요성
• Manual 지식 표현의 한계성– 사람이 표현하고자하는 지식의 taxonomy,
consistency를 manual하게 유지할 수 없다.– 예를들어, 100개의 concept이 있을 때, 이들 사이의
taxonomy와 consistency를 수작업으로 가능?
• 온톨로지의 능력을 활용– 기존의 표현방식(데이타베이스, Prolog 표현…)으로
온톨로지의 taxonomy와 consistency를 자동으로 확인하는 것은 많은 어려움
– OWL 온톨로지는 자동화가 가능한 능력이 있음
77
OWL OWL 온톨로지를온톨로지를 활용하기활용하기 위한위한 PrePre--requisite requisite
• OWL이 기반을 이루고 있는 description logic의기능에 대한 이해– DL의 주요한 목적
• Description logic이 제공하는 기능을 파악해서이를 활용– DL 추론 알고리즘의 기능
• Description logic이 제공하지 않는 기능을 파악하여 필요하면 OWL Rule (SWRL, …)을 활용
78
OWL OWL 온톨로지온톨로지 Overhead Overhead
• Description logic에 대한 이해 필요
• OWL 온톨로지 처리를 위해서는 parsing, model representation phase가 필요
• Tradeoff이 필요
79
Web SpaceWeb Space
OWL OWL 온톨로지온톨로지 활용도활용도
PrimitiveConcept,Property
Real World
Ontology-based Application
Ontology-based Application
Ontology Inference
Rule Inference
Legacy AlgorithmC6
C5C4
C3
C2C1
C7C6
C5C4
C3C2
C1
C7
Ontology Reasoner
80
Ontology Ontology 표현표현 언어언어
• Explicit specification을 위한 언어– Graphical notations 과 logic 기반
• Graphical notations– Semantic networks, Topic maps, UML, RDF
• Logic 기반 언어– Description logic (e.g., OIL, DAML+OIL, OWL),
Rules (e.g., RuleML, Prolog), First Order Logic (e.g., KIF), Conceptual graph,
81
OWLOWL
• W3C(World Wide Web Consortium)의 표준으로추천
• RDF, RDFS의 semantics를 확장하고 DAML+OIL의 successor
• OWL은 다양한 모델링 constructor를 가지고 있음
• OWL-Lite, OWL-DL, OWL-Full의 세 종류가 있음
82
OWL OWL 온톨로지의온톨로지의 구성구성 요소요소
• Class• Individual• Property Country
Korea
Japan
China
Opirus
Sonata
Car
Person
Kim
Park
hasStudent
83
Reasoning Reasoning
• OWL-DL로 표현된 온톨로지는 다음과 같은reasoning을 지원하는 reasoner들이 있다.– Subsumption– Equivalence– Consistency– Instantiation
84
OWL OWL 클래스클래스
• OWL은 온톨로지 표현언어
• OWL은 임의의 클래스를 효율적으로 표현할 수있음
• OWL 클래스 종류– Named 클래스
– Intersection, Union, Complement 클래스
– Restriction 클래스
– Enumerated 클래스
85
Named ClassesNamed Classes
Person
Professor
86
Intersection ClassesIntersection Classes
Human Female
87
Union ClassesUnion Classes
JavaProgrammer CProgrammer
88
Complement ClassesComplement Classes
SoccerPlayerTennisPlayer
ᄀTennisPlayer Π SoccerPlayer
89
Restriction Restriction
• Restriction은 anonymous class를 define하는 용도로 이용됨
• Description logic의 feature가 OWL에 반영됨
• 3 category– Quantifier restriction (existential , universal )– Cardinality restriction (min , equal , max )– Has Value restriction ( )
90
allValuesFromallValuesFrom ( )Restrictions( )Restrictions
• Property의 range 가 항상 특정한 클래스의 인스턴스를 가지는 것을 의미
• Example : 오직 아들만을 가지는 집단
SONhasChild
∀hasChild.Son
X
91
someValuesFromsomeValuesFrom( ) Restrictions( ) Restrictions
• Property의 range가 적어도 하나 이상의 클래스 인스턴스를 가지는 것을 의미
• Property의 range가 다른 클래스 인스턴스를가질 수도 있음
• Example : 최소한 한명의 아들을 가지는 집단
SON
Daughter
∃hasChild.Son
92
Ontology Ontology 표현표현 언어언어
OWLOWL
RDFRDF
W3C Recommendation
All were influenced by RDF
DAML = DARPA Agent Markup LanguageOIL = Ontology Inference Layer
DAML+OILDAML+OILDAML+OIL
DAMLDAML OILOIL
93
ProtProtééggéé
• Open-Source ontology editing 도구
• Stanford Medical Informatics에서 개발 중– U. of Manchester와 공동 개발 중
• 1980대 부터 개발
• OWL Plugin(Since2003)– OWL Full metamodel– Optimized user interface– Built-in reasoning access
94
온톨로지온톨로지 예예 ((TBoxTBox 와와 ABoxABox))
95
ProtProtééggéé를를 이용한이용한 Schema Schema 표현표현
96
ProtProtééggéé를를 이용한이용한 ABoxABox 표현표현
97
Classes / Logic ViewClasses / Logic View
Logic expressions of selected classLogic expressions of selected class
98
Classes / Properties ViewClasses / Properties View
Properties and Restrictions of selected classProperties and Restrictions of selected class
99
Classes TabClasses Tab
1. Class hierarchy1. Class hierarchy
2. Properties of selected class (i.e., name of class)
2. Properties of selected class (i.e., name of class)
3. Restriction of selected class (i.e., using ∀, ∃ quntifiers)
3. Restriction of selected class (i.e., using ∀, ∃ quntifiers)
100
Operation on classesOperation on classes
Create a new subclass of the selected class
Create a new subclass of the selected class
Create a new sibling of the selected class
Create a new sibling of the selected class
Delete the selected class
Delete the selected class
101
Properties Tab Properties Tab –– Object PropertyObject Property
1. Property hierarchy1. Property hierarchy
2. Properties of selected property (i.e., name of property)
2. Properties of selected property (i.e., name of property)
3. Domain/Range of selected property
3. Domain/Range of selected property
4. Property Characteristics of selected property
4. Property Characteristics of selected property
102
DatatypeDatatype PropertyProperty
Domain of selected datatype property
Domain of selected datatype property Range of selected
datatype property(i.e., integer, String)
Range of selected datatype property
(i.e., integer, String)
103
Individual TabIndividual Tab1. Individual in selected class (i.e., name of class)
1. Individual in selected class (i.e., name of class)
2. Related Properties(Red boxes are indispensable conditions)
2. Related Properties(Red boxes are indispensable conditions)
104
Operation on IndividualsOperation on Individuals
Create a new individual in the selected class
Create a new individual in the selected class
Copy a individual in the selected class
Copy a individual in the selected class
Delete the selected individual
Delete the selected individual
Create a new anonymous individual
in selected class
Create a new anonymous individual
in selected class
105
RestrictionsRestrictions
• Define a condition for property valuesallValuesFromsomeValuesFromhasValueminCardinalitymaxCardinalitycardinality
106
allValuesFromallValuesFrom RestrictionsRestrictions
SONhasChild
∀hasChild.SONX
DAUGHTER
107
someValuesFromsomeValuesFrom RestrictionsRestrictions
SON
∃hasChild.SON
hasChild
hasChildDAUGHTER
108
hasValuehasValue RestrictionsRestrictions
{Korea Japan America Germany}
∋hasCountry.COUNTRY
COUNTRY
hasCountry
109
Cardinality RestrictionsCardinality Restrictions
PERSON
≥1 hasChild
110
OutlineOutline
• Introduction to the Semantic Web• Ontology Languages for the Semantic Web• An Introduction to Description Logics• Reasoning with OWL• Description Logic Reasoning• Ontology-based Rule Inferences• Summary
111
Why Description Logic?Why Description Logic?
• Description logic은 knowledge representation 방식중의 한 종류– Semantic networks와 KL-One의 descendant– Domain model을 concepts (classes), roles
(relationships), 및 individual로 표현
• DL의 장점– DL은 formal semantic을 가지고 있음
• FOL의 decidable fragment
– Ontology 구축에 적합한 inference를 지원
112
Description LogicsDescription Logics의의 기본기본
• Concept을 표현하기에 적합하고, 추론이 가능한 언어– Empirically tractable inference
• 우리가 많이 사용하는 FOPC(First Order Predicate Calculus)는 추론이 tractable하지 않음
– Sound하고 complete한 추론 기능이 있음
• Concept 표현– Basic building blocks
• atomic concepts, atomic roles and individuals
– 보다 복잡한 concept을 표현하기 위한 operator 제공
• AND, OR, Existential quantifier, Universal quantifier, …
• Implicit knowledge about concepts and individuals can be inferred automatically with the help of inference procedures
113
Description LogicDescription Logic의의 추론추론 기능기능(1)(1)
• TBox 추론– Subsumption
• 임의의 concept들이 주어졌을 때 taxonomy 구축
• 예
– PARENT ≡ PERSON ⊓ ∃ hasChild.PERSON– WOMAN ≡ FEMALE ⊓ PERSON– MOTHER ≡ FEMALE ⊓ PARENT
• Taxonomy
114
Description LogicDescription Logic의의 추론추론 기능기능(2)(2)
• ABox 추론– Instantiation
• Individual i가 클래스 C의 인스턴스인지를 테스트
– Realization• Individual i가 속하는 most specific named 클래스 C를 알
아내는 작업
– Retrieval• 클래스 C에 속하는 인스턴스를 모두 알아내는 추론
115
Ontology Ontology 구축에구축에 필요한필요한 Inference Inference 기능기능
• Ontology를 구성하는 class들 사이의taxonomy, consistency 자동 파악
• Ontology class들이 구축된 상태에서, instance들을 자동으로 처리하는 기능
116
Description LogicDescription Logic
• TBox와 ABox로 구성됨– Terminological part of the KB (TBox)– Assertional part of the KB (Abox)
TBox
ABox
DescriptionLanguage Reasoning
117
Basic Description LogicBasic Description Logic
• Atomic concepts– Lecturer, Student, ITcourse, EEcourse
• Atomic roles– Binary relation– teaches, take
• Universal concept : • Empty concept : • Concept constructor
– Negation– Intersection– Value restriction– Limited existential quantification
118
DL ExamplesDL Examples
• Student가 아닌 모든 것
• IT와 EE 공통의 course
• IT course만을 수강하는 학생
• 최소한 하나의 강의를 하는 강사
119
Some Description LogicSome Description Logic
• Class(Concept)– Human, MaleHuman, FemaleHuman
• Instance– MaleHuman(John), FemaleHuman(Sarah)
• Property(Role)– hasFriend(John, Sarah)
• Axioms– Subsumption
• Human ⊒ MaleHuman Human ⊒ FemaleHuman
– Disjointness• MaleHuman ⊓ FemaleHuman ⊑⊥
– Property cardinality• Car ⊑ hasWheels ≧ 4 ⊓ hasWheels ≦ 4
– Property quantificaion• Car ⊑ ∃hasPart.Engine ⊓ ∀hasDriver.Human
120
Description LogicDescription Logic
• Concepts– parent ≡ person ⊓ ∃ hasChild.person– woman ≡ female ⊓ person– mother ≡ female ⊓ parent
• 어떤 종류의 inference?– Satisfiability of (named) concepts– Subsumption of (named) concepts
121
Concept Concept SatisfiabilitySatisfiability
• The concepts woman, mother, parent are satisfiable
• ¬woman ⊓ mother ? : unsatisfiable
122
Concept Concept SubsumptionSubsumption
• Is a mother always a woman?• Woman concept subsumes mother concept?• DL reasoners는 subsumption hierarchy
(taxonomy)를 추론
– parent ≡ person ⊓ ∃ hasChild.person– woman ≡ female ⊓ person– mother ≡ female ⊓ parent
123
Model ExampleModel Example
PARKI = KOWNI = SEOI =
△I = { , , , , cs1201, cs3012, ee1500, all students in cs1201}
CS1201I = cs1201 CS3012I = cs3012 EE1500I = ee1500
HANI =
LecturerI = {< >, < >}CourseI = {<cs1201>, <cs3012>, <ee1500>}
StudentI = {< >, < >}
teachesI = {< , cs1201>, < , cs3012>, < , ee1500>}
takesI = {< , cs1201>, < , cs1201>, …}
124
Interpretation (model)Interpretation (model)
Domain Interpretation function
125
DLDL를를 이용한이용한 데이터데이터 모델모델
• TBox
126
DLDL를를 이용한이용한 인스턴스인스턴스 모델모델
• ABox
127
DL의 종류
• ALC, SHIQ, SHOIN, …
128
AL AL (Attribute Logic)(Attribute Logic)
• AL’s syntax rule
129
ALAL’’ss SemanticsSemantics
hasChild(john, mary)hasChild(john, liz)hasChild(jones, deborah)hasChild(jones, andrew)hasChild(jones, jim)hasChild(mary, catherine)
Concept C
R
R
R
R
X
130
ALAL’’ss SemanticsSemantics
hasChild(john, mary)hasChild(john, liz)hasChild(jones, deborah)hasChild(jones, andrew)hasChild(jones, jim)hasChild(mary, catherine)
Concept C
R
R
R
R
131
OWL OWL 과과 DLDL
132
Further DL Concepts and Role Further DL Concepts and Role ConstructorsConstructors
133
OWL SyntaxOWL Syntax
134
Inference Services in DLInference Services in DL
Terminological Reasoning• Subsumption check - checks if one concept is a subconcept of
another• Consistency check - checks for (in)consistency of concept
definitions• Taxonomy construction - explicit concept hierarchy• Classification - determines the concepts that immediate subsume
or are subsumed by a given concept
Instance Reasoning• Consistency check - existence of a model of А• Realisation - given a partial description of an instance, finds the
most specific concepts that describe it• Individual retrieval - finds all instances that are described by a
given concept
135
Ontology ReasoningOntology Reasoning
• 온톨로지에 있는 inconsistency의 detection• 온톨로지의 subsumption hierarchy를 발견
• Ontology reasoning 연구 동향– TBox reasoning– ABox reasoning
• SWRL rule engine
136
TBoxTBox ReasoningReasoning
• 주어진 ontology의 consistency 유지 및classification 작업
• 임의의 class C1, C2 사이의 subsumption test 과정을 통해서 hierarchy 구축
• SHOIN(D) 수준의 온톨로지에 대한 TBoxreasoning이 가능한 수준
• Tableaux method를 이용한 온톨로지 class사이의 subsumption test
137
ABoxABox Reasoning Reasoning
• 대용량 Abox reasoning을 위한 연구
• Tableaux 방식을 ABox reasoning에 쓰는 경우overhead 발생
• Disjunctive Datalog 방식– KAON2
138
Reasoning & DL based KBsReasoning & DL based KBs
• The more expressive the language, the greater the complexity of reasoning.
TBoxTBox
ABoxABox
ReasoningReasoningDLDL
Knowledge Base
ApplicationsApplications RulesRules
139
Ontology Ontology ReasonerReasoner
• Tableaux 방식 기반– FaCT, FaCT++– Racer, RacerPro– Pellet
• Disjunctive Datalog 방식 기반– KAON2
140
TBoxTBox 추론추론
141
ABoxABox 추론추론
Inferred
142
ABoxABox 추론추론
• ABox 추론 Application
143
ABoxABox 추론추론 –– Pellet runPellet run
// Create model by using Pellet ReasonerOntModel model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC );
// Read Ontologymodel.read(ʺfile:/c:/TestOwl.owlʺ);
// Model / KB preparemodel.prepare();
// ABox reasoning ‐ instantiationinstantiation( “Wife”, “marry” , model );
// ABox reasoning ‐ retreivalretreival( “Wife” , model );
// ABox reasoning ‐ realizationrealization( “marry” , model );
144
ABoxABox 추론추론 –– Instantiation Method Instantiation Method
private boolean instantiation(String className, String individualName, OntModel model) {
// Set name‐spaceString ns = http://www.ssu.ac.kr/ailab#;
// Get a class corresponding a given class nameOntClass ontClass = model.getOntClass(ns + className);if(ontClass == null) return false;
// Get all instances of the classIterator it = ontClass.listInstances();
while(it.hasNext()){
String instanceName = it.next().toString();
// Get a name of instanceinstanceName = instanceName.substring( instanceName.indexOf(ʺ#ʺ)+1);
// Compare with given instance nameif(individualName.equals(instanceName)) return true;
}return false;
}
145
ABoxABox 추론추론 –– Retrieval MethodRetrieval Method
private String retrieval(String className, OntModel model) {
String rval = ʺʺ;
// Set namespaceString ns = http://www.ssu.ac.kr/ailab#;
// Get a class corresponding a given class nameOntClass ontClass = model.getOntClass(ns + className);if(ontClass == null) return ʺFAILEDʺ;
// Get all instances of the classIterator it = ontClass.listInstances();
while(it.hasNext()){String instanceName = it.next().toString();
// Get a name of instanceinstanceName = instanceName.substring( instanceName.indexOf(ʺ#ʺ)+1);
if( !rval.equals(ʺʺ) )rval += ʺ, ʺ;
rval += instanceName;}return rval;
}
146
ABoxABox 추론추론 –– Realization MethodRealization Method
private String realization(String individualName, OntModel model) {
// Set namespaceString ns = http://www.ssu.ac.kr/ailab#;
// Get a instance corresponding a given instance nameIndividual individual = model.getIndividual(ns + individualName);if(individual == null) return ʺFAILEDʺ;
// Get a class of instanceResource resource = individual.getRDFType(true);
// Get a name of classString className = resource.toString().substring( resource.toString().indexOf(ʺ#ʺ)+1);
return className;}
147
OutlineOutline
• Introduction to the Semantic Web• Ontology Languages for the Semantic Web• An Introduction to Description Logics• Reasoning with OWL• Description Logic Reasoning• Ontology-based Rule Inferences• Summary
148
Description LogicsDescription Logics 과과 OWLOWL
• Semantic web에서 이용되는 온톨로지 markup 언어인DAML+OIL, OWL은 description logics에 기반을 두고있음
DL: Formal Semantics&Reasoning Support
Frame-Based Systems:Epistemological Modelling Primitives
Web Languages:XML and RDF based Syntax
OWL
149
Open World vs. Closed WorldOpen World vs. Closed World
• Open world reasoning – 시스템에 있는 facts나 axiom으로 부터 derive되지
않는 내용은 unknown으로 고려
– 예• Alex 는 Bob 과 Jane을 자식으로 가지고 있다.
• Closed World Reasoning– Alex는 두명의 자식을 가지고 있다.
• Open World Reasoning– Alex는 최소한 두명의 자식을 가지고 있다.
또다른 예 : OWA vs. CWA(추가)
• “Park” is a citizen of “Korea”– Query : “Park” is a citizen of “Italy”?– CWA : no– OWA : I can’t tell
• “철수” has mother “순이”“has mother” cardinality는 1– “철수” has mother “영이”– CWA : error
• CWA는 Unique Name Assumption (UNA)
– OWA : cardinality가 1이므로 “순이”와 “영이”는 같다
• OWA는 UNA를 채택하지 않음
150
Do you see the difference with a relational database? ((추가추가))
<triple 32: “person2” “type” “person”><triple 33: “person2” “first-name” “Rose”><triple 34: “person2” “middle-initial” “Elizabeth”><triple 35: “person2” “last-name” “Fitzgerald”><triple 36: “person2” “suffix” “none”><triple 37: “person2” “alma-mater” “Sacred-Heart-Convent”><triple 38: “person2” “birth-year” “1890”><triple 39: “person2” “death-year” “1995”><triple 40: “person2” “sex” “female”><triple 41: “person2” “spouse” “person1”><triple 58: “person2” “has-child” “person17”><triple 56: “person2” “has-child” “person15”><triple 54: “person2” “has-child” “person13”><triple 52: “person2” “has-child” “person11”><triple 50: “person2” “has-child” “person9”><triple 48: “person2” “has-child” “person7”><triple 46: “person2” “has-child” “person6”><triple 44: “person2” “has-child” “person4”><triple 42: “person2” “has-child” “person3”><triple 60: “person2” “profession” “home-maker”>
151[Franz]
An artist impression of the same info in a RDBM An artist impression of the same info in a RDBM
((추가추가))
152152[Franz]
With a graph database ((추가추가))
• You can add new predicates without changing any schema
• One-to-many relations are directly encoded without the indirection of tables
• You never think about what to index because all the predicates are indexed
153
154
Reasoning with OWL Reasoning with OWL
• OWL의 기반인 description logic이 지원하는 추론 기능
• Description logic의 추론 기능– 다수의 온톨로지 엔지니어가 만드는 concept에 대한
추론
– Concept들 간의 taxonomy 정보 추론• 온톨로지 엔지니어는 concept들 간의 taxonomy 유지로부
터 free
– Instance에 대한 추론• Instance가 주어졌을 때, 정의된 concept들과의 관계
155
DIG InterfaceDIG Interface
• DIG interface – Description logic Implementation Group– a convenient high-level interface for DL
reasoners– many DL reasoners (FACT++, RacerPro, Pellet,
etc) support the DIG interface– a simple API for a general DL system– more easily allow for the construction of highly
portable and reusable components or extension
• Protégé can be connected many DL reasoners via DIG interface.
156
ReasonerReasoner SetupSetup
ProtégéProtégé OntologyReasonerOntologyReasonerDIG
OWL TBox, ABox
157
ReasonerReasoner SetupSetup
• Connect Protégé with ontology reasoners– RacerPro, Pellet, or KAON2
• Port setup for reasoners– RacerPro port : 8080– Pellet : 8081– KAON2 : 8088
158
159
160
SubsumptionSubsumption ReasoningReasoning
• concept: Person• Parent ≡ (Person ∩ ∃ hasChild.Person)• Woman ≡ (Person ∩ Female)• Mother≡ (Parent ∩ Female)
161
SubsumptionSubsumption Reasoning Reasoning
classified
162
SubsumptionSubsumption ReasoningReasoning• concept: Person• role: hasAge (Person, Integer)• Adult ≡ (Person ∩ ∃ hasAge > 30)• Senior ≡ (Person ∩ ∃ hasAge > 60)
163
ProtProtééggéé + + ReasonerReasoner (Pellet,KAON2,Racer)(Pellet,KAON2,Racer)
• TBox reasoning
164
Inconsistent ClassInconsistent Class
• Identify inconsistency based on class definition
Disjoint(Prof, Staff, Student)
Class(Prof partial)Class(Staff partial
restriction (evaluatesomeValuesFrom(Student)))
Class(Student partial)
ObjectProperty(evaluatedomain(Prof)range(Student))
165
Class ScreenClass Screen
166
Property ScreenProperty Screen
167
Check ConsistencyCheck Consistency
168
Debugger SetupDebugger Setup
169
Start Debugger for ExplanationStart Debugger for Explanation
170
DebugDebug
171
ExplanationExplanation
172
ProtProtééggéé + + RacerProRacerPro• TBox reasoning
173
ClassificationClassification
• Taxonomy reasoning
Class(Faculty partial)Class(FullProf partial
restriction (teach someValuesFrom(Student)))
Class(Student partial)
ObjectProperty(teachdomain(Faculty)range(Student))
174
ProtProtééggéé ScreenScreen
175
OutlineOutline
• Introduction to the Semantic Web• Ontology Languages for the Semantic Web• An Introduction to Description Logics• Reasoning with OWL• Description Logic Reasoning• Ontology-based Rule Inferences• Summary
176
Reasoning in Description Logic Reasoning in Description Logic
• 기종 idea – Basic syntactic building block이 주어지고
• Atomic concepts, atomic roles, individuals
– Complex concept을 build하기 위한 limited constructor가 주어지면
– Complex concepts을 생성하고
– Complex concepts 사이에 존재하는 implicit 지식을자동으로 추론
• Subsumption reasoning
177
Implicit Knowledge Inference?Implicit Knowledge Inference?
다음과 같은 Tbox가 있다고 가정을 하면
다음과 같은 subsumption hierarchy를 자동으로 추론
178
DL ReasoningDL Reasoning
• Subsumption– 하나의 concept이 다른 concept보다 일반적인지
• Equivalence– 두개의 concept이 equivalent인지 확인
• Consistency– 하나의 concept이 의미가 있는지
• Membership• 위의 모든 문제는 KB consistency로 귀착
– 예를들면,
179
DL Reasoning MethodsDL Reasoning Methods
• 간단한 경우는 structural subsumption 방식을취하고
• 보다 복잡한 경우는 tableaux algorithm을 이용함
• 그 외에도 equality-based resolution을 사용하는 방법들도 있음
180
간단한간단한 DL Reasoning ExampleDL Reasoning Example
예를 들어 다음과 같은 두개의 concept이 있을 떄, subsumption은?
위의 C,D를 normal form으로 변형하여 하나씩 비교하면
181
Idea of Tableaux ReasoningIdea of Tableaux Reasoning
Something to prove
not satisfiable
apply expansion rule
Search and Backtrack
Show that all terminal nodes are contradiction
L(x)
182
보다보다 복잡한복잡한 DL Reasoning ExampleDL Reasoning Example
다음과 같은 subsumption이 만족하는지를 보이는 경우
일반적으로 를 보이기 위해서는 가 false임을 보이므로
다음이 consistent 하지 않음을 보이면 됨
위의 식을 Negation Normal Form으로 만들면
C
D
183
Tableaux Reasoning Tableaux Reasoning 과정과정
C는 consistent하다, 따라서 는 Hold되지 않는다!!
184
또또 다른다른 Example Example
다음과 같은 subsumption이 만족하는지를 보이는 경우
가 consistent하지 않다는 것을 보이면 됨
185
Tableaux Tableaux 과정과정 (step)(step)
위의 식을 Negation Normal Form으로 바꾸어서
모든 branch들은 “clash”를 포함한다.따라서, C는 consistent 하지 않다.그러므로, 는 Hold된다!!
186
OutlineOutline
• Introduction to the Semantic Web• Ontology Languages for the Semantic Web• An Introduction to Description Logics• Reasoning with OWL• Description Logic Reasoning• Ontology-based Rule Inferences• Summary
187
OntologyOntology--based Inference based Inference
• DL 기반의 reasoning은– Tbox를 위한 subsumption, classification,
consistency – Abox를 위한 instantiation, realization, retrieval
• 그 이외의 경험적 지식을 구현하는 ontology-based 추론이 필요함– Ontology의 클래스, Property, 인스턴스를 이용한
rule을 작성해서 활용하는 방식
• JessTab, SWRL과 같은 추론 방식
188
JessTabJessTab
• Protégé 와 Jess를 연동
• Jess– Java Expert System Shell; based on CLIPS– Forward chaining; production rules– Developed by Sandia Laboratories– http://herzberg.ca.sandia.gov/jess/
189
HistoryHistory
CLIPS
Jess
Protégé-2000
ArtOPS5
Protégé-II
Cool
Protégé-I
Java
JavaKIF/OKBC/Clos
Descendants
Influences
Protégé/Win
JessTab
[Henrik Eriksson]
190
JessTabJessTab
• Protégé와 Jess의 integration 목적으로 만든Protégé plugin
• JessTab 기능– Protégé의 working memory와 Jess의 working
memory사이의 sync 맞추어 주고
– Jess의 강력한 추론 기능을 활용하여 ontology inference 기능 수행
191
Jess Jess 와와 ProtProtééggéé의의 IntegrationIntegration
• Protégé와 Jess의 mapping– Protégé의 classes는 Jess fact template로 map– Protégé instances는 Jess facts로, Jess facts는
Protégé instances로 map– Jess working memory의 변화가 Protégé working
memory로 바로 반영됨, 마찬가지로 Protégéworking memory의 변화가 Jess working memory로 반영됨
• Protégé GUI하에서 Jess를 구동하여 Protégéontology inference
• Java application에서 Protégé와 Java를 embed 할 수 있음
192
JessTabJessTab 역할역할
Protege Jess EngineJessTab
Protégé Working Memory
Property
IndividualClass
Jess Working Memory
Slot
FactDeftemplate
193
Start Start JessTabJessTab in the Protin the Protééggéé1. Project > Configure 메뉴선택1. Project > Configure 메뉴선택 2. Configure창에서 JessTab 선택2. Configure창에서 JessTab 선택
3. JessTab 추가됨3. JessTab 추가됨
194
JessTabJessTab Editor in the ProtEditor in the Protééggéé
1. Default Engine1. Default Engine
2. Subtabs2. Subtabs
3. Jess Version3. Jess Version
4. Jess Prompt4. Jess Prompt
5. Command input box5. Command input box 6. Edit Control tab6. Edit Control tab
195
JessTabJessTab ExampleExample
- Mary는 John, Tom의 어머니이다.
John individualJohn individual
hasSibling 관계가 없음hasSibling 관계가 없음
Tom individualTom individual
hasSibling 관계가 없음hasSibling 관계가 없음
196
JessTabJessTab Example(JessExample(Jess Rule)Rule)
(defrule Check_hasSibling_Rule; Sibling관계 추론 Rule, 같은 어머니를 모시고 있고 서로 다른객체
?f <‐ (object (is‐a Man) (OBJECT ?p) (hasMother ?n) (hasSibling ))?g <‐ (object (is‐a Man) (OBJECT ~?p) (hasMother ?n) (hasSibling ))
=>; 두객체는 서로 hasSibling관계이다.(slot‐set ?f hasSibling ?g)(slot‐set ?g hasSibling ?f)
)
197
JessTabJessTab Example(Example(수행후수행후))
- John, Tom은 Sibling관계이다.
John individualJohn individual
John ,Tom의 Sibling관계추론John ,Tom의 Sibling관계추론
Tom individualTom individual
Tom, John의 Sibling관계추론Tom, John의 Sibling관계추론
198
JessTabJessTab을을 이용한이용한 Ontology InferenceOntology Inference
Pre Processing
Loading OWL File Loading Jess Function
Loading JessTab FunctionLoading JessRule Embeded
JessTab
Run JessTab
Run JessRule embeded JessTab
Ontology Update
199
Use Java APIUse Java APIImport jess.*;Import JessTab.*;
// Jess Engine, JessTab Engine LoadingRete engine = new Rete();engine.addUserPackage(new JessTabFunctions());
// Protégé Project Loadingengine.executeCommand(“(load‐project JessTabTest.pprj)”);
// Jess Rule Loadingengine.executeCommand(“(batch JessRule.clp)”);
// Runengine.executeCommand(“(run)”);
// Protégé Project Savingengine.executeCommand(“(save‐project JessTabTest.pprj)”);
200
SWRLSWRL
• Semantic Web Rule Language– 시맨틱웹의 rule 언어를 지향하고 있는 단계
– Horn 과 같은 규칙 표현• Conclusion :- Cond1, …, Condn
– SWRL은 OWL 개념인 class, property, individual로표현
201
SWRL Rule EngineSWRL Rule Engine
• 온톨로지의 SWRL을 실핼할 수 있는 엔진– SWRL API가 SWRL extract– OWL API가 OWL 온톨로지에서 필요한 부분 extract– OWL knowledge를 SWRL knowledge로 map
• SWRL bridge가 개발되었음– Protégé + JESS engine
• 아직 개발되고 있는 단계
202
SWRL SWRL 규칙규칙 예예
• Person(?x) ⋀ hasChild(?x, ?y) → Married(?x)
• Person(Fred) ⋀hasSibling(Fred,?s) ⋀Man(?s) →hasBrother(Fred,?s)
• Person(?p) ⋀ hasAge(?p, ?age) ⋀swrlb:greaterThan(?age, 17) →Adult(?p)
203
204
205
206
207
208
209
210
211
212
시맨틱 Reasoning 간단한 예(추가)
• 상황인지 기반 시맨틱 reasoning– Description logic 기반의 reasoning – SWRL reasoning
• 상황 온톨로지
• 상황인지 기반 SWRL 규칙
Context Interpreter Context Observer
DL ReasoningEngine
Rule Engine
A Simple Framework (추가)
Context Ontology
BlackboardBlackboard
ContextRule
Context Rule (추가)
If[the alarm clock is set for the person] AND[the current time is 5 minutes before the set time] AND[the Person hasCurrentContext NotAtHomeContext]
Then[notify alarm-clock not to ring]
Context Ontology (추가)
TravelingCarContext
NotAtHomeContext
DrivingCarContext
owl:subclassOf
owl:subclassOf
Person
Activity
DrivingCar
owl:subclassOf
isEngagedInActivity
∃hasCurrentContext.DrivingCarContext
∃isEngagedInActivity.DrivingCar
owl:subclassOf∃isEngagedInActivity
∃hasCurrentContext
Context Instance (추가)
TravelingCarContext
NotAtHomeContext
DrivingCarContext
owl:subclassOf
owl:subclassOf
Person
Activity
DrivingCar
owl:subclassOf
isEngagedInActivity
∃hasCurrentContext.DrivingCarContext
∃isEngagedInActivity.DrivingCar
owl:subclassOf
isEngagedInActivity
hasCurrentContext
Tom
TomsActivity
isEngagedInActivity
TomsContext
isEngagedInActivity
hasCurrentContext∃hasCurrentContext.DrivingCarContext
∃isEngagedInActivity.DrivingCar
owl:subclassOf
Summary
• 시맨틱웹은 기존의 웹의 evolution으로 지능형 소프트웨어가 autonomous하게 동작하기 위한 다양한 소프트웨어 인프라를 제공
• 시맨틱웹 구현을 위한 인프라로서 기존의 지능형 소프트웨어 기술과 아울러 지능형 에이전트를 위한 메타데이터의 필요성이 증대
• 메타데이터를 구축하기 위한 다양한 시도가 이루어 지고있고, 그 중의 한 방식으로 온톨로지를 이용하는 시도가이루어 지고 있음
218
Summary
• 온톨로지를 W3C가 제안하는 OWL을 이용하기 위해서는OWL이 장점과 단점을 잘 파악해서 semantic application의 수준에 따라서 결정해야함. OWL의 장점을 활용하지 않는 경우는 온톨로지 활용을 신중하게 고려할 필요가 있음
• OWL은 기존의 프로그래밍 언어와 다르게 description logic에 기반을 두고 있음. 따라서, DL에 대한 이해가 높으면 OWL을 이용해서 온톨로지를 구축하고, 온톨로지기반의 지능형 에이전트 시스템 구축하는 데 새로운 패러다임을 활용할 수 있음
• 온톨로지 추론은 DL 추론과 온톨로지를 활용하는 경험적규칙 추론으로 구분되므로, 이의 특성을 잘 파악해서 필요한 온톨로지 추론 엔진을 결정할 필요가 있음
219
AllegroGraphAllegroGraph as RDF database as RDF database ((추가추가))
221[Franz]
Building semantic relations on top of RDF Building semantic relations on top of RDF ((추가추가))(<-- (male ?x)
(q ?x !o:sex !o:male))
(<-- (female ?x)(q ?x !o:sex !o:female))
(<-- (father ?x ?y)(male ?x)(q ?x !o:has-child ?y))
(<-- (mother ?x ?y)(female ?x)(q ?x !o:has-child ?y))
(<-- (parent ?x ?y)(father ?x ?y))
(<-- (parent ?x ?y)(mother ?x ?y))
222
(<-- (grandparent ?x ?y)(parent ?x ?z)(parent ?z ?y))
(<-- (grandchild ?x ?y)(grandparent ?y ?x))
(<-- (ancestor ?x ?y)(parent ?x ?z)(ancestor ?z ?y))
(<-- (descendent ?x ?y)(ancestor ?y ?x))
[Franz]
A straight forward query A straight forward query ((추가추가))
rdf(18) : ((male ?x) (full-name ?x ?name) (print ?name))
“Michael nil Allen”“Alfred nil Tucker”“Cart Harmon Hood”“Mark nil Bailey”“Andrew Mark Cuomo”“Paul Michael Hill”“Jeffrey Robert Ruhe”“David Lee Townsend”“Robert B Pender”“James Peter McKelvy”“Arnold Alois Schwarzenegger”“Edwin Arthur Schlossberg”“Patrick Joseph Kennedy”“Edward M Kennedy”“William Kennedy Smith”“Stephen E Smith”…and twenty more…
223[Franz]