1
Yolanda Gil
Semantic Markup Languages: A Gentle Introduction Yolanda Gil - - PowerPoint PPT Presentation
Semantic Markup Languages: A Gentle Introduction Yolanda Gil USC/Information Sciences Institute gil@isi.edu Yolanda Gil 1 Outline I: The Big Picture The Semantic Web
1
Yolanda Gil
2
Yolanda Gil
ν I: The Big Picture
™ The Semantic Web
http://www.scientificamerican.com/2001/0501issue/0501berners-lee.html http://www.w3.org/DesignIssues/Semantic.html ν II: A Gentle Introduction
™ XSD, RDFS, (DAML), OWL
http://trellis.semanticweb.org/expect/web/semanticweb/comparison.html ν III: The Big Picture Revisited
™ W3C’s Semantic Web principles
http://www.semanticweb.org
™ How this is changing our research in Knowledge Bases
http://www.isi.edu/expect/papers/gil-seweb-book-01.pdf
3
Yolanda Gil
4
Yolanda Gil
ν The first Web enables communication between people
™ The Web shows how computers and networks enable the
information space while getting out of the way
ν The new Web will bring computers into the action
™ Step 1 -- Describe: putting data on the Web in machine-
understandable form -- a Semantic Web
– RDF (based on XML) – Master list of terms used in a document (RDF schema) – Each document mixes global standards and local agreed-upon terms (namespaces)
™ Step 2 -- Infer and reason: apply logic inference
– Operate on partial understanding – Answering why – Heuristics
5
Yolanda Gil
ν “In the extreme view, the world can be seen as only
ν “What matters is in the connections. It isn’t the
ν For the people, by the people: the right to link
6
Yolanda Gil
7
Yolanda Gil
8
Yolanda Gil
9
Yolanda Gil
10
Yolanda Gil
ν The Web is an information space. URIs are the
ν Short strings that identify resources in the web:
ν They make resources addressable in the same
11
Yolanda Gil
12
Yolanda Gil
ν A character encoding system, like ASCII, designed
ν Unicode provides a unique number for every
13
Yolanda Gil
14
Yolanda Gil
Problems wit h HTML
HTML design
Web pages.
This design is not appropriat e for dat a:
15
Yolanda Gil
ν Tags can be used to represent the meaning of
™ separates syntax (structural representation) from semantics
=> only syntax is considered in XML
ν There is no fixed set of markup tags - new tags can
ν Underlying data model is a tree structure ν “XML is the new ASCII” -- Tim Bray
16
Yolanda Gil
<Bookst ore> <Book ID=“ 101” > <Aut hor>John Doe</ Aut hor> <Tit le>Int roduct ion t o XML</ Tit le> <Dat e>12 June 2001</ Dat e> <ISBN>121232323</ ISBN> <Publisher>XYZ</ Publisher> </ Book> <Book ID=“ 102” > <Aut hor>Foo Bar</ Aut hor> <Tit le>Int roduct ion t o XSL</ Tit le> <Dat e>12 June 2001</ Dat e> <ISBN>12323573</ ISBN> <Publisher>ABC</ Publisher> </ Book> </ Bookst ore>
XML by it self is j ust hierarchically st ruct ured t ext
17
18
Yolanda Gil
– Writ t en in t he same synt ax as XML document s (unlike XML DTDs!) – Element s and at t ribut es – Enhanced set of primit ve dat at ypes.
dat abases (st ring, boolean, decimal, int eger, dat e, et c.)
(refinement ) – Can have const raint s on at t ribut es
(upper bound), minInclusive (lower bound), et c.
19
Yolanda Gil
20
Yolanda Gil
< ?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/"> < html> < body> < table cellpadding="2" cellspacing="0" border="1" bgcolor="#FFFFD5"> < tr> < th> Title< /th> < U I
21
Yolanda Gil
22
Yolanda Gil
ν “When I designed HTML, I chose to avoid giving it
ν Keeps the principles of SGML in place but its spec is
ν To say you are “Using XML” is sort of like saying you
ν Using XSD (XML Schema) makes a lot more sense
23
Yolanda Gil
24
Yolanda Gil
1. The order in which element s appear in an XML document is oft en
Furt hermore, maint aining t he correct order of millions of dat a it ems is impract ical. 2. XML allows const ruct ions t hat mix up some t ext along wit h child element s, which are hard t o handle. Ex.
25
Yolanda Gil
It rest rict s t he descript ion of resources t o triplets (subject,predicate,object)
underst andable informat ion on t he Web.
resources t hat makes no assumpt ions about a part icular applicat ion domain, nor defines (a priori) t he semant ics of any applicat ion domain.
The formal specificat ion of RDF is available at : ht t p:/ / www.w3.org/ TR/ REC-rdf-synt ax/
26
Yolanda Gil
A combinat ion of t hem is said t o be a St at ement (or a rule)
27
Yolanda Gil
<? xml version="1.0"? > <rdf:RDF xmlns:rdf="http:/ / www.w3.org/ TR/ WD-rdf-syntax#" xmlns:s="http:/ / description.org/ schema/ "> <rdf:Description about="http:/ / foo.bar.org/ index.html"> <s:Author>John Doe</ s:Author> </ rdf:Description> </ rdf:RDF>
28
Yolanda Gil
st at ement s and gives specific meanings t o t hem.
Example:
<rdf:RDF xml:lang="en" xmlns:rdf="ht t p:/ / www.w3.org/ 1999/ 02/ 22-rdf-synt ax-ns#" xmlns:rdfs="ht t p:/ / www.w3.org/ 2000/ 01/ rdf-schema#"> <rdf:Descript ion ID="Mot orVehicle"> <rdf:t ype resource="ht t p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Class"/ > <rdfs:subClassOf rdf:resource="ht t p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Resource"/ > </ rdf:Descript ion> <rdf:Descript ion ID="PassengerVehicle"> <rdf:t ype resource="ht t p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Class"/ > <rdfs:subClassOf rdf:resource="#Mot orVehicle"/ > </ rdf:Descript ion> <rdf:Descript ion ID="Truck"> <rdf:t ype resource="ht t p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Class"/ > <rdfs:subClassOf rdf:resource="#Mot orVehicle"/ > </ rdf:Descript ion>
29
Yolanda Gil
<rdf:Descript ion ID="Van"> <rdf:t ype resource="ht t p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Class"/ > <rdfs:subClassOf rdf:resource="#Mot orVehicle"/ > </ rdf:Descript ion> <rdf:Descript ion ID="MiniVan"> <rdf:t ype resource="ht t p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Class"/ > <rdfs:subClassOf rdf:resource="#Van"/ > <rdfs:subClassOf rdf:resource="#PassengerVehicle"/ > </ rdf:Descript ion> <rdf:Descript ion ID="regist eredTo"> <rdf:t ype resource="ht t p:/ / www.w3.org/ 1999/ 02/ 22-rdf-synt ax-ns#Propert y"/ > <rdfs:domain rdf:resource="#Mot orVehicle"/ > <rdfs:range rdf:resource="#Person"/ > </ rdf:Descript ion> <rdf:Descript ion ID="rearSeat LegRoom"> <rdf:t ype resource="ht t p:/ / www.w3.org/ 1999/ 02/ 22-rdf-synt ax-ns#Propert y"/ > <rdfs:domain rdf:resource="#PassengerVehicle"/ > <rdfs:domain rdf:resource="#Minivan"/ > <rdfs:range rdf:resource="ht t p:/ / www.w3.org/ 2000/ 03/ example/ classes#Number"/ > </ rdf:Descript ion> </ rdf:RDF>
Domain
30
Yolanda Gil
31
Yolanda Gil
ν Minimalist model - (thing), Class, Property ν Subproperty, Subclass ν Domain & Range ν RDF Schema: a W3C recommendation Feb’04 ν Efficient storage and retrieval
™ “Triple store” using database backends
32
Yolanda Gil
33
Yolanda Gil
for class membership. Example: If it is given t hat ‘ XYZ’ has a ‘ car’ which is ‘ 7ft high’ , has ‘ wide wheels’ and ‘ loading space is 4 cub.m’ , t hen we should be able t o reason t hat ‘ XYZ’ has an ‘ SUV’ , as given by t he necessary and sufficient condit ions for being an ‘ SUV’ : height > 4ft & wide wheels & loading space > 2 cub.m
34
Yolanda Gil
a machine underst andable form.
program.
DAML+OIL: http://www.daml.org/2001/03/daml+oil-index.html
35
Yolanda Gil
ν It builds on earlier W3C standards such as RDF and
ν DAML extends RDF and RDFS with richer modelling
™ disjointWith, intersectionOf, oneOf, cardinality
ν Able to provide properties of properties
™ uniqueness, transitivity, etc.
ν Current version DAML+OIL provides a semantic
36
Yolanda Gil
ν Classes are defined in terms of other
ν Relations are first class citizens ν Powerful inference algorithms:
™ Subsumption: is classA a subclass of classB given their
definitions?
™ Recognition: is instanceA of classA? ™ Classification: automatic reorganization of class hierarchy
based on definitions of classes
37
Yolanda Gil
<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:daml="http://www.daml.org/2000/12/daml+oil#" xmlns ="http://www.daml.org/2000/12/daml+oil-ex#" > <daml:Ontology about=“ ” > <daml:versionInfo> An example ontology< /daml:versionInfo> <rdfs:Class rdf:ID="Animal"> < rdfs:label> Animal< /rdfs:label> < rdfs:comment> This class of animals is illustrative of a number of ontological idioms. < /rdfs:comment> < /rdfs:Class> <rdfs:Class rdf:ID="M ale"> < rdfs:subClassOf rdf:resource="#Animal"/> < /rdfs:Class> <rdfs:Class rdf:ID="Female"> < rdfs:subClassOf rdf:resource="#Animal"/> < daml:disjointWith rdf:resource="#M ale"/> < /rdfs:Class> <rdfs:Class rdf:ID="M an"> < rdfs:subClassOf rdf:resource="#Person"/> < rdfs:subClassOf rdf:resource="#M ale"/> < /rdfs:Class>
Can explicitly specify the set of Females to be disjoint with the set of Males Start of an ontology (about = “” implies ‘this’ document) The label is not used for logical interpretation To be read conjunctively. A man is a sub-class of ‘Person’ and a ‘Male’ The Person class is defined later
38
Yolanda Gil
<rdfs:Class rdf:ID="Woman"> < rdfs:subClassOf rdf:resource="#Person"/> < rdfs:subClassOf rdf:resource="#Female"/> < /rdfs:Class> <rdf:ObjectProperty rdf:ID="hasParent"> < rdfs:domain rdf:resource="#Animal"/> < rdfs:range rdf:resource="#Animal"/> < /rdf:ObjectProperty> <rdf:ObjectProperty rdf:ID="hasFather"> < rdfs:subPropertyOf rdf:resource="#hasParent"/> < rdfs:range rdf:resource="#M ale"/> < /rdf:ObjectProperty> <daml:DatatypeProperty rdf:ID="age"> < rdfs:range rdf:resource="http://www.w3.org/2000/10/XM LSchema#nonNegativeInteger"/> < /daml:DatatypeProperty <rdfs:Class rdf:ID="Person"> < rdfs:subClassOf rdf:resource="#Animal"/> < rdfs:subClassOf> < daml:Restriction> <daml:onProperty rdf:resource="#hasParent"/> <daml:toClass rdf:resource="#Person"/> < /daml:Restriction> < /rdfs:subClassOf> < rdfs:subClassOf> < daml:Restriction daml:cardinality="1"> <daml:onProperty rdf:resource="#hasFather"/> < /daml:Restriction> < /rdfs:subClassOf> < /rdfs:Class>
39
Yolanda Gil
<rdfs:Class rdf:about="#Animal"> <rdfs:subClassOf> < daml:Restriction daml:cardinality="2"> < daml:onProperty rdf:resource="#hasParent"/> < /daml:Restriction> < /rdfs:subClassOf> < /rdfs:Class> <rdfs:Class rdf:about="#Person"> < rdfs:subClassOf> < daml:Restriction daml:maxcardinality="1"> < daml:onProperty rdf:resource="#hasSpouse"/> < /daml:Restriction> < /rdfs:subClassOf> < /rdfs:Class>
Furt her const ruct s t hat t he example doesn’ t use : Propert ies: Transit ivePropert y (hasAncest or), UniquePropert y (hasMot her), inverseOf(hasChild -> hasParent), et c. Classes: int ersect ionOf (a daml:collect ion), unionOf (a daml:collect ion), sameClassAs, complement Of, et c.
40
Yolanda Gil
ν “Most used knowledge representation language in
™ 5M statements on 20K web pages ™ 13M triples RDF-based
ν www.daml.org: average 20k hits/day ν Submit a query, many things are there:
™ http://www.daml.org/ontologies/
41
Yolanda Gil
DAML Viewer: It provides a means t o view t he inst ances found in a DAML document . ht t p:/ / www.daml.org/ viewer/ applet .ht ml DAML Crawler Result s: A list of .daml files on t he int ernet ht t p:/ / www.daml.org/ crawler/ pages.ht ml A DAML Validat or ht t p:/ / www.daml.org/ validat or/ A DAML example explained: It has t he same example as in t he slides, discussed in det ail. ht t p:/ / www.daml.org/ 2001/ 03/ daml+oil-walkt hru.ht ml