29
Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Embed Size (px)

Citation preview

Page 1: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Semantic Web Ontologies

CS 431 – 20040317Carl Lagoze – Cornell University

Acknowledgements:Alun Preece

Page 2: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Components of the Semantic Web

Page 3: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Knowledge Representation and AI meeting the Web

• Knowledge representation is not new– Formalisms

• Semantic networks• Frame systems

– Frames (objects)– Slots (attributes and properties)

– Languages• LOOM• Classic• Cyc-L

– Logics• Description Logics (DLs)

Page 4: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

So why re-invent it for the Web

• Not re-invention– Same underlying formalisms (frames, slots, description

logic)• But new factors

– Massive scale• Tractability• Knowledge expressiveness must be limited or reasoning must

be incomplete – Lack of central control

• Need for federation• Inconsistency, lies, re-interpretations, duplications• New facts appear and modify constantly

– Open world vs. Close world assumptions• Contrast to most reasoning systems that assume anything

absent from knowledge base is not true• Need to maintain monotonicity with tolerance for

contradictions– Need to build on existing standards

• URI, XML, RDF

Page 5: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Why aren’t XML schema good enough?

• XML schema is designed to primarily describe structure and constraints on documents– Rich datatypes– Grammar for describing structure of elements (and

attributes)

• Incomplete modeling of is-a relationships– Top-down inheritance of attributes from superclasses

to subclasses with extension and restriction is clumsy

• E.g., student as person with a student # and age<28

– Bottom-up inheritance of instances to superclasses is not automatic

Page 6: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Brief review of RDF

• Data model for defining machine-processible semantics of data

• Three main object types:– Resources

• Primitive metadata is URI

– Properties• Sub-class of resource

– Statements• (:s :p :o)

• Graph model that is serializable in XML

Page 7: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

RDF Schemas A building block for assembling ontology languages

• Declaration of vocabularies– Classes and class hierarchies– properties defined by a particular community– characteristics of properties and/or constraints on

corresponding values

• Provides substructure for inferences based on existing triples

• Schema language is an expression of basic RDF model• Schema Type System - Basic Types

– Property, Class, SubClassOf, Domain, Range– Minimal (but extensible) at this time– Expressible in the RDF model and syntax

Page 8: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

What is an Ontology?

• A formal specification of conceptualization shared in a community

• Vocabulary for defining a set of things that exist in a world view

• Formalization allows communication across application systems and extension

• Parallel concepts in other areas:– Domains: database theory– Types: AI– Classes: OO systems– Types/Sorts: Logic

• Global vs. Domain-specific

Page 9: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

“An ontology is an explicit, partial specification of a conceptualization that is expressible as a meta-level viewpoint on a set of possible

domain theories for the purpose of modular design, redesign and reuse of knowledge-intensive system components”

(Schreiber, Wielinga & Janswijer, 1995)

<{a, b, c, d, e}, {on, above, clear, table}>

Universe of discourse Relevant relations

Page 10: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

XML and RDF are ontologically neutral

• No standard vocabulary just primitives– Resource, Class, Property, Statement, etc.

• Compare to classic first order logic– Conjunction, disjunction, implication, existential,

universal quantifier

Page 11: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Components of an Ontology

• Vocabulary (concepts)• Structure (attributes of concepts and

hierarchy)• Logical characteristics of concepts & attributes

– Domain and range restrictions– Properties of relations (symmetry, transitivity)

Page 12: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Wordnet

• On-line lexical reference system, domain-independent

• >100,000 word meanings organized in a taxonomy with semantic relationships– Synonymy, meronymy, hyponymy, hypernymy

• Useful for text retrieval, etc.• http://www.cogsci.princeton.edu/~wn/online/

Page 13: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

CYC

• Effort in AI community to accommodate all of human knowledge!!!

• Formalizes concepts with logical axioms specifying constraints on objects and classes

• Associated reasoning tools• Contents are proprietary but there is OpenCyc

– http://www.opencyc.org/

Page 14: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Ontologies for the Web

• Lots of Participants and $$$– Web Ontology Working Group– Distributed Agent Markup Language– Ontology Inference Layer– OntoWeb– Schemas Project

• OWL (Web Ontology Language) – develop standard for encoding ontologies on top of RDF Schema

Page 15: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Web Ontology Language (OWL)

• W3C Web Ontology Working Group (WebOnt)• Follow on to DAML, OIL efforts• W3C Recommendation• Vocabulary extension of RDF

Page 16: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Extending RDF(S) with OWL

RDFS OWL

•Class, sub-class definition

•Property (attribute), sub-property definition

•Domain, range constraints

•Class definition: Conjunction, disjunction, negation

•Property constraints: universality, existence, cardinality

•Properties of properties: transitivity, symmetry

Page 17: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Species of OWL

• OWL Lite– Good for classification hierarchies with simple constraints

(e.g., thesauri)– Reasoning is computational simple and efficient

• OWL DL– Computationally complete and decidable (computation in

finite time)– Correspondence to description logics (decidable fragment

of first-order logic)

• OWL Full– Maximum expressiveness– No computational guarantees (probably never will be)

• Each language is extension of simpler predecessor

Page 18: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Description Logics

• Fragment of first-order logic designed for logical representation of object-oriented formalisms– Frames/classes– Do not stress representation of behaviors

• High expressivity with decidability and completeness

• Universal and existential quantification, disjunction, conjunction, negation

• Concepts, roles, individuals• Representation as a collection of statements,

with unary and binary predicates that stand for concepts and roles, from which deductions can be made

Page 19: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

OWL Lite Summary

Page 20: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

OWL DL and Full Summary

Page 21: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Namespaces and OWL

Page 22: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

OWL Class Definition

Page 23: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Why owl:class vs. rdfs:class

• Rdfs:class is “class of all classes”• In DL class can not be treated as individuals

(undecidable)• Thus owl:class, which is expressed as

rdfs:subclass of rdfs:class– No problem for standard rdf processors since an

owl:class “is a” rdfs:class

• Note: there are other times you want to treat class of individuals– Class drinkable liquids has instances wine, beer, ….– Class wine has instances merlot, chardonnay,

zinfandel, …

Page 24: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

OWL class building operations

• disjointWith– No vegetarians are carnivores

• sameClassAs (equivalence)• Enumerations (on instances)

– The Ivy League is Cornell, Harvard, Yale, ….

• Boolean set semantics (on classes)– Union (logical disjunction)

• Class parent is union of mother, father– Intersection (logical conjunction of class with

properties)• Class WhiteWine is conjunction of things of class wine

and have property white– complimentOf (logical negation)

• Class vegetarian is disjunct of class carnivore

Page 25: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

OWL Properties

Page 26: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

OWL property building operations & restrictions

• Transitive Property– P(x,y) and P(y,z) -> P(x,z)

• SymmetricProperty– P(x,y) iff P(y,x)

• Functional Property– P(x,y) and P(x,z) -> y=z

• inverseOf– P1(x,y) iff P2(y,x)

• InverseFunctional Property– P(y,x) and P(z,x) -> y=z

• Cardinality– Only 0 or 1 in lite and full

Page 27: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

OWL DataTypes

• Full use of XML schema data type definitions• Examples

– Define a type age that must be a non-negative integer

– Define a type clothing size that is an enumeration “small” “medium” “large”

Page 28: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

OWL Instance Creation

• Create individual objects filling in slot/attribute/property definitions

<Person ref:ID=“William Arms”><rdfs:label>Bill</rdfs:label><age><xsd:integer rdf:value=“57”/></age><shoesize><xsd:decimal rdf:value=“10.5”/></shoesize>

</Person>

Page 29: Semantic Web Ontologies CS 431 – 20040317 Carl Lagoze – Cornell University Acknowledgements: Alun Preece

Language ComparisonDTD XSD RDF(S) OWL

Bounded lists (“X is known to have exactly 5 children”)

X

Cardinality constraints (Kleene operators) X X XClass expressions (unionOf, complementOf) XData types X XEnumerations X X XEquivalence (properties, classes, instances) XFormal semantics (model-theoretic & axiomatic)

X

Inheritance X XInference (transitivity, inverse) XQualified contraints (“all children are of type person”

X

Reification X X