Web 2.0 Lecture 8: Resource Description Framework

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

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

2. RDF Semantic Web Basics 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

Semantic Web Engineering

RDF /RDF-S Providing Framework Support to OWL Ontologies

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

INF3580/4580 Semantic Technologies Spring 2015

Semantic Web Engineering

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

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

Semantic Days 2011 Tutorial Semantic Web Technologies

An RDF-based Distributed Expert System

Semantic Web Technologies

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

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

LECTURE 09 RDF: SCHEMA - AN INTRODUCTION

Ontological Modeling: Part 2

RESOURCES DESCRIPTION FRAMEWORK: RDF

BUILDING THE SEMANTIC WEB

Today s Plan. INF3580 Semantic Technologies Spring RDF on the Web. Outline. Lecture 13: Publishing RDF Data on the Web.

The Resource Description Framework and its Schema

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

RDF(S) Resource Description Framework (Schema)

Part II. Representation of Meta-Information

The Semantic Web. Mansooreh Jalalyazdi

Knowledge Representation for the Semantic Web

RDF. Mario Arrigoni Neri

Linking Data with RDF

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

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

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

RDFS. Suresh Manandhar* & Dimitar Kazakov

MI-PDB, MIE-PDB: Advanced Database Systems

Semantic Web Technologies: RDF + RDFS

Semantic Web Fundamentals

O.Curé [1 ] Mashup, Microformats, RDFa and GRDDL

RDF. Charlie Abela Department of Artificial Intelligence

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

RDF and RDF Schema. Resource Description Framework

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

RDF Schema. Mario Arrigoni Neri

Transforming Data from into DataPile RDF Structure into RDF

SWAD-Europe Deliverable 8.1 Core RDF Vocabularies for Thesauri

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

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

What's New in RDF 1.1

Building Blocks of Linked Data

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

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

2. Knowledge Representation Applied Artificial Intelligence

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

Semantic Web Tools. Federico Chesani 18 Febbraio 2010

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

Multi-agent Semantic Web Systems: RDF Models

Library of Congress BIBFRAME Pilot. NOTSL Fall Meeting October 30, 2015

JENA: A Java API for Ontology Management

Introducing Linked Data

DCMI Abstract Model - DRAFT Update

Simplified RDF Syntax for Power System Model Exchange

RDF Schema Sebastian Rudolph

Semantics. Matthew J. Graham CACR. Methods of Computational Science Caltech, 2011 May 10. matthew graham

Semantic Web Modeling Languages Part I: RDF

Resource Description Framework (RDF)

<?xml version='1.0' encoding='iso '?> <!DOCTYPE rdf:rdf [ <!ENTITY rdf ' <!

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

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

B4M36DS2, BE4M36DS2: Database Systems 2

Information Network I Web 3.0. Youki Kadobayashi NAIST

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

Multi-agent and Semantic Web Systems: RDF Data Structures

Web 3.0 Overview: Interoperability in the Web dimension (1) Web 3.0 Overview: Interoperability in the Web dimension (2) Metadata

The Semantic Web. What is the Semantic Web?

Big Data 14. Graph Databases

Opus: University of Bath Online Publication Store

Introduction to Ontologies

CWI. Multimedia on the Semantic Web. Jacco van Ossenbruggen, Lynda Hardman, Frank Nack. Multimedia and Human-Computer Interaction CWI, Amsterdam

Knowledge Representation for the Semantic Web

Chapter 13: Advanced topic 3 Web 3.0

Standards for language encoding: Sharing resources

Semantic Web Fundamentals

Table of Contents. iii

Knowledge Management with the WWW

RDF Graph Data Model

Web 2.0 Lecture 1: Motivation and Course Overview

Semantic Web and Python Concepts to Application development

Knowledge Representation RDF Turtle Namespace

Bridging the Gap between Semantic Web and Networked Sensors: A Position Paper

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

INF3580/4580 Semantic Technologies Spring 2017

Is Linked Data the future of data integration in the enterprise?

Semantic Web and Linked Data

RDF Schema Sebastian Rudolph

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on XML and Semantic Web

Today s Plan. 1 Repetition: RDF. 2 Jena: Basic Datastructures. 3 Jena: Inspecting Models. 4 Jena: I/O. 5 Example. 6 Jena: ModelFactory and ModelMaker

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

Deep integration of Python with Semantic Web technologies

Metadata Standards and Applications. 4. Metadata Syntaxes and Containers

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

Transcription:

Web 2.0 Lecture 8: Resource Description Framework doc. Ing. Tomáš Vitvar, Ph.D. tomas@vitvar.com @TomasVitvar http://www.vitvar.com Leopold-Franzens Universität Innsbruck and Czech Technical University in Prague Faculty of Information Technologies Software and Web Engineering http://www.vitvar.com/courses/w20 Last modified: N/A Overview Resource Description Framework (RDF) Structured Property Values Encoding RDF in XML (RDF/XML) On top of RDF RDF in attributes (RDFa) OpenGraph Protocol Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 2

Scope: Semantic Web Layered Cake Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 3 RDF Resource Description Framework (RDF) Resource as defined in Web architecture usually anything that can be conveyed electronically plus abstract concepts that have no representation RDF is at the bottom of Semantic Web stack of languages References W3C Recommendations: RDF Suite of W3C Recommendations, RDF Primer Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 4

Meaning of Data in XML a resource with URI http://www.vitvar.com/data-aboutme <person xmlns="http://example.org/people"> <name>tomas Vitvar</name> <mailbox>tomas@vitvar.com</mailbox> <city>innsbruck</city> </person> no explicit meaning of terms: person, name, mailbox,... are terms defined in namespace http://example.org/people but there is no URI assigned to them this does not work here: http://example.org/people#name Need for a language to describe statements Resource Description Framework no explicit meaning of relationships: a person has name with value Tomas Vitvar ( Tomas Vitvar is a person), this person has mailbox with value tomas@vitvar.com ( tomas@vitvar.com is a mailbox), etc. Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 5 BUT this person lives?, works?, was born?,... in a city Innsbruck RDF Statement RDF Tripple: subject predicate object a thing the statement describes (subject) a specific property of the object (predicate) a value of the property (subject) Representation of statements using a graph notation nodes are subject and objects (rectangles are literals) arcs are predicates identifiers to identify subject, predicate, object URI references (URIrefs) machine processable language RDF serializations in triples, RDF/XML, N3, Turtle notations Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 6

Meaning of Data in RDF individuals, Tomas Vitvar identified by http://vitvar.com#me kinds of things, Person identified by #Person properties of those things, e.g., mailbox, identified by #mailbox values of those properties, e.g. mailto:tomas@vitvar.com + values of other data types such as strings, integers, dates, etc. Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 7 References in statements URI identifies network-accessible things (electronic documents) URL things that are not network-accessible, such as human beings abstract concepts that do not physically exist, such as "fullname" RDF uses URI references to identify subjects, predicates, objects URI references (or URIref) URI with an optional fragment identifier http://www.w3.org/2000/10/swap/pim/contact#fullname RDF resource is anything that can be identified with URIref a set of URIrefs is called RDF vocabulary Literals character strings to represent property values can only be assigned to objects in RDF (in other words, objects can be either URIrefs or literals) they cannot be assigned to subjects or properties two kinds: plain literals and typed literals Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 8

RDF Serializations Triples Notation Triples notation list of all triples from RDF graph the full triples notation requires that URI references be written out completely (in angled brackets) very long documents, some URIrefs need to be repeated <http://www.example.org/index.html> <http://purl.org/dc/elements/1.1/creator> "Tomas". Simplicity for examples QNames without angle brackets common prefixes and namespaces rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# dc: http://purl.org/dc/elements/1.1/ ex: http://www.example.org/ ext: http://www.example.org/terms xsd: http://www.w3.org/2001/xmlschema# example ex:index.html dc:creator "Tomas". Lecture 8: Resource ex:index.html Description Framework, dc:language CTU Summer "en" Semester. 2010/2011, @TomasVitvar 9 Kinds of Things Property rdf:type defines a type of a resource ex:me rdf:type ext:person. corresponds to "is a member of" relationship ext:person understood as a class, however RDF does not define its semantics RDF Schema provides additional vocabulary for class semantics Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 10

Overview Resource Description Framework (RDF) Structured Property Values Encoding RDF in XML (RDF/XML) On top of RDF RDF in attributes (RDFa) OpenGraph Protocol Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 11 Structured Property Values Real-world complex structures Tomas works at Technikestrasse 21a, 6020 Innsbruck, Austria ex:tomas ext:works "Technikestrasse 21a, 6020 Innsbruck, Austria". usually needs to be recored as a structure, i.e. street, city, ZIP,... describe Tomas's address as a resource having URIref do we need such identifier? (when we reference it from other graph yes, otherwise not really) Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 12

Blank Nodes What are blank nodes Nodes that do not need to be referenced from outside of the graph No need to URIref, is only used within the graph Blank node identifier local within a graph: _:localid local id must be unique within the graph two blank nodes in two different graphs having the same local ids are not the same! Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 13 Modeling with Blank Nodes N-ary relationships In fact, a way to model n-ary relationships blank node is a way to break up n-ary to binary relationships 3-ary relationship between Tomas and (Technikestr, Innsbruck, 6020) Tomas Technikestr, Tomas Innsbruck, Tomas 6020 Unidentified things not always good to use URIs such as e-mails to identify people e-mails may change, disappear,... sometimes no need to assign unique ids to people Example the author of the book is mailto:tomas@vitvar.com, the author of the book is a person with e-mail mailto:tomas@vitvar.com a person = abstract concept, can be modeled using a blank node ex:book23 ext:author _:author1 _:author1 ext:email <mailto:tomas@vitvar.com> _:author1 ext:name "Tomas Vitvar" _:author1 rdf:type ex:person Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 14

Untyped and Typed Literals Untyped Literals No information about how to interpret a value of the plain literal a programme must have a knowledge how to interpret the value ex:person1 ext:age "24" Typed literals pairing a string with a URIref that identifies a particular datatype ex:person1 ext:age "24"^^xsd:integer, where xsd: is http://www.w3.org/2001/xmlschema# RDF does not define its own data types (except rdf:xmlliteral) no need to map external to native ones RDF uses external data types defined in XML Schema not all are suitable, only basic ones such as string, integer, date, etc. Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 15 Main value of a structured property Contextual information Need to express context in the global Web environment not safe to assume all understand the implicit context the same Example: weight in pounds and kilograms solutions: specialized property name ext:weightkg specialized datatypes extypes:unitkg Main value example: weight ex:computer324 ext:weight "2.4"^^xsd:decimal unit is implicit, it is useful to define it explicitly ex:weight should have 2 components, weight typed value and a unit decimal value could be considered as the main value of the property structured value with rdf:value property ex:computer324 ext:weight _:weight584. _:weight584 rdf:value "2.4"^^xsd:decimal. _:weight584 ext:unit ex:kilograms. Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 16

Overview Resource Description Framework (RDF) Structured Property Values Encoding RDF in XML (RDF/XML) On top of RDF RDF in attributes (RDFa) OpenGraph Protocol Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 17 Basic Rules Representation of RDF in XML language Example RDF triple a page index.html was created on August 16, 1999 ex:index.html ext:creation-date "Aug 16, 1999". RDF/XML representation We can interpret a RDF statement as it is a description that is about a subject of the statement XML element (QName) of the description is the predicate a value of the element is the object <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ext="http://www.example.org/terms/"> <rdf:description rdf:about="http://www.example.org/index.html"> <ext:creation-date>august 16, 1999</ext:creation-date> </rdf:description> </rdf:rdf> URIrefs must be written out when in attribute values Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 18

Multiple Statements and Typed Literals Example RDF triples ex:index.html ext:creation-date "Aug 16, 1999". ex:index.html dc:language "en". ex:index.html ext:rank "3"^^xsd:decimal. ex:index.html dc:creator <http://www.vitvar.com#me>. RDF/XML representation <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ext="http://www.example.org/terms/"> <rdf:description rdf:about="http://www.example.org/index.html"> <ext:creation-date>august 16, 1999</ext:creation-date> <dc:language>en</dc:language> <ext:rank rdf:datatype="http://www.w3.org/2001/xmlschema#decimal"> 3</ext:rank> <dc:creator rdf:resource="http://www.vitvar.com#me"/> </rdf:description> </rdf:rdf> a description may combine all properties for a single subject but there also can be a description for every subject such representations are the same Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 19 Blank Nodes Example RDF triples ex:index.html ext:editor _:editor332. _editor332 ext:name "Tomas Vitvar". _editor332 ext:homepage <http://www.vitvar.com>. RDF/XML representation <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ext="http://www.example.org/terms/"> <rdf:description rdf:about="http://www.example.org/index.html"> <ext:editor rdf:nodeid="editor332"/> </rdf:description> <rdf:description rdf:nodeid="editor332"> <ext:name>tomas Vitvar<ext:name> <ext:homepage rdf:resource="http://www.vitvar.com"/> </rdf:description> </rdf:rdf> A node with id editor332 can be referred to from within the RDF graph, not outside of the RDF graph Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 20

Abbreviating URIrefs ENTITY declaration Example RDF triples ex:index.html ext:editor _:editor332. _editor332 ext:name "Tomas Vitvar"^^xsd:string. _editor332 ext:homepage <http://www.vitvar.com>. RDF/XML representation <?xml version="1.0"?> <!DOCTYPE rdf:rdf [<!ENTITY xsd "http://www.w3.org/2001/xmlschema#">]> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ext="http://www.example.org/terms/"> <rdf:description rdf:about="http://www.example.org/index.html"> <ext:editor rdf:nodeid="editor332"/> </rdf:description> <rdf:description rdf:nodeid="editor332"> <ext:name rdf:datatype="&xsd;string">tomas Vitvar<ext:name> <ext:homepage rdf:resource="http://www.vitvar.com"/> </rdf:description> </rdf:rdf> Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 21 Abbreviating URIrefs xml:base Example RDF triples Statements about a book Introduction to RDF exbooks corresponds to http://www.example.com/2002/04/books exbooks:item334 ext:name "Introduction to RDF". extbooks:item334 ext:rankedby "Tomas Vitvar". extbooks:item334 ext:rank "4". RDF/XML representation <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ext="http://www.example.org/terms/" xml:base="http://www.example.com/2002/04/books"> <rdf:description rdf:id="item334"> <ext:name>introduction to RDF</ext:CPU> <ext:rankedby>tomas Vitvar</ext:rankedBy> <ext:rank>4</ext:rank> </rdf:description> </rdf:rdf> The book has an URIref http://www.example.com/2002/04/books#item334 Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 22

Overview Resource Description Framework (RDF) Structured Property Values Encoding RDF in XML (RDF/XML) On top of RDF RDF in attributes (RDFa) OpenGraph Protocol Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 23 RDF Schema RDF Schema Specification RDF vocabulary description language (RDF Schame or RDFS) Semantics for classes and properties W3C Standard Specification: RDF Schema RDF vs. RDF Schema RDF defines a way to describe statements about resources RDF Schema defines a language to describe terms (vocabularies) to be used to describe RDF statements RDF Schema does not need to always exist for RDF statements Example We can define a class Lecturer and use it in RDF statement ex:me rdf:type ext:lecturer, where ext corresponds to an URI http://www.example.com/terms This URI can point to a vocabulary defined in RDF Schema Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 24

Defining Classes RDFS Class a concept of a type or category Web pages, people, document types, abstract concepts,... any resource having an rdf:type property whose value is the resource rdfs:class A class of motor vehicles ext:motorvehicle rdf:type rdfs:class. a concrete motor vehicle in RDF ex:mycar rdf:type ext:motorvehicle. Hierarchy of classes additional classes for specialized types of vehicles ext:van rdf:type rdfs:class. ext:truck rdf:type rdfs:class. and their hierarchy ext:truck rdfs:subclassof ext:motorvehicle. Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 25 Defining Properties Range RDF Property semantics for properties to be used in RDF examples: weight, height, author,... ext:author rdf:type rdf:property. A range of a property rdfs:range defines values of a property as instances of a class ext:person rdf:type rdfs:class. ext:author rdf:type rdf:property. ext:author rdfs:range ext:person. More ranges for a single property ext:author rdfs:range ext:female. ext:author rdfs:range ext:person. an instance of the author should be both female and person ex:book_rdf ext:author ex:alice. ex:alice rdf:type ext:female. ex:alice rdf:type ext:person. Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 26

Defining Properties Domain Typed literals value of a property given by a typed literal ext:age rdf:type rdf:property. ext:age rdfs:range xsd:integer. it may be useful to explicitly say that the value is a datatype xsd:integer rdf:type rdfs:datatype. A domain of a property rdfs:range defines a class to which the property may be applied ext:book rdf:type rdfs:class. ext:author rdf:type rdf:property. ext:author rdfs:domain ext:book. As for rdf:range, a property may have more than one rdfs:domain (and a resource having such a property should be an instance of all classes of these domains) Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 27 Comparison of Languages Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 28

Overview Resource Description Framework (RDF) RDF in attributes (RDFa) OpenGraph Protocol Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 29 RDFa Embedding RDF data in XHTML XHTML only, is extensible, HTML not RDFa defines a number of extension attributes Parses may recognize RDFa annotations in HTML too though RDFa is generic to embed arbitrary RDF data in any vocabulary however, standard (commonly agreed) vocabularies make sense W3C Recommendations: RDFa Specification RDFa Primer Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 30

Property and Object Values as Resources Creating a property using rel attribute assume, following text is at http://blog.vitvar.com/?p=107 Content on this page is licensed under <a xmlns:ext="http://www.example.org/terms" rel="ext:license" href="http://creativecommons.org/license/by/3.0"> a Creative Commons License attribution </a> This corresponds to the RDF triple <http://blog.vitvar.com/?p=107> ext:license <http://creativecommons.org/license/by/3.0>. When the subject is not explicitly stated, then the subject is the URL of the XHTML page being described Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 31 Property and Object Values as Literals Creating a property using property attribute RDFa defines a property extension attribute assume, following text is at http://blog.vitvar.com/?p=107 <div xmlns:dc="http://purl.org/dc/elements/1.1/"> <h3 property="dc:creator">tomas<h3> </div> This corresponds to the RDF triple <http://blog.vitvar.com/?p=107> dc:creator "Tomas". Typed literals RDFa defines a datatype extension attribute <div xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsd="http://www.w3.org/2001/xmlschema#"> <h3 property="dc:creator" datatype="xsd:string">tomas<h3> </div> Alternative content RDFa defines content extension attribute replaces the object value that is in the element's value <div xmlns:dc="http://purl.org/dc/elements/1.1/"> <h3 property="dc:date" content="2011-04-08">8 April<h3> </div> Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 32

Subject Creating a subject using about attribute RDFa defines about extension attribute assume, following text is at http://blog.vitvar.com/? p=107 <div xmlns:dc="http://purl.org/dc/elements/1.1/" about="/p/107" > <h3 property="dc:creator">tomas<h3> </div> This corresponds to the RDF triple <http://blog.vitvar.com/p/107> dc:creator "Tomas". Also possible to use multiple subjects on a single page Nested subjects <div xmlns:dc="http://purl.org/dc/elements/1.1/" about="/p/107" > <h3 property="dc:creator">tomas<h3> <div about="/p/img/323"> <img src="..."/> <h3 property="dc:creator">peter<h3> </div> </div> Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 33 two RDF triples Types and Blank Nodes Types RDFa defines typeof extension attribute corresponds to rdf:type property Blank node When annotation has typeof but not about blank node, that is, a node without a subject <div about="#me" rel="foaf:knows" xmlns:foaf="http://xmlns.com/foaf/0.1"> <div typeof="foaf:person"> <p property="foaf:name">peter<p> <p> Email: <a rel="foaf:mbox" href="mailto:peter@novak.cz"> peter@novak.cz</a> <p> </div> I know Peter Novak who has e-mail petr@novak.cz Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 34

Overview Resource Description Framework (RDF) RDF in attributes (RDFa) OpenGraph Protocol Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 35 OpenGraph Protocol Global Social Graph important adoption of RDFa, see Open Graph Protocol defines meta-data for pages' description so that it can be easily included in a global graph connecting people and pages through likes person likes page Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 36

Page Annotations Open Graph protocol main properties the page is the object in the RDF triple og:title title of the page og:type type of the content (e.g., movie) og:image URL of the image for the page og:url a canonical URL of the page to be used as its permanent ID in the graph HTML page annotation RDFa example <html xmlns:og="http://ogp.me/ns#"> <head> <title>the Rock (1996)</title> <meta property="og:title" content="the Rock" /> <meta property="og:type" content="movie" /> <meta property="og:url" content="http://www.imdb.com/title/402/" /> <meta property="og:image" content="http://media-imdb.com/rock.jpg" />... </head>... </html> Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 37 Publishing updates Ownership Page must be associated with a Facebook application using fb:app_id meta tag Owners can publish a stream of updates using Facebook Graph API Getting access curl -F type=client_cred \ -F client_id=app_id \ -F client_secret=app_secret \ https://graph.facebook.com/oauth/access_token Publishing updates curl -F 'access_token=...' \ -F 'message=hello Likers' \ -F 'id=http://www.mydomain.com/great_page.html' \ https://graph.facebook.com/feed Lecture 8: Resource Description Framework, CTU Summer Semester 2010/2011, @TomasVitvar 38