RDF. Resource Description Framework

Similar documents
RDF. Resource Description Framework

RDF Schema. Mario Arrigoni Neri

Semantic Web In Depth: Resource Description Framework. Dr Nicholas Gibbins 32/4037

Logic and Reasoning in the Semantic Web (part I RDF/RDFS)

Short notes about OWL 1

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

RDF AND SPARQL. Part III: Semantics of RDF(S) Dresden, August Sebastian Rudolph ICCL Summer School

Formalising the Semantic Web. (These slides have been written by Axel Polleres, WU Vienna)

An Introduction to the Semantic Web. Jeff Heflin Lehigh University

Outline RDF. RDF Schema (RDFS) RDF Storing. Semantic Web and Metadata What is RDF and what is not? Why use RDF? RDF Elements

Mustafa Jarrar: Lecture Notes on RDF Schema Birzeit University, Version 3. RDFS RDF Schema. Mustafa Jarrar. Birzeit University

The Semantic Web. Mansooreh Jalalyazdi

SEMANTIC WEB 05 RDF SCHEMA MODELLING SEMANTICS IMRAN IHSAN ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD

Ontological Modeling: Part 2

Semantic Web. RDF and RDF Schema. Morteza Amini. Sharif University of Technology Spring 90-91

Semantic Web Technologies: RDF + RDFS

XML and Semantic Web Technologies. III. Semantic Web / 1. Ressource Description Framework (RDF)

Semantic Web Engineering

Contents. G52IWS: The Semantic Web. The Semantic Web. Semantic web elements. Semantic Web technologies. Semantic Web Services

Unit 2 RDF Formal Semantics in Detail

Semantic Web Ontologies

LECTURE 09 RDF: SCHEMA - AN INTRODUCTION

Introduction to Ontologies

OSM Lecture (14:45-16:15) Takahira Yamaguchi. OSM Exercise (16:30-18:00) Susumu Tamagawa

RESOURCES DESCRIPTION FRAMEWORK: RDF

RDF /RDF-S Providing Framework Support to OWL Ontologies

Deep integration of Python with Semantic Web technologies

Today: RDF syntax. + conjunctive queries for OWL. KR4SW Winter 2010 Pascal Hitzler 3

Semantic Web Technologies: Web Ontology Language

INF3580/4580 Semantic Technologies Spring 2017

Semantic Web Test

RDF Schema. Philippe Genoud, UFR IM2AG, UGA Manuel Atencia Arcas, UFR SHS, UGA

Building Blocks of Linked Data

An RDF-based Distributed Expert System

Semantic Web Fundamentals

Chapter 3. RDF Schema

Seman&cs)of)RDF) )S) RDF)seman&cs)1)Goals)

For return on 19 January 2018 (late submission: 2 February 2018)

Part II. Representation of Meta-Information

The Semantic Web. What is the Semantic Web?

Chapter 2 AN INTRODUCTION TO THE OWL WEB ONTOLOGY LANGUAGE 1. INTRODUCTION. Jeff Heflin Lehigh University

TRIPLE An RDF Query, Inference, and Transformation Language

INF3580/4580 Semantic Technologies Spring 2017

RDF. Mario Arrigoni Neri

Resource Description Framework (RDF)

Linked Data and RDF. COMP60421 Sean Bechhofer

Developing markup metaschemas to support interoperation among resources with different markup schemas

Linked Data and RDF. COMP60421 Sean Bechhofer

Ontologies and OWL. Riccardo Rosati. Knowledge Representation and Semantic Technologies

Semantic Web. Ontology and OWL. Morteza Amini. Sharif University of Technology Fall 95-96

From the Web to the Semantic Web: RDF and RDF Schema

The Semantic Web RDF, RDF Schema, and OWL (Part 2)

Multi-agent and Semantic Web Systems: RDF Data Structures

RDF Schema Sebastian Rudolph

INF3580 Semantic Technologies Spring 2012

2. Knowledge Representation Applied Artificial Intelligence

CS Knowledge Representation and Reasoning (for the Semantic Web)

Knowledge Representation for the Semantic Web

The Semantic Web Revisited. Nigel Shadbolt Tim Berners-Lee Wendy Hall

SADI Semantic Web Services

Semantic Web Technologies

Linked data and its role in the semantic web. Dave Reynolds, Epimorphics

The Resource Description Framework and its Schema

RDF Semantics by Patrick Hayes W3C Recommendation

Web Science & Technologies University of Koblenz Landau, Germany. RDF Schema. Steffen Staab. Semantic Web

KNOWLEDGE GRAPHS. Lecture 3: Modelling in RDF/Introduction to SPARQL. TU Dresden, 30th Oct Markus Krötzsch Knowledge-Based Systems

H1 Spring B. Programmers need to learn the SOAP schema so as to offer and use Web services.

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

Semantic Technologies

RDF(S) Resource Description Framework (Schema)

KNOWLEDGE GRAPHS. Lecture 2: Encoding Graphs with RDF. TU Dresden, 23th Oct Markus Krötzsch Knowledge-Based Systems

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

RDF Schema Sebastian Rudolph

Semantic Web. Tahani Aljehani

MI-PDB, MIE-PDB: Advanced Database Systems

Opus: University of Bath Online Publication Store

Semantic Web Modeling Languages Part I: RDF

Description Logic. Eva Mráková,

Table of Contents. iii

SWAD-Europe Deliverable 8.1 Core RDF Vocabularies for Thesauri

Semantic Web. MPRI : Web Data Management. Antoine Amarilli Friday, January 11th 1/29

Web Ontology Language: OWL

KDI OWL. Fausto Giunchiglia and Mattia Fumagallli. University of Trento

OWL a glimpse. OWL a glimpse (2) requirements for ontology languages. requirements for ontology languages

OWL DL / Full Compatability

Web 2.0 Lecture 8: Resource Description Framework

Design and Implementation of an RDF Triple Store

Main topics: Presenter: Introduction to OWL Protégé, an ontology editor OWL 2 Semantic reasoner Summary TDT OWL

Linking Data with RDF

Adding formal semantics to the Web

Semantic Web. Part 3 The ontology layer 1: Ontologies, Description Logics, and OWL

Using RDF to Model the Structure and Process of Systems

Reasoning with the Web Ontology Language (OWL)

An Alternative CIM Modeling Approach using JSON-LD

RDFS. Suresh Manandhar* & Dimitar Kazakov

CS Knowledge Representation and Reasoning (for the Semantic Web)

Big Data 14. Graph Databases

Semantic Web Fundamentals

Limitations of the WWW

Transcription:

University of Rome Tor Vergata RDF Resource Description Framework Manuel Fiorelli fiorelli@info.uniroma2.it

2 Important dates for RDF 1999 RDF is adopted as a W3C Recommendation 2004 RDF 1.0 The Word Wide Web Consortium (W3C) is an international community developing open standards for the Web (called Recommendations) six documents (Primer, Concepts, Syntax, Semantics, Vocabulary, and Test Cases) jointly replace the original specification of RDF and the RDF Schema (2000 Candidate Recommendation) 2014 RDF 1.1 is the latest update to RDF

Characteristics Independence Shareability Scalability Everything is a resource properties are resources values can be resources statements can be resources 3

RDF Data Model An RDF Graph is a set of triples: The order of the triple components matters Triple := (subject, predicate, object) Subject is a resource Order and multiplicity of the triples are not relevant Predicate is a property of the subject resource Object is the value of the property (it can be a resource described through RDF triples) 4

RDF Data Model A set of triple can be seen as a direct labeled graph, in which every triple assumes the following shape: subject predicate object 5

RDF Data Model john loves mary Subject Predicate Object john loves mary 6

RDF Data Model The components of a triple can be: An IRI 1 (Internationalized Resource Identifier) is a UNICODE string conforming to RFC 3987. Examples: mailto:fiorelli@info.uniroma2.it urn:lex:it:stato:legge:2003-09-21;456 Extends URI (Uniform Resource Identifier) with support for other scripts in addition to the latin one A literal 2 is composed of: lexical form (a UNICODE string), a datatype IRI, and if only if the datatype is http://www.w3.org/1999/02/22-rdf-syntax-ns#langstring a non empty language tag (conforming to BCP 47) A blank node (bnode) 1 in RDF 1.0 there were RDF URI References 2 in RDF 1.0 there were plain literals without datatype and, optionally, with language tag 7

RDF Data Model There are some constraints on the use of IRIs, blank nodes and literals in a triple: The subject can be an IRI or blank node The predicate can be an IRI The object can be an IRI, blank node or literal 8

RDF Data Model http://example.org#john http://example.org#loves http://example.org#mary 9

10 RDF Data Model: Why IRIs? Extensible vocabulary Global scope (any appearance of an IRI must denote the same resource; otherwise, we say there is an IRI collision) Anyone can therefore mention resources defined elsewhere Ownership rules determine an IRI owner, who can establish its referent: By defining a specification for the IRI: it can be an RDF document! If the IRI is dereferenceable (eg: http:// or https://), it is possible to communicate its specification by making the IRI dereference to that specification (à la linked data)

RDF: Dataset Version 1.1 introduced the notion of dataset into the RDF specification (this notion already existed in the SPARQL specification). A dataset consists of: One default graph (it does not have a name) Zero or more named graphs. Each named graph is a pair formed by an IRI or blank node 1 (the graph name) and an RDF graph 1 actually SPARQL disallows the use of blank nodes as graph names. 11

12 RDF Data Model Any IRI or literal denotes something (a resource): The referent of an IRI The literal value of a literal Blank nodes are discussed later A triple represents a statement A given relation (denoted by the predicate) holds between the resources denoted by the subject and object The meaning of an RDF graph is thus the logical conjunction of the statements associated with each triple

RDF: expressive power RDF corresponds to the existential-conjunctive (EC) subset of first order logics it does not include negation (NOT) it does not include disjunction (OR) Unusual for a resctrition on first-order logics, RDF allows statements about relations: es: type(loves, social_relationship) loves(tom, Mary) 13

RDF: blank nodes A triple can include a blank node (bnode), which behaves as an existentially quantified variable: love(?x, Mary) tells us that somebody loves Mary, or, more precisely, something loves Mary The combination of different statements, through variable unification, allows us to express complex knowledge, still not fully grounded: gender(?x, male) AND loves(?x, Mary) tells us that Mary is loved by a male 14

n-ary relationships The sole presence of explicit binary relations does not forbid the representation of n-ary relationships Es: boilsat(water,100c,1atm) boiling type boil_w_1atm liquid Press temp 1 atm water 100 C 15

RDF: Concrete Syntaxes RDF/XML is no longer the only recommended format. A host of new serialization formats have been standardized. Source: https://www.w3.org/tr/rdf11-new/#section-serializations 16

RDF: Concrete Syntaxes There are diverse syntaxes for representing RDF. Here a few of them: RDF/XML It is a fully XML compliant (and based on) notation for RDF. As for N3, the triple structure can be hidden behind more complex syntactic structures. It has been originally one of the most diffused serializations for RDF N-Triples The closer notation to RDF abstract form, it consists in a series of triples: subject-predicateobject notation Notation 3 (N3) it includes several syntactic abbreviations that facilitate reading, hiding the strict triple structure characterizing RDF. This characterisitc, together with simple syntactic structures (differently from the heavy XML syntax) make N3 the most compact serialization. As for XML, N3 uses namespaces. Notation 3 has an expressive power which goes beyond RDF. Turtle thought to be a subset of N3 (and a superset of N-Triples) which can only serialize valid RDF graphs. It is today considered a much better alternative to RDF/XML 17

RDF/XML : a small example index.html creator Armando Stellato <rdf:rdf xmlns:rdf = http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:dc = http://purl.org/dc/elements/1.1/ > <rdf:description rdf:about = http://art.uniroma2.it/stellato/index.html > <dc:creator>armando Stellato</dc:creator> </rdf:description> </rdf:rdf> 18

RDF : a slightly more complex example Robin employedby Batman HQ Email Name Batcave boss@batman.org Bruce Wayne 19

RDF : a slightly more complex example and the related RDF/XML serialization <rdf:rdf xml:base = http://www.batman.org xmlns:rdf = http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:myschema = http://www.batman.org/myschema/ > <rdf:description rdf:about = http://www.batman.org#robin/ > <myschema:employedby rdf:resource = #Batman /> </rdf:description> <rdf:description rdf:id = Batman > <myschema:hq>batcave</myschema:hq> <myschema:name>bruce Wayne</mySchema:Name> <myschema:email rdf:resource = mailto:boss@batman.org /> </rdf:description> </rdf:rdf> 20

Turtle and its corresponding Turtle serialization @base <http://www.batman.org>. @prefix myschema: <http://www.batman.org/myschema/>. <http://www.batman.org#robin> myschema:employedby <#Batman>. <#Batman> myschema:hq "Batcave" ; myschema:name "Bruce Wayne" ; myschema:email <mailto:boss@batman>. 21

Trig The following dataset has only one named graph Curly braces can be omitted for the default graph { _:a foaf:name "Bob". _:a foaf:mbox <mailto:bob@oldcorp.example.org>. _:a foaf:knows _:b. } GRAPH <http://example.org/alice> { _:b foaf:name "Alice". _:b foaf:mbox <mailto:alice@work.example.org>. } The GRAPH keyword is optional for named graphs Identical blank node labels in different graph identify the same node 22

XML vs RDF RDF criticists and detractors have often sustained how RDF is useless with respect to what XML and XML Schema (and other, most recent, schema languages for XML) already provide RDF is seen by some as an overly complex technology, trying to solve a problem XML and HTTP already solve (Van Dijck, 2003) but RDF adds, through a very simply model, shared semantics for interpreting data Pros: no syntactic variance (e.g. attribute or nested element?): the XML serialization of a RDF graph is non-unique, however who cares about different serializations if all of them can univocally be traced back to the same RDF graph which originated them? Explicit semantics allow for better and more immediate integration of different distributed resources 23

XML vs RDF (2) Example: merge of two RDF fragments Human hemoglobin has_sequence GenBank + aagccgcacctgcgagtctaga gctatagccgcacctgcgagtct agaagctatagccgcacctgcgagtctag aagct has_sequence aagccgcacctgcgagtctaga gctatagccgcacctgcgagtct agaagctatagccgcacctgcgagtctag aagct Human hemoglobin is_a Oxygen transport protein Human hemoglobin is_a Oxygen Human transport protein hemoglobin Gene Ontology + Has 3D Structure Human hemoglobin Has 3D Structure PDB 24

XML vs RDF (3) Example: merge of two XML fragments <sequence id= abc123 >atagccgtacctgcgagtct </sequence> Generic Sequence XML + <is-a><object>human-hemoglobin</object><type>oxygen-transferprotein</type></is-a> Generic Gene Ontology XML + <structure><protein name= hh434 /><atom x= -30 y= 40 elem= H /> </structure> La integrazione richiede una profonda conoscenza degli schemi sorgenti, al fine di produrre delle complesse trasformazioni XSLT verso uno schema comune. Generic protein structure xml 25

RDFS: RDF Schema RDF (as-is) lacks the possibility to: specify different levels of abstraction organize resources into explicit categories define restrictions on properties RDFS extends RDF with a vocabulary for defining schemas, e.g.: Class, Property type, subclassof, subpropertyof range, domain with such an extension, RDF(S) can be considered to all effects a knowledge representation language 26

RDFS : Core vocabulary Core Classes rdfs:resource rdfs:literal rdfs:xmlliteral rdfs:class rdf:property rdfs:datatype rdf:type Core Properties rdfs:subclassof rdfs:subpropertyof rdfs:domain rdfs:range rdfs:label rdfs:comment 27

RDFS : Core vocabulary rdfs:resource All the things described through RDF expressions are resources and are considered as instances of class rdfs:resource rdfs:class represents the generic concept of type or category. Can be used to define any kind of thing, e.g. web pages, persons, documents, document types rdf:type This element already exists in the RDF vocabulary but, in RDFS, it binds resources to the categories (classes) they belong to. It is a construct analogous to the instance-of of OO design 28

RDFS : Core vocabulary rdf:property this resource comes from the RDF vocabulary as well, and represents the subset of all RDF resources that are properties rdfs:subclassof this property defines a super/subset relation between classes. It is a transitive property (note that the characteristic of being transitive comes from the semantics of the RDFS language and is hardwired into the subclassof property; it cannot be assigned to any property) rdfs:subpropertyof This property is used to specify that a property is a specialization of another property 29

RDFS : Core vocabulary rdfs:range states that all values for a given property belong to a given class rdfs:domain states that all resources characterized by a given property belong to a given class Annotation properties they do not play any role in the semantics of the language but provide a useful way for commenting/documenting a repository and its data rdfs:comment: the most general way to comment something. It usually provides a natural language definition of the resource it describes rdfs:label: provides terms for describing a resource. rdfs:seealso: it holds a pointer to another resource containing further information about the resource described by this property rdfs:isdefinedby: is a subproperty of rdfs:seealso and points to the resource that describe the subject resource, 30

RDFS: Schema Example <rdfs:class rdf:id= Provider > <rdfs:subclassof rdf:resource= #Person /> </rdfs:class> 31

Lower Layer Upper Layer RDFS : Schema Example Resource Class Property subclassof Vehicle subclassof subclassof subclassof Company LandVehicle SeaVehicle subclassof subclassof Hovercraft NumberOfEngines Number

RDFS : Schema Example <rdf:rdf xmlns:rdf = http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:rdfs = http://www.w3.org/2000/01/rdf-schema# <rdf:description rdf:id= Vehicle > <rdf:type resource= http://www.w3.org/2000/01/rdf-schema#class /> <rdfs:subclassof rdf:resource= http://www.w3.org/2000/01/rdf-schema#resource /> </rdf:description> <rdf:description rdf:id= LandVehicle > <rdf:type resource= http://www.w3.org/2000/01/rdf-schema#class /> <rdfs:subclassof rdf:resource= #Vehicle /> </rdf:description> <rdf:description rdf:id= SeaVehicle > <rdf:type resource= http://www.w3.org/2000/01/rdf-schema#class /> <rdfs:subclassof rdf:resource= #Vehicle /> </rdf:description> <rdf:description rdf:id= Hovercraft > <rdf:type resource= http://www.w3.org/2000/01/rdf-schema#class /> <rdfs:subclassof rdf:resource= #LandVehicle /> <rdfs:subclassof rdf:resource= #SeaVehicle /> </rdf:description> 33

RDFS : Schema Example <rdf:description rdf:id= Company > <rdf:type resource= http://www.w3.org/2000/01/rdf-schema#class /> <rdfs:subclassof rdf:resource= http://www.w3.org/2000/01/rdf-schema#resource /> </rdf:description> <rdf:description rdf:id= producedby > <rdf:type resource= http://www.w3.org/1999/02/22-rdf-syntax-ns#property /> <rdfs:domain rdf:resource= #Vehicle /> <rdfs:range rdf:resource= #Company /> <rdfs:label xml:lang="en">vehicle Producer</rdfs:label> </rdf:description> <rdf:description rdf:id= NumberOfEngines > <rdf:type resource= http://www.w3.org/1999/02/22-rdf-syntax-ns#property /> <rdfs:domain rdf:resource= #Hovercraft /> <rdfs:range rdf:resource= http://www.w3.org/1999/02/22-rdf-syntax-nx#number /> <rdfs:comment xml:lang="en">this property states how many engines the hovercraft has</rdfs:comment> </rdf:description> </rdf:rdf> continues from the previous page 34

RDFS limitations RDFS is too weak for describing resources with enough level of detail No contextualized range/domain contraints It is not possible to constraint the range of haschild to Person when it is applied to persons and to Elephant when applied to elephants No existentiality/cardinality constraints it is not possible to state that all instances of Person have a mother that is also a person, or that all people have exactly 2 parents No transitive, inverse or symmetric property It is not possible to state that ispartof is a transitive property, that haspart is the inverse of ispartof or that touches is symmetric 35

From RDF to OWL Two languages developed by extending (part of) RDFS OIL: developed by group of (largely) European researchers (several from EU OntoKnowledge project) DAML-ONT: developed by group of (largely) US researchers (in DARPA DAML programme) Efforts merged to produce DAML+OIL Development was carried out by Joint EU/US Committee on Agent Markup Languages Extends ( DL subset of) RDF DAML+OIL submitted to W3C as basis for standardisation Web-Ontology (WebOnt) Working Group formed WebOnt group developed OWL (Web Ontology Language) language based on DAML+OIL OWL language now a W3C Recommendation (latest version is OWL 2) 36

RDFS/OWL: Semantics RDFS/OWL semantics, differently from previous approaches in knowledge representation, as frame, based on constraint checking, is inferential. Given a world theory, instead of verifying that only objects of our knowledge base (instance data) satisfy constraints imposed by that theory, it is possible to add (infer) new information (rigorously monotonically, that is without retracting previous information) to the theory and/or to the description of the objects so that these are still a model for the theory RDFS/OWL Semantics: two important characteristics Open World Assumption (OWA) No Unique Name Assumption 37

38 CWA and NF The CWA (Closed World Assumption), characterizing traditional databases, and the NF (negation-as-failure), characterizing logic programming languages as Prolog, are deeply connected Given the atomic ground formula A, the CWA says that: if a knowledge base KB does not entail A, then A is false Given the atomic ground formula A, the NF says that: if it is not possible to prove A in a knowledge base KB, then A is false in that KB

39 Non Monotonicity of CWA and NF CWA and NF are naturally bound to a non-monotonic perspective on the world E.g.: a DB has only one fact: woman(marilynmonroe) and we query the following Query:?- woman(marilynmonroe). Answer:yes Query:?- man(marilynmanson) Answer:no (by using CWA/NF). we then update the DB with man(marlynmanson). Query:?- man(marlynmanson) Answer:yes

OWL Reasoning The OWL interpretation, differently from previous approaches to knowledge representation, such as frame models, based on constraint checking, is inferential. A few examples: eg:document rdf:type owl:class; rdfs:subclassof [ a owl:restriction; owl:onproperty dc:author; owl:mincardinality 1^^xsd:integer]. eg:mydoc rdf:type eg:document. The description of mydoc is not incomplete eve if the mincard for author is 1, because the author could be defined somewhere else in the world (Open World Assumption) 40

OWL Reasoning The OWL interpretation, differently from previous approaches to knowledge representation, such as frame models, based on constraint checking, is inferential. A few examples: eg:document rdf:type owl:class; rdfs:subclassof [ a owl:restriction; owl:onproperty eg:copyrightholder; owl:maxcardinality 1^^xsd:integer]. eg:mydoc rdf:type eg:document ; eg:copyrightholder eg:institute1 ; eg:copyrightholder eg:institute2. The two valus for eg:copyrighthoder raise any problem? No, there could exist two names to address the same thing, so we assume that institute1 and institute2 denote the same object 41

OWL Reasoning The OWL interpretation, differently from previous approaches to knowledge representation, such as frame models, based on constraint checking, is inferential. A few examples: eg:document rdf:type owl:class; owl:equivalentclass [a owl:restriction; owl:onproperty eg:author ; owl:allvaluesfrom eg:person ]. eg:mydoc rdf:type eg:document ; eg:author eg:daffy. eg:daffy rdf:type eg:duck. eg:mydoc2 eg:author eg:dave. eg:dave rdf:type eg:person. Duffy is inferred to be ALSO a Person (due to the assertion of equivalentclass on the restriction allvaluesfrom Person) is mydoc2 a Document? we cannot know, because in the world there could be other authors of this book that are not of type Person 42

43 Useful References RDF 1.1 Concepts and Abstract Syntax (http://www.w3.org/tr/rdf11-concepts/) RDF 1.1 N-Triples (https://www.w3.org/tr/n-triples/) RDF 1.1 Turtle (https://www.w3.org/tr/turtle/) RDF 1.1 N-Quads (https://www.w3.org/tr/n-quads/) RDF 1.1 TriG (http://www.w3.org/tr/trig/) RDF 1.1 XML Syntax (https://www.w3.org/tr/rdf-syntaxgrammar/) RDF Schema 1.1 (https://www.w3.org/tr/rdf-schema/) What s New in RDF 1.1(http://www.w3.org/TR/rdf11-new/) OWL 2 Web Ontology Language. Document Overview (Second Edition) (https://www.w3.org/tr/owl2-overview/)