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

Similar documents
RDF. Charlie Abela Department of Artificial Intelligence

RDF. Mario Arrigoni Neri

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

Semantic Web Technologies

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

RDF(S) Resource Description Framework (Schema)

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

Semantic Web Engineering

Semantic Web Technologies: RDF + RDFS

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

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

Resource Description Framework (RDF)

The Resource Description Framework and its Schema

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

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

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

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

Chapter 3 RDF Syntax

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

Semantic Web Languages

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

Part II. Representation of Meta-Information

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

Semantic Days 2011 Tutorial Semantic Web Technologies

RDFS. Suresh Manandhar* & Dimitar Kazakov

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

RESOURCES DESCRIPTION FRAMEWORK: RDF

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

An RDF-based Distributed Expert System

RDF and RDF Schema. Resource Description Framework

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

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

INFO216: Advanced Modelling

The Semantic Web. INF5100 Autumn 2007 Norun C. Sanderson

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

CS Knowledge Representation and Reasoning (for the Semantic Web)

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

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

RDF Schema Sebastian Rudolph

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

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

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

RDF Schema Sebastian Rudolph

Chapter 3. RDF Schema

Semistructured Data Management Part 3 (Towards the) Semantic Web

Advanced Studies in IT CT433

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

Web 2.0 Lecture 8: Resource Description Framework

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

Web Sémantique TD 1 - RDF

FIPA RDF Content Language Specification

RDF Semantics A graph-based approach

XML-Based Syntax of RDF

Semantic Web Modeling Languages Part I: RDF

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

CS Knowledge Representation and Reasoning (for the Semantic Web)

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

Analysis Data Transfer Framework "ORIENT" Specification

Knowledge Representation for the Semantic Web

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

BUILDING THE SEMANTIC WEB

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

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

What's New in RDF 1.1

Knowledge Representation for the Semantic Web

RDF Graph Data Model

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

Semantic Web Fundamentals

2. RDF Semantic Web Basics Semantic Web

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

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

SWAD-Europe Deliverable 8.1 Core RDF Vocabularies for Thesauri

Semantic Information Retrieval: An Ontology and RDFbased

Transforming Data from into DataPile RDF Structure into RDF

RDF /RDF-S Providing Framework Support to OWL Ontologies

Chapter 13: Advanced topic 3 Web 3.0

RDF Schema. Mario Arrigoni Neri

RDF* and SPARQL* An Alternative Approach to Statement-Level Metadata in RDF

Resource Description Framework (RDF) Nicholas Gibbins and Nigel Shadbolt

Harvesting RDF triples

Open Geospatial Consortium Inc.

Efficient Management and Querying of RDF data in a P2P Framework

Ontological Modeling: Part 2

Chapter 2 Technical Background. Materializing the Web of Linked Data

Semistructured Data Management Part 3 (Towards the) Semantic Web

The RDF layer. Riccardo Rosati. Knowledge Representation and Semantic Technologies

TRIPLE An RDF Query, Inference, and Transformation Language

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

Multi-agent and Semantic Web Systems: RDF Data Structures

Describing Structure and Semantics of Graphs Using an RDF Vocabulary

Linking Data with RDF

User and Reference Manual

Semantic Agent Programming Language: use and formalization.

Semantic Web. Web Dynamics. Dr. Marc Spaniol. Saarbrücken, July 15, Semantic Web. Dr. Marc Spaniol. MPII-Sp /71

A Fuzzy Semantics for the Resource Description Framework

Knowledge Representation RDF Turtle Namespace

Enabling Semantic Web Programming by Integrating RDF and Common Lisp

RSS - VERSION 1.0 TAGS AND SYNTAX

Semistructured Data Management Part 3 (Towards the) Semantic Web

Transcription:

Contents RDF Resource Description Framework G. Falquet 2014 The RDF graph model RDF in XML and N3 Blank nodes Representing collections Adding some structure: RDF schemas Classes, subclasses, properties, subproperties The RDFS meta schema Reification Université*de*Genève*.*G.*Falquet* RDF* 1* Université*de*Genève*.*G.*Falquet* RDF* 2* A Graph Model for KR RDF graphs express knowledge about resources a resource is anything that can be identified (a web page, a person, a country, an abstraction,...) The basic unit of knowledge is the triple (subject, predicate, object) It represents the fact that a relation (predicate) holds between the subject and the object. (Geneva population "312445") The population of Geneva is 312445 (Geneva neighbour Vaud) Geneva has a neighbour Vaud (Vaud official-language french) The official language of Vaud is French Université*de*Genève*.*G.*Falquet* RDF* 3* Université*de*Genève*.*G.*Falquet* RDF* 4*

Triples are Graph Edges (Geneva population "312445") (Geneva neighbour Vaud) (Vaud official-language french) Concrete resources Resources are represented by their Uniform Resource Identifier (URI) http://cui.unige.ch http://www.unige.ch/icle/projects/nzr.html mailto://hk@jmail.me Geneva* populagon* "466536"* not necessarily web documents neighbour* A RDF graph can refer to any resource Vaud* official.language* french* Université*de*Genève*.*G.*Falquet* RDF* 5* Université*de*Genève*.*G.*Falquet* RDF* 6* Example concretized Using prefixes to create compact URIs hip://cui.unige.ch/sw.course/populagon* hip://cui.unige.ch/sw.course/geneva* "466536"* hip://cui.unige.ch/sw.course/neighbour* prefix*sw:*hip://cui.unige.ch/sw.course/* prefix*iso:*hip://id.loc.gov/vocabulary/iso639.2/* sw:geneva* sw:neighbour* sw:populagon* "466536"* hip://cui.unige.ch/sw.course/vaud* sw:vaud* hip://ntx.gov/schema/official.language* hip://ntx.gov/schema/official.language* hip://id.loc.gov/vocabulary/ iso639.2/fra* iso:fra* Université*de*Genève*.*G.*Falquet* RDF* 7* Université*de*Genève*.*G.*Falquet* RDF* 8*

Literals Examples A lexical form that identifies a value in a value space prefix xsd: http://www.w3c.org/2001/xmlschema strings "value" string in a specific language "value"@language typed value "value"^^type "Scrabble" "vi povas legi ĉi tiun tekston"@eo "567"^^xsd:number "true"^^xsd:boolean "2002-10-10T12:00:00+02:00"^^xsd:dateTime XML builtin datatypes are of common use, but not mandatory prefix my: http://cui.unige.ch/typesystem "4.5+3i+2j-5k"^^my:quaternion Université*de*Genève*.*G.*Falquet* RDF* 9* Université*de*Genève*.*G.*Falquet* RDF* 10* Exercises Remark. A literal may not be the subject of a triple (values cannot be described, they are supposed to be known) Forbidden* OK* "86477"* the*set*of*all* prime*numbers* is**a*prime*number* contains* contains* "86477"* "yes"* 1. Draw an RDF graph that represents the following situation Bob has a cat. The name of this cat is Felix and he is 6 years old. Felix has two friends: Tiger and Einstein. 2. Add the facts Bob is married with Alice since 2008-08-01 Bob has two other cats contains* "1111111111111111111"* "17"* Université*de*Genève*.*G.*Falquet* RDF* 11* Université*de*Genève*.*G.*Falquet* RDF* 12*

Practical syntax for RDF How to represent a RDF graph with characters (in a text file) RDF data can be expressed with different notations XML (for machine interchange) N3 and Turtle (human readable) XML Syntax Principle: there are node elements and property elements <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns" xmlns:sw="http://cui.unige.ch/sw-course/"> <rdf:description rdf:about="http://cui.unige.ch/sw-course/geneva"> <sw:population>466536</sw:population> <sw:neighbour> <rdf:description rdf:about="http://cui.unige.ch/sw-course/vaud"> </sw:neighbour>... </rdf:rdf> Université*de*Genève*.*G.*Falquet* RDF* 13* Université*de*Genève*.*G.*Falquet* RDF* 14* N3 notation An N3 file has 1. prefix definitions 2. triples or abbreviated triples @prefix sw: <http://cui.unige.ch/sw-course/>. @prefix xsd: <http://www.w3c.org/2001/xmlschema>. sw:geneva sw:population "466536"^^xsd:integer. sw:geneva sw:neighbour sw:vaud. sw:vaud sw:official-language <http://id.loc.gov/vocabulary/iso639-2/ fra>. Abbreviations subject pred 1 obj 1 ; pred 2 obj 2 ;... ; pred n obj n. for subject pred 1 obj 1. subject pred 2 obj 2..... subject pred n obj n. sw:geneva sw:population "466536"^^xsd:integer ; sw:neighbour sw:vaud. Université*de*Genève*.*G.*Falquet* RDF* 15* Université*de*Genève*.*G.*Falquet* RDF* 16*

Abbreviations subject predicate obj 1, obj 2,..., obj n. for subject predicate obj 1. subject predicate obj 2..... subject predicate obj n. Blank nodes Nodes that are anonymous, not identified by a URI Only locally identified "The address of Armand is 23 chemin des Anaphores, Lausanne" sw:armand* sw:vaud sw:neighbour sw:geneva, sw:fribourg, sw:valais, sw:neuchatel, sw:bern. sw:address* sw:city* sw:street* sw:street.no* "23"^^xsd:integer* sw:lausanne* "chemin*des* Anaphores"* Université*de*Genève*.*G.*Falquet* RDF* 17* Université*de*Genève*.*G.*Falquet* RDF* 18* In N3, with the _: prefix @prefix sw: <http://cui.unige.ch/sw-course/>. @prefix xsd: <http://www.w3c.org/2001/xmlschema>. sw:armand sw:address _:aa. _:aa sw:street "chemin des Anaphores". _:aa sw:street-no "23"^^xsd:integer. _:aa sw:city sw:lausanne. _:aa acts like an internal variable, within the RDF file/graph. It is invisible from the outside (no URI). Possible abbreviation: sw:armand sw:address [sw:street "chemin des Anaphores" ; sw:street-no "23"^^xsd:integer ; sw:city sw:lausanne]. In XML: nodeid instead of about <rdf:description rdf:about="http://sw.unige.ch/armand" <sw:address rdf:nodeid="abc"/> <rdf:description rdf:nodeid="abc"> <sw:street>chemin des Anaphores </sw:street> <sw:street-no rdf:datatype="http://www.w3.org/2001/xmlschemaint> 23 </sw:street-no> <sw:city> <rdf:description about="http://sw.unige.ch/lausanne" /> </sw:city> Université*de*Genève*.*G.*Falquet* RDF* 19* Université*de*Genève*.*G.*Falquet* RDF* 20*

Graph equivalence The internal identifiers of blank node are interchangeable Two RDF graphs have the same meaning if their only differences are the blank node identifiers. x:b* x:p* x:a* sw:k* x:p* x:q* :h* x:q2* x:r* x:s* :q* "hello"* x:a* x:p* :hop* x:q* sw:k* x:r* x:s* x:q2* x:p* "hello"* :zz* x:b* Graph equivalence The official definition Two RDF graphs G and G' are equivalent if there is a bijection M between the sets of nodes of the two graphs, such that: M maps blank nodes to blank nodes. M(lit)=lit for all RDF literals lit which are nodes of G. M(uri)=uri for all RDF URI references uri which are nodes of G. The triple ( s, p, o ) is in G if and only if the triple (M(s), p, M(o)) is in G' In fact, M shows how each blank node in G can be replaced with a new blank node to give G'. Université*de*Genève*.*G.*Falquet* RDF* 21* Université*de*Genève*.*G.*Falquet* RDF* 22* RDF standard vocabuary A standard vocabulary for defining resource typing data structures (containers and collections) RDF graph schemas resource classification (schemas) constraints on properties This vocabulary has URIs of the form http://www.w3.org/1999/02/22-rdf-syntax-nsname the usual prefix definition is @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns> rdf:type Assign a type to a resource Felix is a cat and Joe is a mouse ex:felix rdf:type ex:cat ex:joe rdf:type ex:mouse My car is red (a set-theoretical view) ex:mycar rdf:type ex:redthings ex:mycar ex:color "red" (generally a better choice) Université*de*Genève*.*G.*Falquet* RDF* 23* Université*de*Genève*.*G.*Falquet* RDF* 24*

Containers To consider a group of resources as a whole assign global properties to the group Three types of containers rdf:bag (a set with repetitions) rdf:seq (an ordered set) rdf:alt (represents choices) Properties rdf:_1, rdf:_2, rdf:_3,... to link a container with its first, second, third,... member. hip://www.w3.org/tr/2004/rec.rdf.primer.20040210/collecgons* Université*de*Genève*.*G.*Falquet* RDF* 25* Université*de*Genève*.*G.*Falquet* RDF* 26* RDF/XML (abbreviation) <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns" xmlns:s="http://example.org/students/vocab"> <rdf:description rdf:about="http://example.org/courses/6.001"> <s:students> <rdf:bag> <rdf:li rdf:resource="http://example.org/students/amy"/> <rdf:li rdf:resource="http://example.org/students/mohamed"/> <rdf:li rdf:resource="http://example.org/students/johann"/> <rdf:li rdf:resource="http://example.org/students/maria"/> <rdf:li rdf:resource="http://example.org/students/phuong"/> </rdf:bag> </s:students> </rdf:rdf> Remarks Bag, Seq, Alt are indications about the intended meaning There is not specific way to "close" a container, i.e. to say that is doesn't have any other member. the Bag of students in the previous example may have more than 5 members, in reality Université*de*Genève*.*G.*Falquet* RDF* 27* Université*de*Genève*.*G.*Falquet* RDF* 28*

Collections Closed collections: all the members are known Use the first/rest representation technique: A collection is made of a first element (any resource) a rest, which is a collection rdf:nil is the empty collection hip://www.w3.org/tr/2004/rec.rdf.primer.20040210/collecgons* Université*de*Genève*.*G.*Falquet* RDF* 29* Université*de*Genève*.*G.*Falquet* RDF* 30* in RDF/XML in N3 <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns" xmlns:s="http://example.org/students/vocab"> <rdf:description rdf:about="http://example.org/courses/6.001"> <s:students rdf:parsetype="collection"> <rdf:description rdf:about="http://example.org/students/amy"/> <rdf:description rdf:about="http://example.org/students/mohamed"/> <rdf:description rdf:about="http://example.org/students/johann"/> </s:students> </rdf:rdf> ( object1 object2 ) is short for: [ rdf:first object1; rdf:rest [ rdf:first object2; rdf:rest rdf:nil ] ] ( ) is short for the resource: rdf:nil rdf:parsetype="collection" instructs parsers to generate first/rest properties Université*de*Genève*.*G.*Falquet* RDF* 31* Université*de*Genève*.*G.*Falquet* RDF* 32*

Reification @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>. @prefix s: <http://example.org/vocab>. @prefix c: <http://example.org/courses/>. @prefix std: <http://example.org/students/>. c:6.001 s:students ( std:amy, std:mohamed, std:johann ). Ralph Swick says that Ora Lassila is the creator of the resource http://www.w3.org/home/lassila.» «Albert says that document 345 confirms that Ralph Swick says that Ora Lassila is the creator of the resource http://www.w3.org/home/lassila». Université*de*Genève*.*G.*Falquet* RDF* 33* Université*de*Genève*.*G.*Falquet* RDF* 34* Reification Ralph Swick says that Ora Lassila is the creator of the resource http://www.w3.org/home/lassila.» Something like Ralph Swick says X X = (http://www.w3.org/home/lassila ex:creator "Ora Lassila" ) Université*de*Genève*.*G.*Falquet* RDF* 35* Reification Ralph Swick says that Ora Lassila is the creator of the resource http://www.w3.org/home/lassila.» in RDF X a:attributedto "Ralph Swick". X rdf:type rdf:statement. X rdf:predicate s:creator. X rdf:subject http://www.w3.org/home/lassila. X rdf:object "Ora Lassila". Université*de*Genève*.*G.*Falquet* RDF* 36*

Reified statement Albert says that doc342 confirms that Ralph Swick says that Ora Lassila is the creator of the resource.! s:confirms* rdf:predicate* Albert* a:attributedto* rdf:subject* rdf:object* doc342 rdf:type* rdf:statement Université*de*Genève*.*G.*Falquet* RDF* 37* Université*de*Genève*.*G.*Falquet* RDF* 38*