Semantic Web Technologies
Pierre Senellart
Outline
Introduction
The Semantic Web Ontologies and Reasoning Components of an Ontology
3 Ontology Languages for the Web RDF
RDFS OWL
Querying Data through Ontologies Reference Material
Outline
Introduction
The Semantic Web Ontologies and Reasoning Components of an Ontology
3 Ontology Languages for the Web Querying Data through Ontologies Reference Material
Outline
Introduction
The Semantic Web Ontologies and Reasoning Components of an Ontology
3 Ontology Languages for the Web Querying Data through Ontologies Reference Material
The Semantic Web
A Web in which the resources are semantically described
annotations give information about a page, explain an expression in a page, etc.
More precisely, a resource is anything that can be referred to by a URI
a web page, identified by a URL
a fragment of an XML document, identified by an element node of the document,
a web service,
a thing, an object, a concept, a property, etc.
Semantic annotations: logical assertions that relate resources to some terms in associated ontologies
Outline
Introduction
The Semantic Web Ontologies and Reasoning Components of an Ontology
3 Ontology Languages for the Web Querying Data through Ontologies Reference Material
Ontologies
Formal descriptions providing humanusers a shared understanding of a given domain
A controlled vocabulary
Formally defined so that it can also be processed bymachines Logical semantics that enables reasoning
Reasoning is the key for different important tasks of Web data management, in particular:
to answer queries (over possibly distributed data)
to relate objects in different data sources enabling their integration to detect inconsistencies or redundancies
to refine queries with too many answers, or to relax queries with no answer
Where Do Ontologies Come From?
Manually craftedto represent the knowledge of a specific domain (e.g., life sciences)
Exported fromclassical Web databases
Through information extractionfrom the Web, Wikipedia, etc.
(e.g., DBpedia, YAGO)
Privateto a company or public
Some ontologies focus on instances, others on aschema (see further)
Value of the Semantic Web: bits of ontologies can be re-usedin another, and ontologies can be mapped through anowl:sameAs link
As of September 2011 Music
Brainz (zitgist)
P20
Turismo de Zaragoza
yovisto
Yahoo!
Geo Planet
YAGO World Fact- book
ViajeroEl Tourism
WordNet (W3C) WordNet (VUA)
VIVO UF VIVO Indiana
VIVO Cornell
VIAF
URI Burner
Sussex Reading Lists
Plymouth Reading Lists
UniRef UniProt UMBEL
UK Post- codes legislation data.gov.uk
Uberblic
UB Mann- heim
TWC LOGD
Twarql transport data.gov.
uk
Traffic Scotland
theses.
fr Thesau-
rus W
totl.net Tele- graphis
TCM GeneDIT Taxon
Concept
Open Library (Talis) tags2con
delicious
t4gm info
Swedish Open Cultural Heritage Surge
Radio
Sudoc
STW RAMEAU
SH
statistics data.gov.
uk
Andrews St.
Resource Lists
ECS South- ampton EPrints SSW
Thesaur us
Smart Link
Slideshare 2RDF
semantic web.org Semantic
Tweet
Semantic XBRL
SW Dog Food Source Code Ecosystem Linked Data
US SEC (rdfabout)
Sears Scotland
Geo- graphy Scotland Pupils &
Exams
Scholaro- meter
WordNet (RKB Explorer)
Wiki
UN/
LOCODE Ulm
ECS (RKB Explorer)
Roma
RISKS RESEX
RAE2001 Pisa OS
OAI
NSF New-castle
LAAS KISTI JISC
IRIT
IEEE IBM
Eurécom ERA
ePrints dotAC
DEPLOY DBLP
Explorer)(RKB Crime
Reports UK
Course- ware CORDIS
Explorer)(RKB
CiteSeer
Budapest
ACM
riese
Revyu research
data.gov.
Ren. uk Energy Genera- tors
reference data.gov.
uk
Recht- spraak.
nl
ohlohRDF
Last.FM (rdfize)
RDF Book Mashup
Rådata nå!
PSH
Product Types Ontology Product
DB
PBAC Poké-
pédia patents
data.go v.uk Ox
Points
Ord- nance Survey
Openly Local
Open Library
Open Cyc
Open Corpo- rates
Open Calais OpenEI
Open Election Data Project
Open Data Thesau- rus
Ontos News Portal
OGOLOD Janus
AMP Ocean Drilling Codices
New York Times
NVD ntnusc Resource NTU
Lists
Norwe- gian MeSH NDL
subjects
ndlna Experi-my
ment
Italian Museums
medu- cator
MARC Codes List Man- chester Reading Lists Lotico
Weather Stations London
Gazette
LOIUS
Linked Open Colors
lobid Resources
lobid Organi- sations LEM
Linked MDB
LinkedL CCN
Linked GeoData
LinkedCT Linked
User Feedback LOV
Linked Open Numbers LODE
Eurostat (Ontology Central) Linked
EDGAR (Ontology Central)
Linked Crunch- base
lingvoj Lichfield
Spen- ding
LIBRIS
Lexvo
LCSH
DBLP (L3S)
Linked Sensor Data (Kno.e.sis)
Klapp- stuhl- club
Good- win Family
National Radio- activity JP
Jamendo (DBtune)
Italian public schools ISTAT
Immi- gration
iServe
IdRef Sudoc
NSZL Catalog Hellenic
PD Hellenic
FBD
Piedmont Accomo- dations GovTrack GovWILD
Google wrapperArt gnoss
GESIS
GeoWord Net
Geo Species NamesGeo
Geo Linked
Data
GEMET GTAA
STITCH SIDER
Project Guten- berg
MediCare Euro-
stat (FUB)
EURES
Drug Bank
Disea- some
DBLP (FU Berlin) Daily
Med CORDIS
(FUB)
Freebase flickr wrappr
Fishes of Texas
Finnish Munici- palities
ChEMBL FanHubz
Event Media EUTC
Produc- tions
Eurostat
Europeana
EUNIS EU
Insti- tutions
ESD stan- dards
EARTh
Enipedia Popula-
tion (En- AKTing) NHS (En- AKTing) Mortality
(En- AKTing) Energy
(En- AKTing)
Crime (En- AKTing)
CO2 Emission
(En- AKTing) EEA
SISVU educatio
n.data.g ov.uk
ECS South- ampton
ECCO- TCP GND Didactal
ia
DDC Deutsche
Bio- graphie
data dcs Music
Brainz (DBTune) Magna-
tune John Peel (DBTune)
Classical Tune)(DB
Audio Scrobbler (DBTune)
Last.FM artists (DBTune) DB Tropes
Portu- guese DBpedia
dbpedia lite
Greek DBpedia
DBpedia
data- open- ac-uk
SMC Journals
Pokedex
Airports NASA (Data Incu- bator)
Music Brainz (Data Incubator) Moseley
Folk
Metoffice Weather Forecasts
Discogs (Data Incubator)
Climbing data.gov.uk
intervals
Data Gov.ie
data bnf.fr
Cornetto reegle
Chronic- ling America
Chem2 Bio2RDF
Calames business
data.gov.
uk
Bricklink
Brazilian Poli- ticians
BNB
UniSTS
UniPath way UniParc
Taxono my
UniProt (Bio2RDF)
SGD
Reactome
PubMed Pub
Chem PRO-
SITE ProDom
Pfam PDB
OMIM
MGI
KEGG Reaction KEGG
Pathway KEGG Glycan KEGG Enzyme KEGG Drug
KEGG Com- pound InterPro
Homolo Gene HGNC
Gene Ontology
GeneID Affy-
metrix
bible ontology BibBase
FTS
BBC Wildlife Finder BBC Program
mes BBC
Music
Alpine Ski Austria
LOCAH
Amster- Museumdam AGROV
OC AEMET
US Census (rdfabout)
Media Geographic Publications
Government Cross-domain Life sciences User-generated content
Outline
Introduction
The Semantic Web Ontologies and Reasoning Components of an Ontology
3 Ontology Languages for the Web Querying Data through Ontologies Reference Material
Classes and class hierarchy
Backbone of the ontology
AcademicStaff is a Class(A class will be interpreted as a set of objects)
AcademicStaff isaStaff (isa is interpreted as set inclusion)
FacultyComponent
Course
MathCourse
Probabilities Algebra Logic CSCourse
DB AI Java Student
UndergraduateStudent MasterStudent
PhDStudent Department
PhysicsDept MathsDept CSDept Staff
AcademicStaff
Lecturer Researcher Professor AdministrativeStaff
Relations
Declaration of relationswith their signature
(Relations will be interpreted as binary relations between objects) TeachesIn(AcademicStaff,Course)
if one states that “X TeachesInY”, then X belongs to AcademicStaffandY toCourse
TeachesTo(AcademicStaff,Student) Leads(Staff,Department)
Instances
Classes haveinstances
Dupondis an instance of the classProfessor corresponds to the fact: Professor(Dupond)
Relations also have instances
(Dupond,CS101) is an instance of the relationTeachesIn corresponds to the fact: TeachesIn(Dupond,CS101)
The instance statements can be seen as (and stored in) adatabase
Ontology = schema + instance
Schema (TBox)
The set of class and relation names
Thesignaturesof relations and alsoconstraints The constraints are used for two purposes
– checking data consistency (like dependencies in databases) – inferring new facts
Instance (ABox) The set of facts
The set of base facts together with the inferred facts should satisfy the constraints
Ontology(i.e., Knowledge Base) = Schema + Instance
Outline
Introduction
3 Ontology Languages for the Web RDF
RDFS OWL
Querying Data through Ontologies Reference Material
3 ontology languages for the Web
RDF: a very simple ontology language RDFS: Schema for RDF
Can be used to define richer ontologies OWL: a much richer ontology language
We next present them rapidly
Outline
Introduction
3 Ontology Languages for the Web RDF
RDFS OWL
Querying Data through Ontologies Reference Material
Namespaces
A URImost often takes the form of a URL:
http://live.dbpedia.org/page/%C3%89lectricit%C3%A9_de_France http://sw.opencyc.org/2012/05/10/concept/en/GameOfChance http://www.w3.org/People/Berners-Lee/card#i
http:
//www4.wiwiss.fu-berlin.de/dblp/resource/record/conf/www/2006
Some of these URIs may be actual URLs(point to a browsable resource), some may just be abstract
For simplicity, possibility of definingnamespace prefixes, e.g., dbpedia = http://live.dbpedia.org/page/ along with a default prefix(e.g., mapped to
http://sw.opencyc.org/2012/05/10/concept/en/):
dbpedia:%C3%89lectricit%C3%A9_de_France :GameOfChance
RDF: Resource Description Framework
RDF facts are triplets
Each triplet is of the form: hSubject Predicate Objecti The subject is a URI, referencing an entity
The predicate is a URI, referencing a relation
The object is either a URI, referencing anentity, or aliteral
h:Dupond:Leads:CSDepti
h:Dupond:HasName“Paul Dupond” i h:Dupond:TeachesIn:UE111i h:Dupond:TeachesTo:Pierrei h:Pierre:EnrolledIn:CSDepti h:Pierre:RegisteredTo:UE111i h:UE111:OfferedBy:CSDepti
The linked data cloud contains dozens of billions of RDF triples
RDF graph
A set of RDF facts defines
a set of relations between objects
anRDF graph where the nodes are objects:
:TeachesIn
:Dupond :Pierre
:InfoDept
UE111 :TeachesTo
:EnrolledIn
:RegisteredTo
:OfferedBy :Leads
RDF semantics
A tripleths P oi is interpreted in first-order logic (FOL) as a fact P(s;o)
Example:
Leads(Dupond,CSDept) TeachesIn(Dupond,UE111) TeachesTo(Dupond,Pierre) EnrolledIn(Pierre,CSDept) RegisteredTo(Pierre,UE111) OfferedBy(UE111,CSDept)
RDF Serialization
Several serialization formats for RDF data, see alternate formats of http://live.dbpedia.org/page/%C3%89lectricit%C3%A9_de_France:
RDF/XML, structured XML representation, allowing for nesting N3 orTurtle, more compact, readable syntax, with some syntaxic sugar (Turtle is a subset of N3)
N-Triples, a simple text-based format
RDFato integrate RDF annotations into HTML
Outline
Introduction
3 Ontology Languages for the Web RDF
RDFS OWL
Querying Data through Ontologies Reference Material
RDFS: RDF Schema
Not detailed here: the schema in RDF is super simplistic An RDF Schemadefines the schema of a richer ontology
RDF Schema
Do net get confused: RDFS can use RDF as syntax, i.e., RDFS statements can be themselves expressed as RDF triplets using some specificproperties andobjects used as RDFS keywords with a particular meaning.
Declaration of classes and subclass relationships hStaffrdf:typerdfs:Classi
hJavardfs:subClassOfCSCoursei
Declaration of instances (beyond the pure schema) hDupondrdf:type AcademicStaffi
RDF Schema - continued
Declaration of relations (properties in RDFS terminology) hRegisteredTordf:type rdfs:Propertyi
Declaration of subproperty relationships
hLateRegisteredTordfs:subPropertyOfRegisteredToi Declaration of domain and range restrictions for predicates
hTeachesInrdfs:domainAcademicStaffi hTeachesInrdfs:rangeCoursei
TeachesIn(AcademicStaff,Course)
RDFS logical semantics
RDF and RDFS statements FOL translation DL notation
hi rdf:type Ci C(i) i :C orC(i)
hi P ji P(i;j) i P j orP(i;j)
hC rdfs:subClassOf Di 8X(C(X) )D(X)) C vD hP rdfs:subPropertyOf Ri 8X8Y(P(X;Y) )R(X;Y)) PvR hP rdfs:domain Ci 8X8Y(P(X;Y) )C(X)) 9P vC hP rdfs:range Di 8X8Y(P(X;Y) )D(Y)) 9P vD DL: Description logics, a specialized logical formalism
Outline
Introduction
3 Ontology Languages for the Web RDF
RDFS OWL
Querying Data through Ontologies Reference Material
OWL: Web Ontology Language
OWL extends RDFS with the possibility to express additional constraints
Main OWL constructs
Disjointness between classes
Constraints of functionality and symmetry on predicates Intentional class definitions
Class union and intersection
Inspired by description logics
Several profiles: OWL Full, OWL DL, OWL Lite, OWL 2 EL, OWL 2 QL, OWL 2 RL. Different profiles include different features, and have different tractability
OWL constructs
Disjointness between classes:
OWL notation FOL translation DL notation hC owl:disjointWith Di 8X(C(X) ) :D(X)) Cv :D
Constraints of functionality and symmetry on predicates:
OWL notation FOL translation DL notation
h P rdf:type
owl:FunctionalPropertyi 8X8Y8Z (funct P) (P(X;Y) ^P(X;Z) )Y=
Z)
or9Pv (1P)
hPrdf:type 8X8Y8Z (funct P )
owl:InverseFunctionalPropertyi (P(X;Y) ^P(Z;Y) )X= Z)
or 9P v (
1P ) hPowl:inverseOfQi 8X8Y(P(X;Y) ,
Q(Y;X))
PQ hPrdf:type owl:SymmetricProperty
i 8X8Y(P(X;Y) )
P(Y;X))
PvP
Definition of intentional classes in OWL
Goal: allow expressing complex constraints such as:
departments can be lead only by professors
only professors or lecturers may teach to undergraduate students.
The keyword owl:Restrictionis used in association with a blank node class, and some specific restriction properties:
owl:someValuesFrom owl:allValuesFrom owl:minCardinality owl:maxCardinality
OWL Semantics
OWL notation FOL translation DL notation
_a owl:onProperty P
_a owl:allValuesFrom C 8Y(P(X;Y) )C(Y)) 8P:C _a owl:onProperty P
_a owl:someValuesFrom C 9Y(P(X;Y) ^C(Y)) 9P:C _a owl:onProperty P
_a owl:minCardinalityn 9Y1: : : 9Yn(P(X;Y1) ^ : : : ^
P(X;Yn) ^Vi;j2[1::n];i6=j(Yi6=Yj)) (n P) _a owl:maxCardinalityn 8Y1: : : 8Yn8Yn+1
(P(X;Y1) ^ : : : ^ P(X;Yn) ^
P(X;Yn+1) (n P) )Wi;j2[1::n+1];i6=j(Yi=Yj))
Unnamed new classes by example
Departments can be lead only by professors
Define the set of objects that are lead by professors _a rdfs:subClassOf owl:Restriction _a owl:onProperty Leads
_a owl:allValuesFrom Professor
Now specify that all departments are lead by professors Department rdfs:subClassOf _a
Union and Intersection of Classes by example
Only professors or lecturers may teach to undergraduate students
_a rdfs:subClassOf owl:Restriction _a owl:onProperty TeachesTo _a owl:someValuesFrom Undergrad
_b owl:unionOf (Professor,Lecturer) _a rdfs:subClassOf _b
This corresponds to an inclusion axiom in Description Logic:
9 TeachesTo.UndergraduateStudentvProfessortLecturer owl:equivalentClass corresponds to double inclusion:
MathStudent Studentu 9 RegisteredTo.MathCourse
Outline
Introduction
3 Ontology Languages for the Web Querying Data through Ontologies Reference Material
Querying using RDFS
RDFS statements can be used to infer new triples Example
Base factResponsibleOf(durand;ue111)
Use the statementhResponsibleOf rdfs:domainProfessori i.e., the logical rule: ResponsibleOf(X;Y) )Professor(X) With substitution {X/durand, Y/ue111}
Infer factProfessor(durand)
Use the statementhProfessor rdfs:subClassOfAcademicStaffi i.e., the ruleProfessor(X) )AcademicStaff(X)
With substitution {X/durand}
Infer factAcademicStaff(durand) etc.
The saturation algorithm
Keep infering new facts until a fixpoint is reached Note: Only polynomially many facts can be added ptime
Querying using DL
RDFS simpler and very used but limited
Query answering is unfeasible for all of OWL (even OWL-DL). . . but restrictions exist that have more reasonable complexity (OWL-Lite, OWL 2 QL, OWL 2 EL). OWL-Full is even undecidable!
SPARQL: query language for RDF data
Graph patternlanguage
Get all URIs, name, emails of persons with all three pieces of information from a FOAF dataset:
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT * WHERE {
?person foaf:name ?name .
?person foaf:mbox ?emails . }
The SPARQL processor may or may not use reasoning w.r.t. the schema
Outline
Introduction
3 Ontology Languages for the Web Querying Data through Ontologies Reference Material
Where can Semantic Content be Found?
In the linked data, through Web-available RDF data:
dumpsof an entire ontology, in one of the RDF serialization formats (RDF/XML, Turtle, N-Triples)
crawlableRDF content, with small fragments pointing to other fragments
aSPARQL endpoint
HTML annotated withRDFa,
cf.http://www.w3.org/TR/rdfa-syntax/
Other popular semantic content embedded in Web pages:
microformats (hCard, vCard, etc.), microdata
(cf. http://schema.org/). Not directly the spirit of the Semantic Web, but heavily used.
RDF content used internally in a company
Systems
RDF stores (triplestores) with relational or native backend, open-source or commercial, see
http://en.wikipedia.org/wiki/Triplestore. Apache Jenais a popular open-source Java store.
SPARQL engines, usually on top of a triplestore.
http://en.wikipedia.org/wiki/SPARQL Semantic browsers, to navigate RDF content,
http://en.wikipedia.org/wiki/Linked_data#Browsers A semantic Web search engine,http://sig.ma/
Tool to viewsemantic data in Web pages:
http://www.google.com/webmasters/tools/richsnippets
To go further. . .
The specifications on http://www.w3.org/
A gentle introduction to the Semantic Web:
A Semantic Web Primer, G. Antoniou, F. van Harmelen, MIT Press, 2008
A practical approach:
Semantic Web for the Working Ontologist: Modeling in RDF, RDFS and OWL, Dean Allemang, James A. Hendler,
Morgan-Kaufman, 2008 Contents of this lecture from:
Web data management, S. Abiteboul, I. Manolescu, P. Rigaux, M.-C. Rousset, P. Senellart, Cambridge University Press, 2012.
Also available at http://webdam.inria.fr/Jorge/