Title: Semantic Web Technology
1Semantic Web Technology
- COMP3150/4700 E-technology Architectures, Tools
and Applications - (Fall 2007)
2Lecture Outline
- Basic Ideas of RDF
- The Language of RDF
- Basic Ideas of RDF Schema
- ?he Language of RDF Schema
- Basic Ideas of OWL
- The Language of OWL
3Lecture Outline
- Basic Ideas of RDF
- The Language of RDF
- Basic Ideas of RDF Schema
- ?he Language of RDF Schema
- Basic Ideas of OWL
- The Language of OWL
4Why XML is not sufficient?
- XML is a universal metalanguage for defining
markup - However, XML does not provide any means of
talking about the semantics (meaning) of data - E.g., there is no intended meaning associated
with the nesting of tags - It is up to each application to interpret the
nesting.
5Nesting of Tags in XML
-
- ipod
-
-
- Apple
-
- Opposite nesting, same information!
- How to solve this ambiguity?
ipod is a product of Apple.
6Basic Ideas of RDF
- RDF Resource Description Framework
- Basic building block (also called a statement)
resource-property-value triple - RDF has been given a syntax in XML
- This syntax inherits the benefits of XML
7Resources
- In RDF, everything is referred to as a resource
(with a URI) which can be - a thing (e.g., book, person, etc.) or
- a concept (e.g., ownership, role, etc.)
- Recall that URI stands for Universal Resource
Identifier that can be - a URL (Web address) or
- some other kind of unique identifier
8Properties
- A special kind of resources, e.g.,
- Peter (resource) Develop (property) Software
Package ABC (value) - Develop (resource) type-of (property) IT Job
(value) - Describe relations between resources
- E.g. writtenBy, hasAge, hasTitle, etc.
- Properties are also identified by URIs.
9Statements
- Statements assert the properties of resources
- A statement is an resource-property-value triple
- Values can be resources or literals
- Literals are atomic values (strings)
- E.g.,
- Peter (resource) Develop (property) Software
Package ABC (value) - Software Package ABC (resource) hasProgLang
(property) Java (value)
10Statements as Graphs
- A directed graph with labeled nodes and arcs
- from the resource (the subject of the statement)
- to the value (the object of the statement)
- Known in AI as a semantic net
- The value of a statement may be a resource.
11A Set of Triples as a Semantic Net
producer
iphone
www.apple.com
hasCEO
site-owner
Steve Grove
www.steve-grove-website.com
interest
Calligraphy
12Statements as Triples
- (http//www.apple.com,
- http//www.williamshop.com/producer,
- iphone)
- The triple (x,P,y) can be considered as a logical
formula P(x,y) - Binary predicate P relates x to y
- E.g., producer(Apple,iphone)
- RDF offers only binary predicates (properties)
13Statements as XML Documents
- Graphs are a powerful tool for human
understanding but - The Semantic Web vision requires
machine-accessible and machine-processable
representations
14Statements as XML Documents
- xmlnsrdf"http//www.w3.org/1999/02/22-rdf-synta
x-ns" - xmlnsws"http//www.williamshop.com/my-rdf-ns"
-
- rdfabout"http//www.apple.com"
-
- iphone
-
-
-
-
-
-
resource
property
value
15Statements as XML Documents
- An RDF document is represented by an XML element
with the tag rdfRDF - The content of this element is a number of
descriptions, which use rdfDescription tags. - Every description makes a statement about a
resource, identified in 3 ways - an about attribute, referencing an existing
resource - an ID attribute, creating a new resource
- without a name, creating an anonymous resource
16An RDF document is
- Thus an RDF document can be viewed as
- A set of triples
- A graph (semantic net)
- An XML document
17Lecture Outline
- Basic Ideas of RDF
- The Language of RDF
- Basic Ideas of RDF Schema
- ?he Language of RDF Schema
- Basic Ideas of OWL
- The Language of OWL
18XML-Based Syntax of RDF
- An RDF document consists of an rdfRDF element
- The content of that element is a number of
descriptions - A namespace mechanism is used
- Disambiguation
- Namespaces are expected to be RDF documents
defining resources that can be reused - Large, distributed collections of knowledge
19Data Types
- The attribute rdfdatatype"xsdinteger" is used
to indicate the data type of the value of the age
property (via a URI) -
- William Cheung
- Associate Professor
- 25
What if this is not a literal?
20The rdfresource Attribute
-
- E-Technology
-
-
-
- William Cheung
- Associate Professor
21The rdfresource Attribute
- The relationships between courses and lecturers
(in the example) were not formally defined but
existed implicitly through the use of the same
name - The use of the same name may just be a
coincidence for a machine - We can denote that two entities are the same
using the rdfresource attribute
22Nested Descriptions are allowed
-
- E-Technology
-
-
- William Cheung
- Associate Professor
-
-
23Adding rdftype Element/Property
-
- - nscourse"/
- E-Technology
-
-
- bu- nsfaculty"/
- William Cheung
- Associate Professor
-
-
Instantiation!!
24Abbreviated Syntax
- Simplification rules
- Childless property elements within description
elements may be replaced by XML attributes - For description elements with a typing element we
can use the name specified in the rdftype
element instead of rdfDescription - These rules create syntactic variations of the
same RDF statement - They are equivalent according to the RDF data
model, although they have different XML syntax
25Abbreviated Syntax Example
-
- u- nscourse"/
- E-Technology
-
E-Technology" w.hkbu.edu.hk/bu-nscourse"/ rdfresource"9231999"/
hnology"
26Container Elements
- Collect a number of resources or attributes about
which we want to make statements as a whole - E.g., for courses taught by William Cheung
273 Types of Container Elements
- rdfBag an unordered container, allowing multiple
occurrences - E.g. students in a class
- rdfSeq an ordered container, which may contain
multiple occurrences - E.g. telephone directory (order is imposed)
- rdfAlt a set of alternatives
- E.g. allowable document formats (ps or pdf)
28Example for a Bag
29Lecture Outline
- Basic Ideas of RDF
- The Language of RDF
- Basic Ideas of RDF Schema
- ?he Language of RDF Schema
- Basic Ideas of OWL
- The Language of OWL
30From RDF To RDF Schema
- RDF
- define vocabularies for describing resources
- does not assume, nor does it define semantics of
any particular application domain - RDF Schema (RDFS) - with semantics definition
related to - Classes and Properties
- Class Hierarchies and Inheritance
- Property Hierarchies
31Classes and their Instances
- We must distinguish between
- Concrete things (individual objects) in the
domain E-Technology, William Cheung, etc. - Sets of individuals sharing properties called
classes lecturers, courses etc. - Individual objects that belong to a class are
referred to as instances of that class - The relationship between instances and classes in
RDF is through rdftype
32Nonsensical Statements Disallowed Through the Use
of Classes
- E-Technology is taught by Web Intelligence
- We want courses to be taught by lecturers only
- Restriction on values of the property is taught
by (range restriction) - RRS Building is taught by William Cheung
- Only courses can be taught
- This imposes a restriction on the objects to
which the property can be applied (domain
restriction)
33Class Hierarchies
- Classes can be organised in hierarchies using
RDFS - A is a subclass of B if every instance of A is
also an instance of B - Then B is a superclass of A
34Inheritance Concept in Class Hierarchies
- Range restriction Courses must be taught by
academic staff members only - William Cheung is an Associate Professor.
- He inherits the ability to teach from the class
of academic staff members - This is done in RDF Schema by fixing the
semantics of is a subclass of - It is not up to an application (RDF processing
software) to interpret is a subclass of.
35Property Hierarchies
- Hierarchical relationships for properties
- E.g., is taught by is a subproperty of
involves - If a course C is taught by an academic staff
member A, then C also involves ? - P is a subproperty of Q, if Q(x,y) is true
whenever P(x,y) is true
36RDF vs RDF Schema
37Lecture Outline
- Basic Ideas of RDF
- The Language of RDF
- Basic Ideas of RDF Schema
- ?he Language of RDF Schema
- Basic Ideas of OWL
- The Language of OWL
38RDF Schema in RDF
- The modeling primitives of RDF Schema are defined
using resources and properties (RDF itself is
used!) - E.g., to declare that lecturer is a subclass of
academic staff member - (subClassOf,lecturer,academicStaffMember)
- XML-based syntax of RDF is used.
39Core Classes and Properties
- rdfsResource, the class of all resources
- rdfsClass, the class of all classes
- rdfsLiteral, the class of all literals (strings)
- rdfProperty, the class of all properties.
- rdfStatement, the class of all reified
statements - rdftype, declares a resource an instance of a
class - rdfssubClassOf, relates a class to its
superclasses - rdfssubPropertyOf, relates a property to its
superproperties - rdfsdomain, specifies the domain of a property
- rdfsrange, specifies the range of a property
40Examples
-
-
-
-
-
-
- 2000/01/rdf-schemaLiteral"/
41Relationships Between Core Classes and Properties
- rdfssubClassOf and rdfssubPropertyOf are
transitive, by definition (how about
isMotherOf??) - rdfsClass is a subclass of rdfsResource
- Because every class is a resource
- rdfsResource is an instance of rdfsClass
- rdfsResource is the class of all resources, so
it is a class - Every class is an instance of rdfsClass
- For the same reason
42Subclass Hierarchy of Some Modeling Primitives of
RDF Schema
43Instance Relationships of Some Core Properties of
RDF and RDF Schema
44Reification and Containers
- rdfsubject, relates a reified statement to its
subject - rdfpredicate, relates a reified statement to its
predicate - rdfobject, relates a reified statement to its
object - rdfBag, the class of bags
- rdfSeq, the class of sequences
- rdfAlt, the class of alternatives
- rdfsContainer, which is a superclass of all
container classes, including the three above
45Lecture Outline
- Basic Ideas of RDF
- The Language of RDF
- Basic Ideas of RDF Schema
- ?he Language of RDF Schema
- Basic Ideas of OWL
- The Language of OWL
46Limitations of RDF Schema
- Local scope of properties
- rdfsrange defines the range of a property (e.g.
eats) for resources of all classes - In RDF Schema we cannot declare range
restrictions to properties that apply to
resources of some classes only - E.g. we cannot say that cows eat only plants,
while other animals may eat meat, too
47Limitations of RDF Schema (2)
- Disjointness of classes
- Sometimes we wish to say that classes are
disjoint (e.g. male and female) - Boolean combinations of classes
- Sometimes we wish to build new classes by
combining other classes using union,
intersection, and complement - E.g. person is the disjoint union of the classes
male and female
48Limitations of RDF Schema (3)
- Cardinality restrictions
- E.g. a person has exactly two parents, a course
is taught by at least one lecturer - Special characteristics of properties
- Transitive property (like greater than)
- Unique property (like is mother of)
- A property is the inverse of another property
(like eats and is eaten by)
49Combining OWL with RDF Schema
- Ideally, OWL extends RDF Schema
- Consistent with the layered architecture of the
Semantic Web - Simply extending RDF Schema
- expressive power ? reasoning efficiency ?
- Combining RDF Schema with logic leads to
uncontrollable computational properties
50Three Species of OWL
- OWL Full
- is fully upward-compatible with RDF, both
syntactically and semantically - is so powerful that it is undecidable, thus no
complete (or efficient) reasoning support - OWL DL
- permits efficient reasoning support
- lose full compatibility with RDF, ie., not every
RDF doc. is a legal OWL DL doc. - OWL Lite
- An even further restriction limits OWL DL to a
subset of the language constructors
51OWL Compatibility with RDF Schema
52Lecture Outline
- Basic Ideas of RDF
- The Language of RDF
- Basic Ideas of RDF Schema
- ?he Language of RDF Schema
- Basic Ideas of OWL
- The Language of OWL
53Classes
- Classes are defined using owlClass
- owlClass is a subclass of rdfsClass
- Disjointness is defined using owldisjointWith
-
-
- sor"/
-
54Classes (2)
- owlequivalentClass defines equivalence of
classes -
- "academicStaffMember"/
55Properties
- In OWL there are two kinds of properties
- Object properties, which relate objects to other
objects - E.g. is-TaughtBy, supervises
- Data type properties, which relate objects to
datatype values - E.g. phone, title, age, etc.
56Object Properties
57Datatype Properties
-
- 1/XLMSchema
- nonNegativeInteger"/
58Inverse Properties
59Equivalent Properties
60Property Restrictions
- In OWL we can declare that the class C satisfies
certain conditions - All instances of C have certain properties taking
certain values. - E.g., First year courses (a class) are taught by
(property) processors (a class) - E.g., Tutorial sessions (a class) are taught by
(property) teaching assistants (a class) - This is equivalent to saying that C is subclass
of an anonymous class C', where C' collects all
objects that satisfy the conditions.
61Property Restrictions (2)
- A (restriction) class is achieved through an
owlRestriction element - This element contains an owlonProperty element
and one or more restriction declarations - One type defines cardinality restrictions (at
least one, at most 3,)
62Property Restrictions (3)
- The other type defines restrictions on the kinds
of values the property may take - owlallValuesFrom specifies universal
quantification - owlhasValue specifies a specific value
- owlsomeValuesFrom specifies existential
quantification
63owlallValuesFrom
64owlhasValue
65owlsomeValuesFrom
66Cardinality Restrictions
-
-
-
- "isTaughtBy"/
- "xsdnonNegativeInteger" 1
-
-
-
67Special Properties
- owlTransitiveProperty (transitive property)
- E.g. has better grade than, is ancestor of
- owlSymmetricProperty (symmetry)
- E.g. has same grade as, is sibling of
- owlFunctionalProperty defines a property that
has at most one value for each object - E.g. age, height, directSupervisor
- owlInverseFunctionalProperty defines a property
for which two different objects cannot have the
same value
68Boolean Combinations
- We can combine classes using Boolean operations
(union, intersection, complement) -
-
-
- "staffMember"/
-
-
69Boolean Combinations (2)
-
-
-
-
-
-
- The new class is not a subclass of the union, but
rather equal to the union - We have stated an equivalence of classes
70Boolean Combinations (3)
71Nesting of Boolean Operators
72No Unique-Names Assumption
- OWL does not adopt the unique-names assumption of
database systems - If two instances having a different name or ID
does not imply that they are different
individuals - Suppose we state that each course is taught by at
most one staff member, and that a given course
is taught by two staff members - An OWL reasoner does not flag an error
- Instead it infers that the two staff members are
identical
73Distinct Objects
- To ensure that different individuals are indeed
recognized as such, we must explicitly assert
their inequality -
-
-
74Distinct Objects (2)
- OWL provides a shorthand notation to assert the
pairwise inequality of all individuals in a given
list -
-
-
-
-
-
75A Example - A Printer Ontology
76A Printer Ontology - Beginning
- xmlnsrdf"http//www.w3.org/1999/02/22-rdf-synta
x-ns" - xmlnsrdfs"http//www.w3.org/2000/01/rdf-schema
" - xmlnsxsd"http//www.w3.org/2001/XMLSchema"
- xmlnsowl"http//www.w3.org/2002/07/owl"
- xmlns"http//www.cs.vu.nl/frankh/spool/printer.
owl" -
-
- My example version 1.2, 17 October 2002
-
-
77A Printer Ontology Products and Devices
-
- Products form a class.
-
-
- Printing and digital imaging
devices - form a subclass of products.
- Device
-
-
78A Printer Ontology HP Products
79A Printer Ontology Printers and Personal
Printers
-
- Printers are printing and digital
imaging - devices.
-
-
-
- Printers for personal use form
- a subclass of printers.
-
80A Printer Ontology HP LaserJet 1100se Printers
-
- 1100se printers belong to the 1100
series - and cost 450.
-
-
-
-
-
-
-
-
81A Printer Ontology Properties
82References
- The Semantic Web Primer, MIT Press, 2004