RDF Tutorial.

Slides:



Advertisements
Similar presentations
1 SPARQL: A query language for RDF Matthew Yau
Advertisements

Dr. Alexandra I. Cristea CS 253: Topics in Database Systems: C3.
XML Schema Heewon Lee. Contents 1. Introduction 2. Concepts 3. Example 4. Conclusion.
W3C and RDF. Why OCLC is a W3C Member Access to networked information resources –the browser and online access –the breath and depth of networked information.
Alexandra Cristea & Matthew Yau 1.
CH-4 Ontologies, Querying and Data Integration. Introduction to RDF(S) RDF stands for Resource Description Framework. RDF is a standard for describing.
An introduction to RDF and library linked data Gordon Dunsire Presented at the Dewey Decimal Classification Executive Briefing 15 Sep 2011, London.
RDF Schemata (with apologies to the W3C, the plural is not ‘schemas’) CSCI 7818 – Web Technologies 14 November 2001 Van Lepthien.
The Semantic Web – WEEK 4: RDF
17 Apr 2002 XML Namespaces Andy Clark. The Problem Documents use different vocabularies – Example 1: CD music collection – Example 2: online order transaction.
Introduction to RDF Based on tutorial at
1 RDF Tutorial. C. Abela RDF Tutorial2 What is RDF? RDF stands for Resource Description Framework It is used for describing resources on the web Makes.
An Introduction to Semantic Web Portal
E © 2002 Dario Aganovic Resource Description Framework Schema (RDFS) Dario Aganovic Industrial PhD-student NPI Production Kista, Ericsson AB and Production.
CS570 Artificial Intelligence Semantic Web & Ontology 2
RDF – RESOURCE DESCRIPTION FRAMEWORK Antonio Bucchiarone FBK-IRST Trento, Italy 20 Novembre 2009.
1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
CSE 428 Semantic Web Topics RDF Jeff Heflin Lehigh University.
RDFa: Embedding RDF Knowledge in HTML Some content from a presentation by Ivan Herman of the W3c, Introduction to RDFa, given at the 2011 Semantic Technologies.
Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence.
The Vision and Basic Technologies of the Semantic Web.
Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Kim
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
By Ahmet Can Babaoğlu Abdurrahman Beşinci.  Suppose you want to buy a Star wars DVD having such properties;  wide-screen ( not full-screen )  the extra.
Языки описания информации Лекция ХХХ. Кафедра «ОСУ» Весенний семестр 2010/2011 уч. года RDF схемы.
Semantic Web Introduction
© Copyright IBM Corporation 2014 Getting started with Rational Engineering Lifecycle Manager queries Andy Lapping – Technical sales and solutions Joanne.
An Introduction to XML Based on the W3C XML Recommendations.
 Copyright 2004 Digital Enterprise Research Institute. All rights reserved. SPARQL Query Language for RDF presented by Cristina Feier.
SPARQL RDF Query.
The Web of data with meaning... By Michael Griffiths.
Ontology Notes are from:
Dr. Alexandra I. Cristea RDF.
RDF Kitty Turner. Current Situation there is hardly any metadata on the Web search engine sites do the equivalent of going through a library, reading.
Module 2b: Modeling Information Objects and Relationships IMT530: Organization of Information Resources Winter, 2007 Michael Crandall.
Introduction to XML This material is based heavily on the tutorial by the same name at
RDF (Resource Description Framework) Why?. XML XML is a metalanguage that allows users to define markup XML separates content and structure from formatting.
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
Introduction to SPARQL. Acknowledgements This presentation is based on the W3C Candidate Recommendation “SPARQL Query Language for RDF” from
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
CIS 375—Web App Dev II XSL. 2 XSL Introduction XSL stands for _____________________________. XSL is the language used for manipulating and displaying.
RDF – RESOURCE DESCRIPTION FRAMEWORK Antonio Bucchiarone FBK-IRST Trento, Italy 01Dicembre 2009.
Resource Description Framework (RDF) Course: Electronic Document Team member: Ding Feng Ding Wei Wang Ling Date:
Of 41 lecture 4: rdf – basics and language. of 41 RDF basic ideas the fundamental concepts of RDF  resources  properties  statements ece 720, winter.
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.
Semanntic Web Exercises. XML-exercises (1) 1.Give an XML-document (by not using attributes), which includes the information that the first name of a person.
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!
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.
XML Presented by Kushan Athukorala. 2 Agenda XML Overview Entity References Elements vs. Atributes XML Validation DTD XML Schema Linking XML and CSS XSLT.
User Profiling using Semantic Web Group members: Ashwin Somaiah Asha Stephen Charlie Sudharshan Reddy.
Dr. Alexandra I. Cristea RDF.
Problems with XML & XML Schemas XML falls apart on the Scalability design goal. 1.The order in which elements appear in an XML document is significant.
Description of Information Resources: RDF/RDFS (an Introduction)
THE BIBFRAME EDITOR AND THE LC PILOT Module 3 – Unit 1 The Semantic Web and Linked Data : a Recap of the Key Concepts Library of Congress BIBFRAME Pilot.
Dr. Bhavani Thuraisingham September 24, 2008 Building Trustworthy Semantic Webs Lecture #9: RDF and RDF Security.
Doc.: IEEE /0169r0 Submission Joe Kwak (InterDigital) Slide 1 November 2010 Slide 1 Overview of Resource Description Framework (RFD/XML) Date:
RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015.
EEL 5937 Ontologies EEL 5937 Multi Agent Systems Lotzi Bölöni.
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,
Other RDF Capabilities. Exercise: Write the following information into a set of statements (triples) and then draw them into and RDF graph The article.
Lecture 8: RDF& SPARQL Dr. Taysir Hassan A. Soliman December 13, 2015 INF411 Information Engineering Information Systems Dept. Faculty of Computers & Information.
Semantic Web In Depth Resource Description Framework 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.
SPARQL.
Resource Description Framework (RDF)
Presentation transcript:

RDF Tutorial

Introduction to RDF RDF is a framework for describing Web resources, such as the title, author, modification date, content, and copyright information of a Web page.

RDF Document Example <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:si="http://www.w3schools.com/rdf/"> <rdf:Description rdf:about="http://www.w3schools.com">   <si:title>W3Schools</si:title>   <si:author>Jan Egil Refsnes</si:author> </rdf:Description> </rdf:RDF>

What is RDF? RDF stands for Resource Description Framework RDF is a framework for describing resources on the web RDF is designed to be read and understood by computers RDF is not designed for being displayed to people RDF is written in XML RDF is a part of the W3C's Semantic Web Activity RDF is a W3C Recommendation

RDF - Examples of Use Describing properties for shopping items, such as price and availability Describing time schedules for web events Describing information about web pages (content, author, created and modified date) Describing content and rating for web pictures Describing content for search engines Describing electronic libraries

RDF is Designed to be Read by Computers RDF was designed to provide a common way to describe information so it can be read and understood by computer applications. RDF descriptions are not designed to be displayed on the web.

RDF is Written in XML RDF documents are written in XML. The XML language used by RDF is called RDF/XML. By using XML, RDF information can easily be exchanged between different types of computers using different types of operating systems and application languages.

RDF and "The Semantic Web" The RDF language is a part of the W3C's Semantic Web Activity. W3C's "Semantic Web Vision" is a future where: Web information has exact meaning Web information can be understood and processed by computers Computers can integrate information from the web

RDF is a W3C Recommendation RDF became a W3C Recommendation 10. February 2004. To read more about the RDF activities at W3C, please read our W3C tutorial.

RDF Rules RDF uses Web identifiers (URIs) to identify resources. RDF describes resources with properties and property values.

RDF Resource, Property, and Property Value RDF identifies things using Web identifiers (URIs), and describes resources with properties and property values. Explanation of Resource, Property, and Property value: A Resource is anything that can have a URI, such as "http://www.w3schools.com/rdf" A Property is a Resource that has a name, such as "author" or "homepage" A Property value is the value of a Property, such as "Jan Egil Refsnes" or "http://www.w3schools.com" (note that a property value can be another resource)

The following RDF document could describe the resource "http://www <?xml version="1.0"?> <RDF>   <Description about="http://www.w3schools.com/rdf">     <author>Jan Egil Refsnes</author>      <homepage>http://www.w3schools.com</homepage>   </Description> </RDF>

RDF Statements The combination of a Resource, a Property, and a Property value forms a Statement (known as the subject, predicate and object of a Statement). Let's look at some example statements to get a better understanding:

Statement: "The author of http://www. w3schools Statement: "The author of http://www.w3schools.com/rdf is Jan Egil Refsnes". The subject of the statement above is: http://www.w3schools.com/rdf The predicate is: author The object is: Jan Egil Refsnes

Statement: "The homepage of http://www. w3schools Statement: "The homepage of http://www.w3schools.com/rdf is http://www.w3schools.com". The subject of the statement above is: http://www.w3schools.com/rdf The predicate is: homepage The object is: http://www.w3schools.com

RDF Example Here are two records from a CD-list:

<. xml version="1. 0". > <rdf:RDF xmlns:rdf="http://www. w3 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/cd#"> <rdf:Description rdf:about="http://www.recshop.fake/cd/Empire Burlesque">   <cd:artist>Bob Dylan</cd:artist>   <cd:country>USA</cd:country>   <cd:company>Columbia</cd:company>   <cd:price>10.90</cd:price>   <cd:year>1985</cd:year> </rdf:Description> <rdf:Description rdf:about="http://www.recshop.fake/cd/Hide your heart">   <cd:artist>Bonnie Tyler</cd:artist>   <cd:country>UK</cd:country>   <cd:company>CBS Records</cd:company>   <cd:price>9.90</cd:price>   <cd:year>1988</cd:year> </rdf:Description> . . . </rdf:RDF>

The first line of the RDF document is the XML declaration. The XML declaration is followed by the root element of RDF documents: <rdf:RDF>. The xmlns:rdf namespace, specifies that elements with the rdf prefix are from the namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#".

The xmlns:cd namespace, specifies that elements with the cd prefix are from the namespace "http://www.recshop.fake/cd#". The <rdf:Description> element contains the description of the resource identified by the rdf:about attribute. The elements: <cd:artist>, <cd:country>, <cd:company>, etc. are properties of the resource.

RDF Online Validator W3C's RDF Validation Service is useful when learning RDF. Here we can experiment with RDF files. The online RDF Validator parses our RDF document, checks our syntax, and generates tabular and graphical views of our RDF document.

Copy and paste the example below into W3C's RDF validator: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:si="http://www.w3schools.com/rdf/"> <rdf:Description rdf:about="http://www.w3schools.com">   <si:title>W3Schools.com</si:title>   <si:author>Jan Egil Refsnes</si:author> </rdf:Description> </rdf:RDF>

RDF Main Elements The main elements of RDF are the root element, <RDF>, and the <Description> element, which identifies a resource.

The <rdf:RDF> Element <rdf:RDF> is the root element of an RDF document. It defines the XML document to be an RDF document. It also contains a reference to the RDF namespace: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">   ...Description goes here... </rdf:RDF>

The <rdf:Description> Element The <rdf:Description> element identifies a resource with the about attribute. The <rdf:Description> element contains elements that describe the resource:

<. xml version="1. 0". > <rdf:RDF xmlns:rdf="http://www. w3 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/cd#"> <rdf:Description rdf:about="http://www.recshop.fake/cd/Empire Burlesque">   <cd:artist>Bob Dylan</cd:artist>   <cd:country>USA</cd:country>   <cd:company>Columbia</cd:company>   <cd:price>10.90</cd:price>   <cd:year>1985</cd:year> </rdf:Description> </rdf:RDF>

The elements, artist, country, company, price, and year, are defined in the http://www.recshop.fake/cd# namespace. This namespace is outside RDF (and not a part of RDF). RDF defines only the framework. The elements, artist, country, company, price, and year, must be defined by someone else (company, organization, person, etc).

Properties as Attributes The property elements can also be defined as attributes (instead of elements):

<. xml version="1. 0". > <rdf:RDF xmlns:rdf="http://www. w3 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/cd#"> <rdf:Description rdf:about="http://www.recshop.fake/cd/Empire Burlesque" cd:artist="Bob Dylan" cd:country="USA" cd:company="Columbia" cd:price="10.90" cd:year="1985" /> </rdf:RDF>

Properties as Resources The property elements can also be defined as resources: Example (Next slide) In the example above, the property artist does not have a value, but a reference to a resource containing information about the artist.

<. xml version="1. 0". > <rdf:RDF xmlns:rdf="http://www. w3 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/cd#"> <rdf:Description rdf:about="http://www.recshop.fake/cd/Empire Burlesque">   <cd:artist rdf:resource="http://www.recshop.fake/cd/dylan" />   ...   ... </rdf:Description> </rdf:RDF>

RDF Container Elements RDF containers are used to describe group of things. The following RDF elements are used to describe groups: <Bag>, <Seq>, and <Alt>.

The <rdf:Bag> Element The <rdf:Bag> element is used to describe a list of values that does not has to be in a special order. The <rdf:Bag> element may contain duplicate values.

Example <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/cd#"> <rdf:Description rdf:about="http://www.recshop.fake/cd/Beatles">   <cd:artist>     <rdf:Bag>       <rdf:li>John</rdf:li>       <rdf:li>Paul</rdf:li>       <rdf:li>George</rdf:li>       <rdf:li>Ringo</rdf:li>     </rdf:Bag>   </cd:artist> </rdf:Description> </rdf:RDF>

Example The <rdf:Seq> Element The <rdf:Seq> element is used to describe an ordered list of values (For example, in alphabetical order). The <rdf:Seq> element may contain duplicate values.

<. xml version="1. 0". > <rdf:RDF xmlns:rdf="http://www. w3 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/cd#"> <rdf:Description rdf:about="http://www.recshop.fake/cd/Beatles">   <cd:artist>     <rdf:Seq>       <rdf:li>George</rdf:li>       <rdf:li>John</rdf:li>       <rdf:li>Paul</rdf:li>       <rdf:li>Ringo</rdf:li>     </rdf:Seq>   </cd:artist> </rdf:Description> </rdf:RDF>

Example The <rdf:Alt> Element The <rdf:Alt> element is used to describe a list of alternative values (the user can select only one of the values).

<. xml version="1. 0". > <rdf:RDF xmlns:rdf="http://www. w3 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/cd#"> <rdf:Description rdf:about="http://www.recshop.fake/cd/Beatles">   <cd:format>     <rdf:Alt>       <rdf:li>CD</rdf:li>       <rdf:li>Record</rdf:li>       <rdf:li>Tape</rdf:li>     </rdf:Alt>   </cd:format> </rdf:Description> </rdf:RDF>

In RDF these "list of values" are called members. RDF Terms In the examples above we have talked about "list of values" when describing the container elements. In RDF these "list of values" are called members. So, we have the following: A container is a resource that contains things The contained things are called members (not list of values)

RDF Collections The rdf:parseType="Collection" Attribute RDF collections describe groups that can contain ONLY the specified members. As seen in the previous chapter, a container says that the containing resources are members - it does not say that other members are not allowed. RDF collections are used to describe groups that can contains ONLY the specified members. A collection is described by the attribute rdf:parseType="Collection".

<. xml version="1. 0". > <rdf:RDF xmlns:rdf="http://www. w3 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://recshop.fake/cd#"> <rdf:Description rdf:about="http://recshop.fake/cd/Beatles">   <cd:artist rdf:parseType="Collection">     <rdf:Description rdf:about="http://recshop.fake/cd/Beatles/George"/>     <rdf:Description rdf:about="http://recshop.fake/cd/Beatles/John"/>     <rdf:Description rdf:about="http://recshop.fake/cd/Beatles/Paul"/>     <rdf:Description rdf:about="http://recshop.fake/cd/Beatles/Ringo"/>   </cd:artist> </rdf:Description> </rdf:RDF>

RDF Schema (RDFS) RDF Schema and Application Classes RDF Schema (RDFS) is an extension to RDF. RDF describes resources with classes, properties, and values. In addition, RDF also need a way to define application-specific classes and properties. Application-specific classes and properties must be defined using extensions to RDF. One such extension is RDF Schema.

RDF Schema (RDFS) RDF Schema does not provide actual application-specific classes and properties. Instead RDF Schema provides the framework to describe application-specific classes and properties. Classes in RDF Schema is much like classes in object oriented programming languages. This allows resources to be defined as instances of classes, and subclasses of classes.

<. xml version="1. 0". > <rdf:RDF xmlns:rdf="http://www. w3 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xml:base="http://www.animals.fake/animals#"> <rdf:Description rdf:ID="animal">   <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> </rdf:Description> <rdf:Description rdf:ID="horse">   <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>   <rdfs:subClassOf rdf:resource="#animal"/> </rdf:Description> </rdf:RDF>

Example Abbreviated In the example above, the resource "horse" is a subclass of the class "animal". Since an RDFS class is an RDF resource we can abbreviate the example above by using rdfs:Class instead of rdf:Description, and drop the rdf:type information:

<. xml version="1. 0". > <rdf:RDF xmlns:rdf="http://www. w3 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xml:base="http://www.animals.fake/animals#"> <rdfs:Class rdf:ID="animal" /> <rdfs:Class rdf:ID="horse">   <rdfs:subClassOf rdf:resource="#animal"/> </rdfs:Class> </rdf:RDF>

The RDF Namespaces The RDF namespace (xmlns:rdf) is: http://www.w3.org/1999/02/22-rdf-syntax-ns# The RDFS namespace (xmlns:rdfs ) is: http://www.w3.org/2000/01/rdf-schema#

The RDF Extension and MIME Type The recommended file extension for RDF files is .rdf. However, the extension .xml is often used to provide compatibility with old xml parsers. The MIME type should be "application/rdf+xml".

RDFS / RDF Classes

Examples: It says that "Joe Smith has homepage http://www.example.org/~joe". All elements of this triple are resources defined by URI. The first resource http://www.example.org/~joe/contact.rdf#joesmith (subject) is intended to identify Joe Smith.

Note that it precisely defines how to get to a RDF document as well as how to get the joesmith RDF node in it. The second resource http://xmlns.com/foaf/0.1/homepage (predicate) is the predicate homepage from a FOAF (Friend-of-a-friend) vocabulary. The last resource (object) is Joe's homepage http://www.example.org/~joe/.

An example of literal usage is illustrated in the triple shown in the figure below. RDF triple (in graph representation) describing Joe Smith - "Joe has family name Smith"

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns="http://www.example.org/~joe/contact.rdf#"> <foaf:Person rdf:about= "http://www.example.org/~joe/contact.rdf#joesmith"> <foaf:mbox rdf:resource="mailto:joe.smith@example.org"/> <foaf:homepage rdf:resource="http://www.example.org/~joe/"/> <foaf:family_name>Smith</foaf:family_name> <foaf:givenname>Joe</foaf:givenname> </foaf:Person> </rdf:RDF>

RDF Query Language SPARQL The Simple Protocol and RDF Query Language (SPARQL) is a SQL-like language for querying RDF data. For expressing RDF graphs in the matching part of the query, TURTLE syntax is used.

An example of a SELECT query follows. PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?mbox WHERE { ?x foaf:name ?name . ?x foaf:mbox ?mbox . }

The first line defines namespace prefix, the last two lines use the prefix to express a RDF graph to be matched. Identifiers beginning with question mark ? identify variables. In this query, we are looking for resource ?x participating in triples with predicates foaf:name and foaf:mbox and want the subjects of these triples. Syntactic shortcuts of TURTLE can be used in the matching part.