Database Management Systems Course 236363 Faculty of Computer Science Technion – Israel Institute of Technology Lecture 10: RDF and SPARQL.

Slides:



Advertisements
Similar presentations
CH-4 Ontologies, Querying and Data Integration. Introduction to RDF(S) RDF stands for Resource Description Framework. RDF is a standard for describing.
Advertisements

CS570 Artificial Intelligence Semantic Web & Ontology 2
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
RDF Tutorial.
Semantic Web Introduction
 Copyright 2004 Digital Enterprise Research Institute. All rights reserved. SPARQL Query Language for RDF presented by Cristina Feier.
Of 27 lecture 7: owl - introduction. of 27 ece 627, winter ‘132 OWL a glimpse OWL – Web Ontology Language describes classes, properties and relations.
Chapter 3 RDF Syntax 1. Topics Basic concepts of RDF resources, properties, values, statements, triples URIs and URIrefs RDF graphs Literals and Qnames.
1 An Introduction To The Semantic Web. 2 Information Access on the Web Find an mp3 of a song that was on the Billboard Top Ten that features a cowbell.
Dr. Alexandra I. Cristea RDF.
Chapter 7: Resource Description Framework (RDF) Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley,
RDF: Building Block for the Semantic Web Jim Ellenberger UCCS CS5260 Spring 2011.
Semantic Web Presented by: Edward Cheng Wayne Choi Tony Deng Peter Kuc-Pittet Anita Yong.
The RDF meta model: a closer look Basic ideas of the RDF Resource instance descriptions in the RDF format Application-specific RDF schemas Limitations.
Semantic Web Technologies Lecture # 2 Faculty of Computer Science, IBA.
Nancy Ide Vassar College USA Resource Definition Framework A Tutorial EUROLAN 2003 July 28 - August 8 Bucharest - Romania.
CSE 428 Semantic Web Topics Introduction Jeff Heflin Lehigh University.
Logics for Data and Knowledge Representation SPARQL Protocol and RDF Query Language (SPARQL) Feroz Farazi.
Some Thoughts to Consider 6 What is the difference between Artificial Intelligence and Computer Science? What is the difference between Artificial Intelligence.
RDF: Concepts and Abstract Syntax W3C Recommendation 10 February Michael Felderer Digital Enterprise.
RDF (Resource Description Framework) Why?. XML XML is a metalanguage that allows users to define markup XML separates content and structure from formatting.
Chapter 6 Understanding Each Other CSE 431 – Intelligent Agents.
1cs The Need “Most of the Web's content today is designed for humans to read, not for computer programs to manipulate meaningfully.” Berners-Lee,
Okech Odhiambo Faculty of Information Technology Strathmore University
The Semantic Web Service Shuying Wang Outline Semantic Web vision Core technologies XML, RDF, Ontology, Agent… Web services DAML-S.
INF 384 C, Spring 2009 Ontologies Knowledge representation to support computer reasoning.
1 Representing Data with XML September 27, 2005 Shawn Henry with slides from Neal Arthorne.
Logics for Data and Knowledge Representation
The Semantic Web Web Science Systems Development Spring 2015.
Chapter 3 Querying RDF stores with SPARQL. Why an RDF Query Language? Why not use an XML query language? XML at a lower level of abstraction than RDF.
OWL 2 in use. OWL 2 OWL 2 is a knowledge representation language, designed to formulate, exchange and reason with knowledge about a domain of interest.
CC L A W EB DE D ATOS P RIMAVERA 2015 Lecture 2: RDF Model & Syntax Aidan Hogan
Semantic Web - an introduction By Daniel Wu (danielwujr)
RDF and XML 인공지능 연구실 한기덕. 2 개요  1. Basic of RDF  2. Example of RDF  3. How XML Namespaces Work  4. The Abbreviated RDF Syntax  5. RDF Resource Collections.
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Knowledge Representation Semantic Web - Fall 2005 Computer.
Chapter 7: Resource Description Framework (RDF) Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley,
EEL 5937 Ontologies EEL 5937 Multi Agent Systems Lecture 5, Jan 23 th, 2003 Lotzi Bölöni.
1 SPARQL A. Emrah Sanön. 2 RDF RDF is quite committed to Semantic Web. Data model Serialization by means of XML Formal semantics Still something is missing!
1 Artificial Intelligence Applications Institute Centre for Intelligent Systems and their Applications Stuart Aitken Artificial Intelligence Applications.
Artificial Intelligence 2004 Ontology
The future of the Web: Semantic Web 9/30/2004 Xiangming Mu.
Introduction to the Semantic Web and Linked Data Module 1 - Unit 2 The Semantic Web and Linked Data Concepts 1-1 Library of Congress BIBFRAME Pilot Training.
Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.
Chapter 7: Resource Description Framework (RDF) Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley,
User Profiling using Semantic Web Group members: Ashwin Somaiah Asha Stephen Charlie Sudharshan Reddy.
Of 33 lecture 1: introduction. of 33 the semantic web vision today’s web (1) web content – for human consumption (no structural information) people search.
The RDF meta model Basic ideas of the RDF Resource instance descriptions in the RDF format Application-specific RDF schemas Limitations of XML compared.
1cs The Need “Most of the Web's content today is designed for humans to read, not for computer programs to manipulate meaningfully.” Berners-Lee,
Practical RDF Chapter 12. Ontologies: RDF Business Models Shelley Powers, O’Reilly SNU IDB Lab. Taikyoung Kim.
Of 38 lecture 6: rdf – axiomatic semantics and query.
An Effective SPARQL Support over Relational Database Jing Lu, Feng Cao, Li Ma, Yong Yu, Yue Pan SWDB-ODBIS 2007 SNU IDB Lab. Hyewon Lim July 30 th, 2009.
A Portrait of the Semantic Web in Action Jeff Heflin and James Hendler IEEE Intelligent Systems December 6, 2010 Hyewon Lim.
Knowledge Technologies Manolis Koubarakis 1 Some Other Useful Features of RDF.
Chapter 5 The Semantic Web 1. The Semantic Web  Initiated by Tim Berners-Lee, the inventor of the World Wide Web.  A common framework that allows data.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
Linked Data Publishing on the Semantic Web Dr Nicholas Gibbins
Setting the stage: linked data concepts Moving-Away-From-MARC-a-thon.
Linked Data & Semantic Web Technology The Semantic Web Part 4. Resource Description Framework (1) Dr. Myungjin Lee.
OWL (Ontology Web Language and Applications) Maw-Sheng Horng Department of Mathematics and Information Education National Taipei University of Education.
The Semantic Web By: Maulik Parikh.
Knowledge Representation Part II Description Logic & Introduction to Protégé Jan Pettersen Nytun.
Service-Oriented Computing: Semantics, Processes, Agents
Tutorial on Semantic Web
Database Management Systems
SPARQL + RDF Based on: Prof. Benny Kimelfled’s lecture notes
RDF For Semantic Web Dhaval Patel 2nd Year Student School of IT
Logics for Data and Knowledge Representation
ece 720 intelligent web: ontology and beyond
CC La Web de Datos Primavera 2016 Lecture 2: RDF Model & Syntax
Semantic-Web, Triple-Strores, and SPARQL
Presentation transcript:

Database Management Systems Course Faculty of Computer Science Technion – Israel Institute of Technology Lecture 10: RDF and SPARQL

The Semantic Web 2 “The Semantic Web is an extension of the current web in which information is given well-defined meaning, better enabling computers and people to work in cooperation.” Tim Berners-Lee, James Hendler and Ora Lassila, Scientific American, May 2001 “The Web was designed as an information space, with the goal that it should be useful not only for human-human communication, but also that machines would be able to participate and help. One of the major obstacles to this has been the fact that most information on the Web is designed for human consumption, and even if it was derived from a database with well defined meanings (in at least some terms) for its columns, that the structure of the data is not evident to a robot browsing the web. Leaving aside the artificial intelligence problem of training machines to behave like people, the Semantic Web approach instead develops languages for expressing information in a machine processable form.” Tim Berners-Lee, Semantic Web Road map, 1998

3 More Technically... Vision: Web data will entail semantics in a manner that is understood (and processed, and linked) automatically by computers The “Semantic Web” is the technical infrastructure –Unambiguous names for resources that may also bind data to real world objects (URI) –A common data model to describe/link resources (RDF) –Expressive language to access to data (SPARQL) –Languages for defining common vocabularies and rules for automated reasoning (e.g., politician is person) (RDFS, OWL) Data providers should collaborate: properly publish their data and link it to existing data

RDF and SPARQL Recommendations RDF –“Resource Description Framework” –1997: first public draft; 1999: recommendation (revised 2004); 2014: RDF1.1 SPARQL –Query language for RDF –“SPARQL Protocol and RDF Query Language” Yes, recursive definition –2004: first public draft; 2008: recommendation; 2013: SPARQL1.1 4

Some Freely Available RDF Repositories DBPedia (~1.2b triples) –“a crowd-sourced community effort to extract structured information from Wikipedia and make this information available on the Web” Freebase (~340m triples) –“A community-curated DB of well-known people, places, and things” DBLP (~58m triples) –Computer science bibliography WordNet (~3m triples) –English lexical db: synonyms, antonyms, POS,... GeoNames (~94m triples) –“Covers all countries, contains over eight million placenames” Yago (~120m triples) –Information from Wikipedia, Wordnet, Geonames 5

There’s More! Linked! 6

RDF Example from DBPedia 7 Technion_Israel_Institute_of_ Technology property/students property/president urce/Peretz_Lavie ontology/birthYear ontology/birthPlace urce/Petah_Tikva ontology/birthPlace urce/Israel ontology/country

In XML Syntax 8 Technion_Israel_Institute_of_ Technology property/students property/president urce/Peretz_Lavie <rdf:RDF xmlns:rdf=" xmlns:rdfs=" xmlns:dbp=" xmlns:dbo=" <rdf:RDF xmlns:rdf=" xmlns:rdfs=" xmlns:dbp=" xmlns:dbo="

Querying (SPARQL) 9 Technion_Israel_Institute_of_ Technology property/students property/president urce/Peretz_Lavie PREFIX dbp: PREFIX dbr: SELECT ?inst { ?inst dbp:president dbr:Peretz_Lavie } PREFIX dbp: PREFIX dbr: SELECT ?inst { ?inst dbp:president dbr:Peretz_Lavie } inst el_Institute_of_Technology

The sameAs Property 10 SELECT DISTINCT ?url { ?c dbo:type dbr:City. ?c dbp:name ?city. ?c owl:sameAs ?url. FILTER ( str(?city)="Haifa") } SELECT DISTINCT ?url { ?c dbo:type dbr:City. ?c dbp:name ?city. ?c owl:sameAs ?url. FILTER ( str(?city)="Haifa") } url ハイファ 하이파 These URIs can be used for getting Haifa information from other RDF resources!

RDF Components URI vocabulary –Uniquely identify an object / type / concept –Basically, a string that can encode (hierarchies of) concepts in domains Description of directed graphs –With URIs for node and edge labels –Edge = triple Schema definition –Extend the vocabulary with reasoning with inheritance and inclusion 11

Additional Quotes from Scientific A. 05/01 Two important technologies for developing the Semantic Web are already in place: eXtensible Markup Language (XML) and the Resource Description Framework (RDF). XML lets everyone create their own tags... Meaning is expressed by RDF, which encodes it in sets of triples, each triple being rather like the subject, verb and object of an elementary sentence. –... These triples can be written using XML tags. RDF [...] makes assertions that particular things (people, Web pages or whatever) have properties (such as "is a sister of," "is the author of") with certain values (another person, another Web page). 12

Ontologies Originally, a philosophical discipline –Science of Being (Aristotle, Metaphysics, IV, 1) –What characterizes being? Eventually, what is being? –An ontology is a formal specification of a shared conceptualization (T. R. Gruber) Practically speaking, in the world of Semantic Web: –A public collection of entity and relationship names –An agreed-upon meaning (usually based on textual descriptions and context, e.g., HTML table or furniture table) –Identified by a known namespace URI –Rules on behavior (e.g., FOL) 13

Pubilc Ontologies Best practice is to define data using existing ontologies Famous examples: –Dublin Core (media, Web resources) –FOAF: Friend of a Friend (people/social) –The Music Ontology –Good Relations (e-commerce) Used by Best Buy for their RDF catalog 14

Main Lecture Resources Lecture notes by Marcelo Arenas –RDF y SPARQL: Dos componentes básicos para la Web de datos – Lecture notes by Yaron Kanza –The Semantic Web – 2015/ho/WCFiles/10-SemanticWeb-x6.pdfhttp://webcourse.cs.technion.ac.il/236369/Winter /ho/WCFiles/10-SemanticWeb-x6.pdf 15

Introduction Uniform Resource Identifiers RDF SPARQL  Formal Definition RDF Schema Outline 16

URI Uniform Resource Identifier Syntax has a specification in W3C –RFC 2396RFC 2396 A URL is a URI that points to a location on the network (e.g., server on the network) –e.g., –A general URI needs not be an actual URL e.g., urn:isbn: But, RDF requires URI to be dereferenceable –That is, they should point to a phisical description of the entity they represent

Relevant Quotes from S. A. 05/2001 Because RDF uses URIs to encode this information in a document, the URIs ensure that concepts are not just words in a document but are tied to a unique definition that everyone can find on the Web. For example, imagine that we have access to a variety of databases with information about people, including their addresses. If we want to find people living in a specific zip code, we need to know which fields in each database represent names and which represent zip codes. RDF can specify that “(field 5 in database A) (is a field of type) (zip code),” using URIs rather than phrases for each term. 18

Example Revisited 19 Technion_Israel_Institute_of_ Technology property/students property/president urce/Peretz_Lavie <rdf:RDF xmlns:rdf=" xmlns:rdfs=" xmlns:dbp=" xmlns:dbo=" <rdf:RDF xmlns:rdf=" xmlns:rdfs=" xmlns:dbp=" xmlns:dbo="

Terminology 20 <root xmlns:h=" xmlns:f=" prefixh local nametable qualified nameh:table namespace URIhttp:// expanded namehttp:// Semantically, a URI always represents the expanded name

Example Revisited 21 Technion_Israel_Institute_of_ Technology property/students property/president urce/Peretz_Lavie ontology/birthYear ontology/birthPlace urce/Petah_Tikva ontology/birthPlace urce/Israel ontology/country

Namespaces in Other Formats The idea of a namespace carries over the other RDF formats (later) The namespace is usually termed “prefix” 22

Example Revisited (Clearer Now) 23 dbr:Technion_Israel_Institute_ of_Technology dbp:students dbp:president dbr:Peretz_Lavie dbo:birthYear 1949 dbo:birthPlace dbr:Petah_Tikva dbo:birthPlace dbr:Israel dbo:.

Introduction Uniform Resource Identifiers RDF SPARQL  Formal Definition RDF Schema Outline 24

RDF Graph An RDF graph is a set of triples –Example: (dbr:technion, dbp:oresident, dbr:Lavie) (dbr:technion, dbp:students, 13253) Formally, we assume two sets: – U is a set of URIs, L is a set of literals An RDF triple is a member of U × U × (U ∪ L) An RDF graph is a finite set of RDF triples subject object predicate U U UL

Running Example: RDF Graph 26 dbr:Nate_Huffmandbp:teamdbr:Maccabi_TelAviv dbr:Nate_Huffmandbp:teamdbr:Toronto_Raptors dbr:Nate_Huffmandbo:height2.159 dbr:Gal_Mekeldbp:teamdbr:Maccabi_TelAviv dbr:Gal_Mekeldbp:teamdbr:Dallas_Mavericks dbr:Lior_Eliyahudbp:teamdbr:Maccabi_TelAviv dbr:Lior_Eliyahudbo:height2.05 URI literal

Our Model is a Simplification We do not represent blank nodes –These are nodes without URIs We do not represent datatypes –e.g., integer, float, string, date,... Further reading for interest: RDF books, online tutorials, W3C 27

Representing RDF Graphs There are several formats for representing RDF triples –We have seen examples of RDF/XML Namespaces, Description,... –JSON-LD LD stands for Linked Data –N-Triple Straightforward triples –Turtle More compact than N-Triple 28

Representation Examples 29 dbp:country dbr:Israel ; dbp:staff 870 ; dbp:budget "US$381 ; dbp:president dbr:Peretz_Lavie ; dbp:undergrad 9564 ; dbp:established 1912 ; dbp:students13253 ; dbp:country dbr:Israel ; dbp:staff 870 ; dbp:budget "US$381 ; dbp:president dbr:Peretz_Lavie ; dbp:undergrad 9564 ; dbp:established 1912 ; dbp:students13253 ; Turtle "622"^^. "13253"^^.. "622"^^. "13253"^^.. N-Triple { [ { " Institute_of_Technology", " : [ { " ], " : [ 870 ], " : [ ] ] } { [ { " Institute_of_Technology", " : [ { " ], " : [ 870 ], " : [ ] ] } JSON-LD

Introduction Uniform Resource Identifiers RDF SPARQL  Formal Definition RDF Schema Outline 30

Query Language for RDF? To query RDF, we can use existing languages –SQL (over the triple relation) –XQuery (over RDF/XML) But: –We want QLs that are simpler and intuitive on graphs (triples) e.g., graph patterns should be easily phrased –The open-world nature of the semantic Web makes incompleteness a first-class citizen We should easily allow for optional information when exists (not NULL reasoning)

SPARQL Query Types SELECT –Returns mappings ASK –Boolean – exists at least one mapping? DESCRIBE –Includes a detailed description of found URIs CONSTRUCT –Construct a new RDF via the query We restrict to SELECT ! –But the main idea is very similar on all 32

SPARQL Examples 33 SELECT ?x ?n { ?x dbp:team dbr:Maccabi_TelAviv. ?x dbp:nationality ?n } Maccabi players + nationalities SELECT ?x ?n ?h { ?x dbp:team dbr:Maccabi_TelAviv. ?x dbp:nationality ?n OPTIONAL { ?x dbo:height ?h } } Add height optionally (left o. join) SELECT ?x ?n { ?x dbp:team dbr:Maccabi_TelAviv. ?x dbp:nationality ?n. ?x dbo:height ?h. FILTER(?h>2) } Restrict to players >2m SELECT ?x ?n ?h ?t { ?x dbp:team dbr:Maccabi_TelAviv. ?x dbp:nationality ?n OPTIONAL { ?x dbp:team ?t. ?t rdf:type yago:NBA} OPTIONAL { ?x dbo:height ?h } } Add both height and NBA memberships optionally

Try it on 34 SELECT distinct ?x ?t ?h { ?x dbp:team. ?x dbp:nationality ?n OPTIONAL { ?x dbp:team ?t. ?t rdf:type yago:NationalBasketballAssociationTeams } OPTIONAL { ?x dbo:height ?h } SELECT distinct ?x ?t ?h { ?x dbp:team. ?x dbp:nationality ?n OPTIONAL { ?x dbp:team ?t. ?t rdf:type yago:NationalBasketballAssociationTeams } OPTIONAL { ?x dbo:height ?h }

Introduction Uniform Resource Identifiers RDF SPARQL  Formal Definition RDF Schema Outline 35

RDF Query Model Next, we will see a formal definition of the SPARQL syntax and semantics Our definition covers the core of SPARQL, but omits many details –Does not cover blank nodes –Does not list the plethora of functions and Boolean predicates used for filtering As usual, more details in books, online tutorials, W3C, etc. 36

Basic SPARQL Query 37 The semantics is based on the notion of a mapping A mapping is a function μ that maps a set of variables, denoted vars(μ), to URIs and literals μ : vars(μ) ⟶ U ∪ L When applying a graph pattern P to an RDF graph G, the result is a set of mappings, denoted by P(G) The result of the query is the restriction (projection) of these mappings to ?x, ?y,... SELECT ?x,?y,... { graph-pattern }

Triple Patterns The simplest (atomic) pattern is a triple pattern Semantics of a triple pattern t : t(G) = { μ : vars(t) ⟶ U∪L | μ(t) ∈ G} That is, t(G) contains all of the mappings μ such that: – vars(μ) consists of the variables in t, and –When replacing each variable ?x with the constant μ(?x), the triple t becomes a triple in G In the definition we denote the new triple as μ(t) 38 S P O URI / variable URI / variable / literal

Example 1 39 dbr:Nate_Huffmandbp:teamdbr:Maccabi_TelAviv dbr:Nate_Huffmandbp:teamdbr:Toronto_Raptors dbr:Nate_Huffmandbo:height2.159 dbr:Gal_Mekeldbp:teamdbr:Maccabi_TelAviv dbr:Gal_Mekeldbp:teamdbr:Dallas_Mavericks dbr:Lior_Eliyahudbp:teamdbr:Maccabi_TelAviv dbr:Lior_Eliyahudbo:height2.05 ?x dbp:team ?t xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal Mekeldbr:Maccabi_TelAviv dbr:Gal Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv { ?x ⟶ dbr:Nate_Huffman, ?t ⟶ dbr:Maccabi_TelAviv} { ?x ⟶ dbr:Nate_Huffman, ?t ⟶ dbr:Toronto_Raptors} { ?x ⟶ dbr:Gal_Mekel, ?t ⟶ dbr:Maccabi_...} { ?x ⟶ dbr:Gal_Mekel, ?t ⟶ dbr:Dallas_Mavericks} { ?x ⟶ dbr:Lior_Eliyahu, ?t ⟶ dbr:Maccabi_TelAviv}

Example 2 40 dbr:Nate_Huffmandbp:teamdbr:Maccabi_TelAviv dbr:Nate_Huffmandbp:teamdbr:Toronto_Raptors dbr:Nate_Huffmandbo:height2.159 dbr:Gal_Mekeldbp:teamdbr:Maccabi_TelAviv dbr:Gal_Mekeldbp:teamdbr:Dallas_Mavericks dbr:Lior_Eliyahudbp:teamdbr:Maccabi_TelAviv dbr:Lior_Eliyahudbo:height2.05 dbr:Nate_Huffman ?p ?o po dbp:teamdbr:Maccabi_TelAviv dbp:teamdbr:Toronto_Raptors dbo:height2.159

Terminology Two mappings μ 1 and μ 2 are compatible if they agree on their common values ?x ∈ ( vars(μ 1 ) ∩ vars(μ 2 ) ) ⟹ μ 1 (?x)=μ 2 (?x) The join μ 1 ⨝μ 2 of two compatible mappings μ 1 and μ 2 is the mapping μ with: – vars(μ) = vars(μ 1 ) ∪ vars(μ 2 ) – μ(?x)=μ i (?x) whenever ?x∈vars(μ i ) The projection π X (μ) of a mapping μ to a set X of variables is the mapping λ with: – vars(λ) = vars(μ) ∩ X – λ(?x)=μ(?x) for all ?x in vars(λ) 41

Example: Compatibility and Join 42 xt dbr:Nate_Huffmandbr:Maccabi_TelAviv xt dbr:Nate_Huffmandbr:Toronto_Raptors xt0 dbr:Nate_Huffmandbr:Toronto_Raptors xh dbr:Nate_Huffman2.159 x0t dbr:Gal_Mekeldbr:Dallas_Mavericks x0t0 dbr:Gal_Mekeldbr:Dallas_Mavericks incompatible compatible comp. compatible incompatible xth dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159 xtx0t0 dbr:Nate_Huffma n dbr:Maccabi_TelAvivdbr:Gal_Mekeldbr:Dallas_Mavericks xtt0 dbr:Nate_Huffmandbr:Maccabi_TelAvivdbr:Toronto_Raptors

Example: Projection 43 xt dbr:Nate_Huffmandbr:Toronto_Raptors xth dbr:Nate_Huffmandbr:Toronto_Raptors2.159 x0t dbr:Gal_Mekeldbr:Dallas_Mavericks x0t0 dbr:Gal_Mekeldbr:Dallas_Mavericks π {x,t} (μ) μ xt dbr:Nate_Huffmandbr:Toronto_Raptors xt dbr:Nate_Huffmandbr:Toronto_Raptors { } t dbr:Dallas_Mavericks

Equivalent Presentations of Mapping Sets 44 xtha dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159 dbr:Nate_Huffmandbr:Toronto_Raptors2.159 dbr:Nate_Huffmandbr:Maccabi_TelAvivyago:NBA dbr:Nate_Huffmandbr:Toronto_Raptorsyago:EL dbr:Lior_Eliyahudbr:Maccabi_TelAviv2.05 dbr:Lior_Eliyahudbr:Maccabi_TelAvivyago:EL xth dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159 dbr:Nate_Huffmandbr:Toronto_Raptors2.159 dbr:Lior_Eliyahudbr:Maccabi_TelAviv2.05 xta dbr:Nate_Huffmandbr:Maccabi_TelAvivyago:NBA dbr:Nate_Huffmandbr:Toronto_Raptorsyago:EL dbr:Lior_Eliyahudbr:Maccabi_TelAvivyago:EL Collection of complete tables Missing Values The same!

Algebraic Operations Let Ω 1 and Ω 2 be two sets of matches Join: Ω 1 ⨝Ω 2 = {μ 1 ⨝μ 2 | μ i ∈Ω i ⋀ compatible(μ 1,μ 2 )} Difference: Ω 1 -Ω 2 = {μ 1 ∈Ω 1 | no μ 2 ∈Ω 2 is compatible with μ 1 } Left outer join: Ω 1 Ω 2 = (Ω 1 ⨝Ω 2 ) ∪ (Ω 1 -Ω 2 ) Projection: π X (Ω 1 ) = { π X (μ 1 ) | μ 1 ∈Ω 1 } Filter (selection) for a Boolean condition F over matches σ F (Ω 1 ) = {μ 1 ∈Ω 1 | μ 1 satisfies F} 45

Example: Join 46 xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv xh dbr:Nate_Huffman2.159 dbr:Lior_Eliyahu2.05 ⨝= xth dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159 dbr:Nate_Huffmandbr:Toronto_Raptors2.159 dbr:Lior_Eliyahudbr:Maccabi_TelAviv2.05

Example: 2xJoin 47 xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv xh dbr:Nate_Huffman2.159 dbr:Lior_Eliyahu2.05 ta dbr:Toronto_Raptorsyago:NBA dbr:Maccabi_TelAvivyago:EL ⨝ xtha dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159yago:EL dbr:Nate_Huffmandbr:Toronto_Raptors2.159yago:NBA dbr:Lior_Eliyahudbr:Maccabi_TelAviv2.05yago:EL ⨝ =

Example: Difference (1) 48 xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv xh dbr:Nate_Huffman2.159 dbr:Lior_Eliyahu = xt dbr:Gal_Mekeldbr:Dallas_Mavericks

Example: Difference (2) 49 xh dbr:Lior_Eliyahu2.05 ta dbr:Dallas_Mavericksyago:NBA - = xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv

Example: Difference (3) 50 xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv - = a yago:NBA yago:EL { }

Example: Left Outer Join (1) 51 xh dbr:Nate_Huffman2.159 dbr:Lior_Eliyahu2.05 = xth dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159 dbr:Nate_Huffmandbr:Toronto_Raptors2.159 dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv2.05 xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv

Example: Left Outer Join (2) 52 xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv dbr:Utah_Jazz ta yago:NBA dbr:Maccabi_TelAvivyago:EL = xta dbr:Nate_Huffmandbr:Maccabi_TelAvivyago:EL dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAvivyago:EL dbr:Utah_Jazzyago:NBA

Example: Join, Difference, Outer Join (1) 53 xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv xh dbr:Nate_Huffman2.159 dbr:Lior_Eliyahu2.05 ta dbr:Toronto_Raptorsyago:NBA dbr:Maccabi_TelAvivyago:EL ⨝= xtha dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159 dbr:Nate_Huffmandbr:Toronto_Raptors2.159 dbr:Nate_Huffmandbr:Maccabi_TelAvivyago:NBA dbr:Nate_Huffmandbr:Toronto_Raptorsyago:EL dbr:Lior_Eliyahudbr:Maccabi_TelAviv2.05 dbr:Lior_Eliyahudbr:Maccabi_TelAvivyago:EL

Example: Join, Difference, Outer Join (2) 54 xh dbr:Nate_Huffman2.159 dbr:Lior_Eliyahu2.05 ta dbr:Toronto_Raptorsyago:NBA dbr:Maccabi_TelAvivyago:EL - xt dbr:Gal_Mekeldbr:Dallas_Mavericks xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv =

Example: Join, Difference, Outer Join (3) 55 xh dbr:Nate_Huffman2.159 dbr:Lior_Eliyahu2.05 ta dbr:Toronto_Raptorsyago:NBA dbr:Maccabi_TelAvivyago:EL xtha dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159 dbr:Nate_Huffmandbr:Toronto_Raptors2.159 dbr:Nate_Huffmandbr:Maccabi_TelAvivyago:NBA dbr:Nate_Huffmandbr:Toronto_Raptorsyago:EL dbr:Lior_Eliyahudbr:Maccabi_TelAviv2.05 dbr:Lior_Eliyahudbr:Maccabi_TelAvivyago:EL dbr:Gal_Mekeldbr:Dallas_Mavericks xt dbr:Nate_Huffmandbr:Maccabi_TelAviv dbr:Nate_Huffmandbr:Toronto_Raptors dbr:Gal_Mekeldbr:Dallas_Mavericks dbr:Lior_Eliyahudbr:Maccabi_TelAviv =

Projection Example 56 xtha dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159 dbr:Nate_Huffmandbr:Toronto_Raptors2.159 dbr:Nate_Huffmandbr:Maccabi_TelAvivyago:NBA dbr:Nate_Huffmandbr:Toronto_Raptorsyago:EL dbr:Lior_Eliyahudbr:Maccabi_TelAviv2.05 dbr:Lior_Eliyahudbr:Maccabi_TelAvivyago:EL dbr:Gal_Mekeldbr:Dallas_Mavericks π ?x,?h = xh dbr:Nate_Huffman2.159 dbr:Nate_Huffman dbr:Lior_Eliyahu2.05 dbr:Lior_Eliyahu dbr:Gal_Mekel

Filter Example 57 xtha dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159yago:EL dbr:Nate_Huffmandbr:Toronto_Raptors2.159yago:NBA dbr:Lior_Eliyahudbr:Maccabi_TelAviv2.05yago:EL dbr:Gal_Mekeldbr:Maccabi_TelAvivyago:EL dbr:Gal_Mekeldbr:Dallas_Mavericks = σ ?a=yago:EL xtha dbr:Nate_Huffmandbr:Maccabi_TelAviv2.159yago:EL dbr:Lior_Eliyahudbr:Maccabi_TelAviv2.05yago:EL dbr:Gal_Mekeldbr:Maccabi_TelAvivyago:EL

SPARQL Filter Language Atomic binary predicates (+scalar functions) – bound(?x) Satisfied by μ if ?x is in vars(μ) – ?x=?y, ?x=“Technion” Satisfied by μ if involved variables are bound and equality holds – regex(str(?mbox), Composition via Boolean operators – and, or, not 58

SPARQL Basic Syntax 59 Pattern P Semantics: P(G) triple pattern tt(G) P 1. P 2 P 1 (G) ⨝ P 2 (G) {P 1 } MINUS {P 2 }P 1 (G) - P 2 (G) P 1 OPTIONAL {P 2 }P 1 (G) ⟕ P 2 (G) {P 1 } UNION {P 2 }P 1 (G) ∪ P 2 (G) {P 1 FILTER ( F )}σ F P 1 (G) SELECT ?x 1,...,?x k WHERE {P 1 }π {x 1,...,x k } (P 1 (G)) optional

Examples Revisited 60 SELECT ?x ?n { ?x dbp:team dbr:Maccabi_TelAviv. ?x dbp:nationality ?n } triple, join, projection SELECT ?x ?n ?h { ?x dbp:team dbr:Maccabi_TelAviv. ?x dbp:nationality ?n OPTIONAL { ?x dbo:height ?h } } triple, join, projection, l.o.join SELECT ?x ?n { ?x dbp:team dbr:Maccabi_TelAviv. ?x dbp:nationality ?n. ?x dbo:height ?h. FILTER(?h>2) } triple, join, projection, filter SELECT ?x ?n ?h ?t { ?x dbp:team dbr:Maccabi_TelAviv. ?x dbp:nationality ?n OPTIONAL { ?x dbp:team ?t. ?t rdf:type yago:NBA} OPTIONAL { ?x dbo:height ?h } } triple, join, projection, l.o.join

Ex SELECT ?president { ?president rdf:type yago:PresidentsOfTheUnitedStates. ?president dbo:profession dbr:Lawyer. } SELECT ?president { ?president rdf:type yago:PresidentsOfTheUnitedStates. ?president dbo:profession dbr:Lawyer. } Lincoln Nixon Clinton Roosevelt dbr:Abraham_Lincolndbo:partydbr:Republican_Party dbr:Abraham_Lincolndbo:partydbr:Whig_Party dbr:Abraham_Lincolndbo:professiondbr:Lawyer dbr:Abraham_Lincolnrdf:type yago:PresidentsOfTheUnitedStates dbr:Franklin_D._Rooseveltdbo:professiondbr:Lawyer dbr:Franklin_D._Rooseveltdbo:partydbr:Democratic_Party dbr:Franklin_D._Rooseveltrdf:type yago:PresidentsOfTheUnitedStates dbr:Richard_Nixondbo:partydbr:Republican_Party dbr:Richard_Nixonrdf:type yago:PresidentsOfTheUnitedStates dbr:Bill_Clintondbo:professiondbr:Lawyer dbr:Bill_Clintonrdf:type yago:PresidentsOfTheUnitedStates

Ex SELECT ?president { ?president rdf:type yago:PresidentsOfTheUnitedStates. ?president dbo:profession dbr:Lawyer. OPTIONAL { ?president dbo:party ?party } } SELECT ?president { ?president rdf:type yago:PresidentsOfTheUnitedStates. ?president dbo:profession dbr:Lawyer. OPTIONAL { ?president dbo:party ?party } } Lincoln Nixon Clinton Roosevelt dbr:Abraham_Lincolndbo:partydbr:Republican_Party dbr:Abraham_Lincolndbo:partydbr:Whig_Party dbr:Abraham_Lincolndbo:professiondbr:Lawyer dbr:Abraham_Lincolnrdf:type yago:PresidentsOfTheUnitedStates dbr:Franklin_D._Rooseveltdbo:professiondbr:Lawyer dbr:Franklin_D._Rooseveltdbo:partydbr:Democratic_Party dbr:Franklin_D._Rooseveltrdf:type yago:PresidentsOfTheUnitedStates dbr:Richard_Nixondbo:partydbr:Republican_Party dbr:Richard_Nixonrdf:type yago:PresidentsOfTheUnitedStates dbr:Bill_Clintondbo:professiondbr:Lawyer dbr:Bill_Clintonrdf:type yago:PresidentsOfTheUnitedStates

Ex SELECT ?president { { ?president rdf:type yago:PresidentsOfTheUnitedStates. ?president dbo:profession dbr:Lawyer. OPTIONAL { ?president dbo:party ?party } } MINUS {dbr:Richard_Nixon dbo:party ?party} } SELECT ?president { { ?president rdf:type yago:PresidentsOfTheUnitedStates. ?president dbo:profession dbr:Lawyer. OPTIONAL { ?president dbo:party ?party } } MINUS {dbr:Richard_Nixon dbo:party ?party} } Lincoln Nixon Clinton Roosevelt dbr:Abraham_Lincolndbo:partydbr:Republican_Party dbr:Abraham_Lincolndbo:partydbr:Whig_Party dbr:Abraham_Lincolndbo:professiondbr:Lawyer dbr:Abraham_Lincolnrdf:type yago:PresidentsOfTheUnitedStates dbr:Franklin_D._Rooseveltdbo:professiondbr:Lawyer dbr:Franklin_D._Rooseveltdbo:partydbr:Democratic_Party dbr:Franklin_D._Rooseveltrdf:type yago:PresidentsOfTheUnitedStates dbr:Richard_Nixondbo:partydbr:Republican_Party dbr:Richard_Nixonrdf:type yago:PresidentsOfTheUnitedStates dbr:Bill_Clintondbo:professiondbr:Lawyer dbr:Bill_Clintonrdf:type yago:PresidentsOfTheUnitedStates

Ex dbr:Abraham_Lincolndbo:partydbr:Republican_Party dbr:Abraham_Lincolndbo:partydbr:Whig_Party dbr:Abraham_Lincolndbo:professiondbr:Lawyer dbr:Abraham_Lincolnrdf:type yago:PresidentsOfTheUnitedStates dbr:Franklin_D._Rooseveltdbo:professiondbr:Lawyer dbr:Franklin_D._Rooseveltdbo:partydbr:Democratic_Party dbr:Franklin_D._Rooseveltrdf:type yago:PresidentsOfTheUnitedStates dbr:Richard_Nixondbo:partydbr:Republican_Party dbr:Richard_Nixonrdf:type yago:PresidentsOfTheUnitedStates dbr:Bill_Clintondbo:professiondbr:Lawyer dbr:Bill_Clintonrdf:type yago:PresidentsOfTheUnitedStates Write SPARQL queries that: 1.Find the presidents who were in one or more of Lincoln’s parties 2.Find the presidents who were in none of Lincoln’s parties 3.For each president in (1) and (2), add his dbp:spouse if exists You can send your answers for Ex. 1-4 to to get feedback

From Graphs to Datasets An important ability in SPARQL is the ability to query multiple graphs (from multiple sources) This is formalized as follows An RDF dataset D is a pair (G 0,Ext), where: – G 0 is the default RDF graph – Ext is a finite mapping of URIs to RDF graphs These are the other graphs that can be referenced by means of URIs 65 Ext(u 1 )Ext(u 2 )Ext(u 3 ) G0G0

SPQRQL over RDF Datasets Let D=(G 0,Ext) be an RDF dataset, G be an RDF graph ( G=G 0 or G∈Ext ), and P be a graph pattern If u be a URI in the domain of Ext, then now Q={GRAPH u {P}} is also a graph pattern Q(G) = P(Ext(u)) Q={GRAPH ?x {P}} is now also a graph pattern Q(G) = ∪ u∈dom(Ext) ( {?x⟶u} ⨝ P(Ext(u)) ) We can define the eval of a pattern P' over D : P'(D) = P'(G 0 ) 66 Ignore G !

Adding Graph to Basic Syntax Pattern P Semantics: P(G) triple pattern tt(G) P 1. P 2 P 1 (G) ⨝ P 2 (G) {P 1 } MINUS {P 2 }P 1 (G) - P 2 (G) P 1 OPTIONAL {P 2 }P 1 (G) ⟕ P 2 (G) {P 1 } UNION {P 2 }P 1 (G) ∪ P 2 (G) {P 1 FILTER ( F )}σ F P 1 (G) SELECT ?x 1,...,?x k {P 1 }π {x 1,...,x k } (P 1 (G)) GRAPH u {P 1 }P 1 (Ext(u)) GRAPH ?x {P 1 } ∪ u∈dom(Ext) ( {?x⟶u} ⨝ P 1 (Ext(u)) )

Example 68 SELECT ?m ?g ?party FROM NAMED { ?city dbp:mayor ?m1 ?m1 owl:sameAs ?m OPTIONAL { GRAPH ?g {?m ex:isAffiliatedTo ?party} }} dbr:Ashdoddbp:mayordbr:Yehiel_Lasri owl:sameAsex:Yehiel_Lasri dbr:Haifadbp:mayordbr:Yona_Yahav owl:sameAsex:Yona_Yahav Default (i.e., G 0 ) ex:Yona_Yahavex:isAffiliatedToex:Kadima ex:Yona_Yahavex:isAffiliatedToex:Laborhttp://ex2.org/ mgparty ex:Yehiel_Lasri ex:Yona_Yahavhttp://ex1.org/ex:Kadima ex:Yona_Yahavhttp://ex2.org/ex:Labor Ext

Try at 69 PREFIX dbo: SELECT distinct ?h ?e { ?x owl:sameAs ?y. ?x rdfs:label ?h. GRAPH { ?y rdfs:label ?e. ?y rdf:type dbo:Animal } FILTER(LANG(?h) = "he" and LANG(?e) = "en") } he זעמן Coluber חדקן Acipenser חזיר יבלות Phacochoerus קורא Ammoperdix נץ Accipiter ערוד African wild ass

Additional Features (SPARQL 1.1) SELECT ?city, count(?x) AS ?c { ?x rdf:type dbo:Scientist. ?x dbo:birthPlace ?city. ?city dbo:country dbr:Israel. } GROUP BY ?city ORDER BY DESC(count(*)) Aggregate Queries select ?s { ?s rdf:type dbo:Scientist. ?s (dbo:doctoralAdvisor)+ dbr:Alonzo_Church. } Property Path cityc dbr:Tel_Aviv25 dbr:Haifa12 dbr:Rehovot5 dbr: Petah_Tikva4 dbr:Tiberias2 dbr:Safed1 dbr:Nazareth1 s dbr:Alan_Turing dbr:Andrej_Bauer dbr:Angus_Macintyre dbr:Dana_Scott dbr:Dov_Gabbay dbr:J._Barkley_Rosser dbr:Jack_Copeland dbr:Jeff_Paris dbr:Kurt_Mehlhorn dbr:Martin_Davis dbr:Martin_Hyland s dbr:Michael_Fourman dbr:Michael_O._Rabin dbr:Paul_Ernest dbr:Peter_Mosses dbr:Robert_Lee_Constable dbr:Robin_Gandy dbr:Saharon_Shelah dbr:Stephen_Cole_Kleene dbr:Susanne_Albers dbr:William_Boone dbr:Yiannis_N._Moschovakis

Advisory Graph 71 dbr:Alonzo_Church dbo:doctoralAdvisor dbr:Alan_Turing dbr:Michael_O._Rabin dbr:Saharon_Shelah dbo:doctoralAdvisor dbr:Dov_Gabbay dbr:Robin_Gandy dbo:doctoralAdvisor dbr:Jeff_Paris

Introduction Uniform Resource Identifiers RDF SPARQL  Formal Definition RDF Schema Outline 72

RDF Schema RDF Schema (RDFS) enriches RDF with semantics –Types/subtypes, classes/subclasses –Properties and sub-properties –Typing of properties A simple extension to describe ontologies –Very limited compared to other concepts –Monotone – does not say what “cannot” happen –Very different notion from SQL schema, DTD,... Not outside RDF, extends RDF Why is it useful? –General reasoning/integration power –Allows to automatically infer implicit information

Example (Wikipedia) 74 ex:dog1 ex:animal rdf:type ex:cat ex:cat1 rdf:type ex:cat ex:cat2 zoo:host SELECT ?x { ?x rdf:type ex:animal } SELECT ?x { ?x rdf:type ex:animal } x ex:dog1 rdf:typeex:animal ex:cat1rdf:typeex:cat ex:zoo1zoo:hostex:cat2

Example (Wikipedia) 75 ex:dog1 ex:animal rdf:type ex:cat ex:cat1 rdf:type rdfs:subClassOf ex:cat ex:cat2 zoo:host rdfs:range x ex:dog1 ex:cat1 ex:cat2 ex:dog1rdf:typeex:animal ex:cat1rdf:typeex:cat ex:zoo1zoo:hostex:cat2 ex:catrdfs:subClassOfex:animal zoo:hostrdfs:rangeex:animal SELECT ?x { ?x rdf:type ex:animal } SELECT ?x { ?x rdf:type ex:animal }

We Discuss Four RDFS Properties p rdfs:domain C –Example: ex:teaches rdfs:domain ex:professor p rdfs:range C –Example: ex:teaches rdfs:range ex:course p rdfs:subPropertyOf q –Example: ex:motherOf rdfs:subPropertyOf ex:parentOf C rdfs:subClassOf D –Example: ex:pizza rdfs:subClassOf ex:Food 76

Inference System for RDFS 77 Rules for inferring additional triples from existing RDF/RDFS triples: Given ⇒ Infer (p,rdfs:domain,C), (s,p,o)(s,rdf:type,C) (p,rdfs:range,C), (s,p,o)(o,rdf:type,C) (p,rdfs:subPropertyOf,q), (s,p,o)(s,q,o)(s,q,o) (C,rdfs:subClassOf,D), (s,rdf:type,C)(s,rdf:type,D) Transitivity (p,rdfs:subPropertyOf,q), (q,rdfs:subPropertyOf,r)(p,rdfs:subPropertyOf,r) (C,rdfs:subClassOf,D), (D,rdfs:subClassOf,E)(C,rdfs:subClassOf,E)

Example 78 dbr:Israelex:ministerex:Gila_Gamliel dbr:Israelex:finance_ministerex:Moshe_Kahlon ex:finance_ministerrdfs:subPropertyOfex:minister rdfs:rangedbr:politician rdfs:subClassOfdbo:person dbr:Israelex:ministerex:Moshe_Kahlon IL minister IL finance_minister ex:Gila_Gamlieldrf:typedbr:politician politician ex:Gila_Gamlieldrf:typedbo:person ex:Moshe_Kahlondrf:typedbr:politician ex:Moshe_Kahlondrf:typedbo:person person

RDFS Closure The RDFS closure of an RDF graph G is the graph obtained from G by iteratively adding triples inferred from the rules until impossible (fixpoint) –We denote this graph by cl(G) A SPARQL engine that supports RDFS gives the result of cl(G) P RDFS (G) = P(cl(G)) 79

Example 80 dbr:Moshe_Vardidbo:doctoralAdvisordbr:Catriel_Beeri dbo:doctoralAdvisorrdfs:domaindbo:Scientist dbr:Moshe_Vardidbo:birthPlacedbr:Haifa dbr:Ron_Kimmeldbo:birthPlacedbr:Haifa dbr:Ron_Kimmelrdf:typedbo:Scientist SELECT ?x { ?x rdf:type dbo:Scientist. ?x dbo:birthPlace dbr:Haifa } SELECT ?x { ?x rdf:type dbo:Scientist. ?x dbo:birthPlace dbr:Haifa } x dbr:Ron_Kimmel P(G) x dbr:Ron_Kimmel dbr:Moshe_Vardi P RDFS (G)

RDFS Expressiveness Limitations No negation –Cannot state disjointness (e.g., animals / people) Limited containment relationship –For example, every mammal is either an animal or a person No cardinality/inclusion constraints –Every mammal has exactly two biological parents –Every course has at least one lecturer No logical constraints on relations –For example, inverse (parent/child), transitivity

Beyond RDFS: OWL OWL (Web Ontology Language) is designed to provide rich expressiveness for ontology specification and reasoning –“OWL is now the most used KR language in the history of AI…” (Jim Hendler) Several classes (different expressiveness/complexity tradeoffs) –OWL Full, OWL DL, OWL Lite –In all versions, specs are in RDF 82

Examples foaf:made owl:inverseOf foaf:maker ex:friend rdf:type owl:SymmetricProperty geo:located rdf:type owl:TransitiveProperty Additional properties: – owl:FunctionalProperty, owl:ComplementOf, owl:IntersectionOf 83