RDF. Charlie Abela Department of Artificial Intelligence

Similar documents
RDF. Mario Arrigoni Neri

RDF(S) Resource Description Framework (Schema)

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

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

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

Chapter 3 RDF Syntax

Semantic Web Technologies

Semantic Web Technologies: RDF + RDFS

SEMANTIC WEB 04 RDF SYNTAX TURTLE, RDF/XML, N-TRIPLES, N3 IMRAN IHSAN ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD

Contents. RDF Resource Description Framework. A Graph Model for KR

The Resource Description Framework and its Schema

Semantic Web Engineering

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

An RDF-based Distributed Expert System

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

Linking Data with RDF

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

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

Part II. Representation of Meta-Information

RDF/XML: RDF Data on the Web

Chapter 13: Advanced topic 3 Web 3.0

Resource Description Framework (RDF)

RDF. Dr. Mustafa Jarrar. Knowledge Engineering (SCOM7348) University of Birzeit

Modify the following XML document so that it is also a valid RDF document:

a paradigm for the Semantic Web RDF Data Model Angelica Lo Duca IIT-CNR Linked Open Data:

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

RDF Schema. Mario Arrigoni Neri

Semantic Web Knowledge Representation in the Web Context. CS 431 March 24, 2008 Carl Lagoze Cornell University

The SBML Level 3 Annotation package: an initial proposal

Semistructured Data Management Part 3 (Towards the) Semantic Web

The Semantic Web. INF5100 Autumn 2007 Norun C. Sanderson

Today s Plan. INF3580 Semantic Technology Spring Outline. My lectures. Lecture 2: RDF, The Resource Description Framework.

Web Sémantique TD 1 - RDF

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

RDF AND SPARQL. Part I: Basics of RDF. Dresden, August Sebastian Rudolph ICCL Summer School

Semantic Days 2011 Tutorial Semantic Web Technologies

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

RDF and RDF Schema. Resource Description Framework

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

RDF Schema Sebastian Rudolph

RESOURCES DESCRIPTION FRAMEWORK: RDF

SEMANTIC WEB 03 RDF DATA MODEL RESOURCE DESCRIPTION FRAMEWORK IMRAN IHSAN ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD

RDF Schema Sebastian Rudolph

Knowledge Representation for the Semantic Web

Transforming Data from into DataPile RDF Structure into RDF

XML-Based Syntax of RDF

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

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

2. Knowledge Representation Applied Artificial Intelligence

RDF Graph Data Model

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

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

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

Semantic Web Technologies: Web Ontology Language

Ontological Modeling: Part 2

RDF /RDF-S Providing Framework Support to OWL Ontologies

CS Knowledge Representation and Reasoning (for the Semantic Web)

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

11 The Semantic Web. Knowledge-Based Systems and Deductive Databases Knowledge Representation Knowledge Representation

INFO216: Advanced Modelling

Applications and Technologies on top of XML. Semantic Web - RDF. Extensible Markup Language (XML) Revisited. Outline

Graphic technology Extensible metadata platform (XMP) Part 2: Description of XMP schemas using RELAX NG

Semantic Web Modeling Languages Part I: RDF

Semantic Web Fundamentals

Multi-agent and Semantic Web Systems: Querying

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

Analysis Data Transfer Framework "ORIENT" Specification

Semistructured Data Management Part 3 (Towards the) Semantic Web

CS Knowledge Representation and Reasoning (for the Semantic Web)

Knowledge Representation for the Semantic Web

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

RDFS. Suresh Manandhar* & Dimitar Kazakov

A Technique for Automatic Construction of Ontology from Existing Database to Facilitate Semantic Web

Web 2.0 Lecture 8: Resource Description Framework

Answers for Practice Number 3

Semistructured Data Management Part 3 (Towards the) Semantic Web

Chapter 3. RDF Schema

RSS - VERSION 1.0 TAGS AND SYNTAX

Advanced Studies in IT CT433

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

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

JENA: A Java API for Ontology Management

2. RDF Semantic Web Basics Semantic Web

Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Wednesday 23rd May 2018 Time: 14:00-16:00. Please answer all Questions.

Semantic Web Languages

A Novel Approach for Accurate Retrieval of Video using Semantic Annotations

RDF Semantics A graph-based approach

University of Crete of Computer Science CS Internet Knowledge Management. BibTeX In OWL. Kartsonakis Efthimis Kriara Lito Papadakis Giannis

Harvesting RDF triples

University of Dublin Trinity College. Resource Description Framework (RDF) Melike Şah Direkoğlu

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

Querying the Semantic Web

Bachelorarbeit. Übersetzung von Aktionen auf semantischer Ebene in einem RDF Web Service

RDF and RDF Schema. Raúl García Castro, Óscar Corcho. Boris

FIPA RDF Content Language Specification

Resource Description Framework (RDF) Nicholas Gibbins and Nigel Shadbolt

RDF The basis of the. Semantic Web CHAPTER CHAPTER OUTLINE

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

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

ISO/TS TECHNICAL SPECIFICATION

Transcription:

RDF Charlie Abela Department of Artificial Intelligence charlie.abela@um.edu.mt

Last Lecture Introduced XPath and XQuery as languages that allow for accessing and extracting node information from XML Problems?

Lecture Outline Introduction to RDF Basic building blocks: resources Different notations for RDF Triples Graphs RDF/XML Reification Some examples Exercises

Moving up the layers

Scenario Jim s searching experience over the Web is not brilliant It gets really frustrating at times when he needs to find relevant information AARRRGGHH.

Scenario (2) Jim s colleague John has recently started using an application called PEA (Personal Assistant) PEA can learn about the user s interests and is able to help out John in many tasks. During its learning process PEA implicitly gathers information about John s interests John is interested in music John keeps a favourites list of song titles

Scenario (3) After some time observing John s behaviour PEA has gathered some facts: John has a list of favourite songs List of favourite songs is ranked according to John s preferences John s favourite song is I Feel Good James Brown sings I Feel Good I Feel Good is a song A song has lyrics John is an instance of a Person James Brown is an instance of a Person I Feel Good video is found at http://www.youtube.com/watch?v=iwcniebyguo

Scenario (4) http://www.singerinfo.com/singers #singer "Mr.Dynamite" http://www.w3.org/2001/vcard-rdf/3.0#nickname http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.favsongs.com/singers #sngr005 http://www.w3.org/2001/vcard-rdf/3.0#name "James Brown" http://www.singerinfo.com/singers#interprets http://www.songinfo.com/songs #song http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.favsongs.com/singers #sng023 http://www.songinfo.org/songs#title http://www.songinfo.com/songs#video "I Feel Good" http://www.songinfo.com/songs#lyricsurl http://www.youtube.com/watch? v=iwcniebyguo http://www.funky-stuff.com/jame sbrown/lyrics/ifeelgood.htm

RDF Introduction Resource Description Framework is a language whose main intent is to provide a common framework for expressing machine-processable information Through RDF it is possible to represent both physically accessible entities, as well as abstract entities (i.e. those that cannot be retrieved) physical entity: a person s Web page abstract entity: the resource pointing to information about the person himself It also facilitates information exchange between different applications

RDF: The Basics Basic building block: <object attribute value> triple It is called a statement Sentence: Dan Brown is the author of the Da Vinci Code is such a statement Object: Dan Brown Attribute: authorof Value: Da Vinci Code RDF has been given an XML syntax This syntax inherits the benefits of XML Other syntactic representations of RDF are possible N3 (Notation 3): short hand, however less popular then XML version

RDF: The Basics (2) The fundamental components of RDF are: Resources: anything defined through a URI http://www.category.com/authors#dan_brown Properties: resources that describe a relation books:authorof (authorof relation defined in books domain) essentially binary relations Statements: assign a value to a property associated with a specific resource <#auth1102 books:authorof Da Vinci Code >

Resources We can think of a resource as an object, a thing we want to talk about (i.e. has an identity) E.g. authors, books, publishers, places, people, hotels Every resource (physical or abstract) has a URI, a Universal Resource Identifier A URI can be a URL (Web address) http://www.bookresource.com/pub/books.html some other kind of unique identifier #book102 (references a unique book resource)

Properties Properties are special kinds of resources They describe relations between resources E.g. written_by, age, title, etc. Properties are also identified by URIs authorof relation used in association with a book resource <books:authorof rdf:resource= #book102 />

Statements RDF statements assert the properties of resources Values can be resources or literals Literals are atomic values (strings) Three views of an RDF statement as a triple as a directed graph as RDF/XML serialisation

Example: As a Triple <#auth1102 books:authorof Da Vinci Code > subject resource property resource object value The triple (x,p,y) can be considered as a logical formula P(x,y) Binary predicate P relates object x to object y RDF offers only binary predicates (properties) Any n-ary relation in RDF has to be converted into a set of binary relations

Example: As a Graph A directed graph with labeled nodes and arcs from the resource (the subject of the statement) to the value (the object of the statement) Known in AI as a semantic net http://www.bookstore.com/books#auth1102 #auth1102 http://www.authorsinfo.com/authors#name http://www.booksinfo.com/books#authorof "Dan Brown" "Da Vinci Code"

RDF/XML An RDF document is represented by an XML element with the tag rdf:rdf The content of this element is a number of descriptions, which use rdf:description tags. Every description makes a statement about a resource, usually identified in 2 ways: an about attribute, referencing an existing description an ID attribute, creating a new description <rdf:description rdf:about="#auth1102">

RDF/XML (2) The rdf:description element makes a statement about the resource auth1102 Within the description the property is used as a tag the content is the value of the property <authors:name>dan Brown</authors:name> property value

Example: RDF/XML <rdf:rdf xmlns:rdf= http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:xsd= http://www.w3.org/2001/xmlschema# xmlns:books= http://www.booksinfo.com/books# xmlns:authors= http://www.authorsinfo.org/authors# > <rdf:description rdf:id="auth1102"> <authors:name>dan Brown</authors:name> <books:authorof rdf:resource= #book102 /> </rdf:description> QName </rdf:rdf>

Concise representation <!DOCTYPE rdf:rdf [ <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#"> <!ENTITY xsd "http://www.w3.org/2001/xmlschema#"> <!ENTITY books http://www.booksinfo.org/books# > <!ENTITY authors http://www.authorsinfo.org/authors# > ]> <rdf:rdf xmlns:rdf ="&rdf;" xmlns:rdfs="&rdfs;" xmlns:xsd="&xsd; xmlns:authors= &authors; xmlns:books= &books; > <rdf:description rdf:id="auth1102"> <authors:name>danbrown</authors:name> <books:authorof rdf:resource= #book102 /> </rdf:description>

XML Schema data types In RDF, typed literals can be used Usually through the use of XML Schema In which case the XML Schema namespace has to be declared in the namespace block <rdf:description rdf:id= auth1102 > <authors:name rdf:datatype= &xsd;string >Dan Brown </authors:name> <books:authorof rdf:resource= #book102 /> <authors:dob rdf:datatype= &xsd;string >22/06/1964 </authors:dob> </rdf:description>

Using rdf:type Declare a statement which formally defines a description <rdf:description rdf:id= auth1102 > <rdf:type rdf:resource= &authors;author /> <authors:name rdf:datatype= &xsd;string >Dan Brown</authors:name> <books:authorof rdf:resource= #book102 /> <authors:dob rdf:datatype= &xsd;string >22/06/1964</authors:dob> </rdf:description> Declares auth1102 to be of type author (itself defined in the authors vocabulary)

Bookstore.rdf <rdf:rdf xmlns:rdf= &rdf; xmlns:xsd= &xsd; xmlns:books= &books; xmlns:authors= &authors; > <rdf:description rdf:id= book102 > <books:title rdf:datatype= &xsd;string >Da Vinci Code</books:title> <books:isbn rdf:datatype= &xsd;string >978-0385504201</books:ISBN> </rdf:description> <rdf:description rdf:id= auth1102 > <rdf:type rdf:resource= &authors;author /> <authors:name rdf:datatype= &xsd;string >Dan Brown</authors:name> <books:authorof rdf:resource= #book102 /> <authors:dob rdf:datatype= &xsd;string >22/06/1964</authors:dob> </rdf:description> </rdf:rdf>

XML Vs RDF <book ID= book102 > <author ID= auth1102 name= Dan Brown /> <title name= Da Vinci Code /> <ISBN>978-0385504201</ISBN> </book> XML RDF/XML <rdf:description rdf:id= book102 > <books:title>da Vinci Code</books:title> <books:isbn>978-0385504201</books:isbn> </rdf:description> <rdf:description rdf:id= auth1102 > <authors:name>dan Brown</authors:name> <books:authorof rdf:resource= #book102 /> </rdf:description>

XML vs RDF II book ID book102 author title ISBN ID name name 978-0385504201 auth1102 Dan Brown Da Vinci Code

XML vs RDF III Da Vinci Code http://www.booksinfo.com/books#title http://www.bookstore.com/books#book102 http://www.booksinfo.com/books#isbn http://www.authorsinfo.org/authors#authorof 978-0385504201 http://www.bookstore.com/books#auth1102 http://www.authorsinfo.org/authors#dob http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.authorsinfo.org/authors#name 22/06/64 authors:author Dan Brown

Container Elements Collections of resources or attributes can be defined within a container element. RDF provides three types of containers: rdf:bag an unordered container, may contain multiple occurrences rdf:seq an order container, may contain multiple occurrences rdf:alt a set of alternatives

Container Elements: Bag Dan Brown is the author of three books (defined elsewhere), order of publication is not important <rdf:description rdf:id= auth1102 > <authors:name>dan Brown</authors:name> <books:authorof> <rdf:bag> <rdf:li rdf:resource= #book106 /> <rdf:li rdf:resource= #book102 /> <rdf:li rdf:resource= #book103 /> </rdf:bag> </books:authorof> </rdf:description>

Container Elements: Seq However if its needed to specify that authorof specifies ordering information (e.g. based on publication dates) <rdf:description rdf:id= auth1102 > <authors:name>dan Brown</authors:name> <books:authorof> <rdf:seq> <rdf:li rdf:resource= #book102 /> <rdf:li rdf:resource= #book103 /> <rdf:li rdf:resource= #book106 /> </rdf:seq> </books:authorof> </rdf:description>

Container Elements: Alt Alt implies a list of alternatives from which only one can be chosen <rdf:description rdf:id= book102 > <books:title>da Vinci Code</books:title> <books:isbn>978-0385504201</books:isbn> <book:language> <rdf:alt> <rdf:li>engdoc</rdf:li> <rdf:li>mtdoc</rdf:li> </rdf:alt> </book:language> </rdf:description>

Closed container If we need to specify that the listed resources are ALL the members of the container we need to use the List structure <books:authorof> <rdf:list> <rdf:first> <rdf:description rdf:about= #book103 /> </rdf:first> <rdf:rest> <rdf:list> <rdf:first <rdf:description rdf:about= #book102 /> </rdf:first> <rdf:rest> <rdf:description rdf:about= &rdf;nil /> </rdf:rest> </rdf:list> </rdf:rest> </rdf:list> </books:authorof>

Closed collection A shorthand syntax for a closed collection exists <rdf:description rdf:id= auth1102 > <authors:name>dan Brown</authors:name> <books:authorof rdf:parsetype= Collection > <rdf:description rdf:about= #book103 /> <rdf:description rdf:about= #book102 /> <books:authorof> </rdf:description>

Reification in RDF In RDF it is possible to make statements about statements <rdf:description rdf:id= auth1102 > <authors:name rdf:datatype= &xsd;string >DanBrown</authors:name> </rdf:description> Reifies as: <rdf:statement rdf:id= auth102_s1 > <rdf:subject rdf:resource= #auth1102 /> <rdf:predicate rdf:resource= &authors;name /> <rdf:object rdf:datatype= &xsd;string >DanBrown</rdf:object> </rdf:statement> The four statements are sometimes referred to as a "reification quad" for this reason.

Reification Graph (1) http://www.bookstore.com/books#auth1102 http://www.w3.org/1999/02/22-rdf-syntax-ns#subject http://www.bookstore.com/books#auth1102_s1 http://www.w3.org/1999/02/22-rdf-syntax-ns#object http://www.w3.org/1999/02/22-rdf-syntax-ns#type Dan Brown http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#statement authors:name

Use of Reification Reification can be used to declare the provenance of a particular statement E.g.: suppose that for the bookstore catalogue its important to verify who entered the data about authors Through reification its possible to say: <rdf:description rdf:id= john_01 > <dc:creator rdf:resource= #auth102_s1"/> </rdf:description> <rdf:statement rdf:id= auth102_s1 > <rdf:subject rdf:resource= #auth1102 /> <rdf:predicate rdf:resource= &authors;name /> <rdf:object rdf:datatype= &xsd;string >DanBrown</rdf:object> </rdf:statement>

Reification Example Graph (2) http://www.bookstore.com/books #john_01 Dan Brown http://purl.org/dc/elements/1.1/creator http://www.w3.org/1999/02/22-rdf-syntax-ns#object http://www.bookstore.com/books# auth102_s1 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate http://www.w3.org/1999/02/22-rdf-s yntax-ns#statement http://www.w3.org/1999/02/22-rdf-syntax-ns#subject authors:name http://www.bookstore.com/books#auth1102

Reification Problems To reify one RDF statement, four additional statements are needed. Leads to an explosion in the number or RDF statements.

Use of RDF: Describe Bookmarks <rdf:description rdf:nodeid= bk001 > <rdf:type rdf:resource= &bookmarks;bookmark /> <bookmarks:url rdf:resource= http://news.google.com/ /> <bookmarks:date rdf:datatype= &xsd;date >12/12/07</bookmarks:date> <bookmarks:query rdf:datatype= &xsd;string >news + google </bookmarks:query> <bookmarks:title rdf:datatype= &xsd;string >Google News </bookmarks:title> <bookmarks:category rdf:datatype= &xsd;string >News</bookmarks:category> </rdf:description> rdf:nodeid is used to indicate an anonymous node

Use of RDF: Describe a Process <rdf:description rdf:nodeid= proces001 > <rdf:type rdf:resource= &process;sysprocess /> <process:name rdf:datatype= &xsd;string >lsass</process:name> <process:ext rdf:datatype= &xsd;string >exe</process:ext> <process:folder>system32</process:folder> <process:version>5.1.2600.2180</process:version> <process:company>microsoft Corporation</process:company> </rdf:description>

Exercises Write the following statements in RDF and draw the associated graphs (use any required namespaces) The library is located in Bremen The book with title Artificial Intelligence and ISBN 978-123458 is written by the author Henry Wise The author William Start wrote the books with titles Modern Web Services and Theory of Computation The email address of lecturer John Brown is john.brown@widget.org Lecturer John Brown has an office in the Department of AI. The office is situated on the 2 nd floor of the Computer Building. Write RDF statements about a catalogue of products. Each catalogue has an ID and a description and consists of a list of products Each product is associated with a department and has a product ID and a description Multiple products may be associated with the same department