Benelux Semantic Web Meetup, Amsterdam 2010-11-24 Ivan Herman, W3C.

Slides:



Advertisements
Similar presentations
RDF and RDB 1 Some slides adapted from a presentation by Ivan Herman at the Semantic Technology & Business Conference, 2012.
Advertisements

The Semantic Web – WEEK 4: RDF
Introduction to RDF Based on tutorial at
Gleaning Resource Descriptions from Dialects of Languages (GRDDL) W3C Team Submission 16 May 2005 Dominique Hazaël-Massieux, Dan Connolly Summarized by.
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.
Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Kim
RDF Tutorial.
Semantic Web Introduction
RDF and RDB 1 Some slides adapted from a presentation by Ivan Herman at the Semantic Technology & Business Conference, 2012.
RDF formats for Linked Data by Mabi Harandi. RDF is not a format, it is a model for data So: It will provide supports for different formats like :  Turtle.
Embedding Knowledge in HTML Some content from a presentations by Ivan Herman of the W3c.
(1) Standardizing for Open Data Ivan Herman, W3C Open Data Week Marseille, France, June Slides at:
2011 Semantic Technologies Conference 7 th of June, 2011, San Francisco, CA, USA Ivan Herman, W3C.
Dr. Alexandra I. Cristea RDF.
A year on the Semantic W3C (or: what is happening these days?) Semantic Web Meetup, Seattle, Ivan Herman, W3C.
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.
The RDF meta model: a closer look Basic ideas of the RDF Resource instance descriptions in the RDF format Application-specific RDF schemas Limitations.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Pontifícia Universidade Católica do Rio de Janeiro, Ivan Herman, W3C.
Metadata Standards and Applications 4. Metadata Syntaxes and Containers.
Logics for Data and Knowledge Representation SPARQL Protocol and RDF Query Language (SPARQL) Feroz Farazi.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
RDF: Concepts and Abstract Syntax W3C Recommendation 10 February Michael Felderer Digital Enterprise.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
RDF (Resource Description Framework) Why?. XML XML is a metalanguage that allows users to define markup XML separates content and structure from formatting.
Semantic Web Technologies ufiekg-20-2 | data, schemas & applications | lecture 21 original presentation by: Dr Rob Stephens
Practical RDF Chapter 1. RDF: An Introduction
Logics for Data and Knowledge Representation
Integrating Live Plant Images with Other Types of Biodiversity Records Steve Baskauf Vanderbilt Dept. of Biological Sciences
Master Informatique 1 Semantic Technologies Part 11Direct Mapping Werner Nutt.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
On the Semantics of R2RML and its Relationship with the Direct Mapping Juan F. Sequeda Research in Bioinformatics and Semantic Web (RiBS) Lab Department.
CC L A W EB DE D ATOS P RIMAVERA 2015 Lecture 2: RDF Model & Syntax Aidan Hogan
Towards a semantic web Philip Hider. This talk  The Semantic Web vision  Scenarios  Standards  Semantic Web & RDA.
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.
RDFa, Microformats, and Atom Semantic Web Presented by: Anuradha Kandula Instructor: Steven Seida.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Embedding Knowledge in HTML Some content from a presentations by Ivan Herman of the W3c.
1 Tutorial on the Semantic Web (Last update: 26 May 2009) adapted from (C) Ivan Herman, W3C Given at WE course by Peter Dolog Adapted: October 2010.
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.
The RDF meta model Basic ideas of the RDF Resource instance descriptions in the RDF format Application-specific RDF schemas Limitations of XML compared.
Doc.: IEEE /0169r0 Submission Joe Kwak (InterDigital) Slide 1 November 2010 Slide 1 Overview of Resource Description Framework (RFD/XML) Date:
RDF and Relational Databases
RDFa Primer Bridging the Human and Data webs Presented by: Didit ( )
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,
Chapter 04 Semantic Web Application Architecture 23 November 2015 A Team 오혜성, 조형헌, 권윤, 신동준, 이인용.
Semantic Web in Depth RDFa, GRDDL and POWDER Dr Nicholas Gibbins
Semantic Web in Depth Schema.org RDFa, JSON-LD, Microdata Professor Steffen Staab 2016, Many slides courtesy by Dr. Nick Gibbins.
Introduction to RDF Sandro Hawke, Semantic Web Tutorial ISWC 2010.
ISWC 2010, Shanghai, 8 th November, 2010 Ivan Herman ( 郝易文 ), W3C.
RDB2RDF Working Group Cunxin Jia. Why Mapping RDBs to RDF?
Embedding Knowledge in HTML
Tutorial on Semantic Web
Charlie Abela Department of Intelligent Computer Systems
RDFa: Embedding RDF Knowledge in HTML
Tutorial on Semantic Web
RDFa How and Why Ralph R. Swick World Wide Web Consortium
RDF and RDB 1 Some slides adapted from a presentation by Ivan Herman at the Semantic Technology & Business Conference, 2012.
Introduction to the Semantic Web (tutorial) 2009 Semantic Technology Conference San Jose, California, USA June 15, 2009 Ivan Herman, W3C
XML QUESTIONS AND ANSWERS
Tutorial on Semantic Web
How does the Semantic Web Work?
Embedding Knowledge in HTML
CC La Web de Datos Primavera 2016 Lecture 2: RDF Model & Syntax
CSIRO ICT Centre Conference
Embedding Knowledge in HTML
RDFa: Embedding RDF Knowledge in HTML
Resource Description Framework (RDF)
Presentation transcript:

Benelux Semantic Web Meetup, Amsterdam Ivan Herman, W3C

(2)

(3)  For RDF people, it sounds very simple:  RDFa is a serialization of RDF embedded in XHTML, HTML, or XML in general

(4)

(5)

(6)  Apart from relational databases, most of the data on the Web are in… (X)HTML content  New content is generated every day  How would one get structured data from that information?

(7)  Do not generate RDF/XML files separately  RDF/XML is complex  it requires a separate storage, generation, etc mechanism that is also valid for, e.g., Turtle even when authoring with, say, Emacs, creating an extra file is a load

(8)  Add extra structured content to the (X)HTML pages  Let processors extract those and turn into RDF

(9)  Microformats  reuses HTML  separate vocabularies (address, CV, …)  difficult to mix microformats (no concept of namespaces)  possible to transform via, e.g., XSLT + GRDDL, but all transformations are vocabulary dependent

(10)  Microdata  adds new attributes to HTML5 to express metadata  can use URI-s, it also fixes some vocabulary mappings (e.g., to Dublin Core elements)  works for simpler usages, not well suited for complex vocabularies  has no notion of datatypes, namespaces  but generic processing becomes possible to generate RDF

(11)  RDFa  adds new (X)HTML/XML attributes  has namespaces and URIs at its core; i.e., mixing vocabulary is just as easy as in RDF  complete flexibility for using Literals or URI Resources  is a complete serialization of RDF  generic processing becomes possible to generate RDF

(12)

(13)  It is very important for RDF experts to  know RDFa  parse it alongside Turtle, RDF/XML or other  when appropriate, generate RDFa pages

(14)

(15)  RDFa means “RDF in attributes”. I.e.,:  all RDF contents are defined through XML attributes (no elements)  the XML/HTML tree structure is used  many of the attributes are defined by RDFa some are also reused  if possible, the text content is also reused (for literals) as well values

(16)  The same (X)HTML file:  is used, unchanged, by browsers they ignore attributes they do not know  can be used by specialized processors (or APIs) to extract RDF triples

(17)  The current Recommendation is RDFa 1.0  There is an RDFa1.1 in the making, almost ready  I will talk about RDFa1.1 and warn when the feature is not available in RDFa1.0

(18)  Formally:  RDFa WG defines Core and XHTML  HTML WG defines HTML5  we will use XHTML examples XHTML +RDFa HTML5 +RDFa SVG 1.2 SVG 1.2 … … ODF RDF Core 1.1 (valid for any XML) RDF Core 1.1 (valid for any XML)

(19)  A browser usually asks for an HTML content:

(20)  Via content negotiations this goes to:

(21)  Via content negotiations this goes to:

(22)  But a client could ask for, say, Turtle:

(23)  The triples are embedded in the HTML file  a client may know how to extract RDF triples directly from that file; or  an online “distiller” service is used; or  the server is set up to generate the Turtle file automatically

(24)

(25) RewriteEngine On RewriteBase /ns/entailment/data/ RewriteRule RDFS.ttl /2007/08/pyRdfa/extract?format=turtle& uri= [L] RewriteEngine On RewriteBase /ns/entailment/data/ RewriteRule RDFS.ttl /2007/08/pyRdfa/extract?format=turtle& uri= [L]

(26)

(27)

(28)

(29)

(30) <p about=" property=" Unique identifier for RDFS Entailment. <p about=" property=" Unique identifier for RDFS Entailment. …. ….

(31) <p about=" property=" Unique identifier for RDFS Entailment. <p about=" property=" Unique identifier for RDFS Entailment. …. ….

(32) <p about=" property=" Unique identifier for RDFS Entailment. <p about=" property=" Unique identifier for RDFS Entailment. "Unique identifier for RDFS Entailment.". "Unique identifier for RDFS Entailment.".

(33)

(34)

(35) <a about=" rel=" href=" RDF Semantics. <a about=" rel=" href=" RDF Semantics. …. ….

(36) <a about=" rel=" href=" RDF Semantics. <a about=" rel=" href=" RDF Semantics. …. ….

(37) <a about=" rel=" href=" RDF Semantics. <a about=" rel=" href=" RDF Semantics...

(38)

(39)  The combination with and covers most of we need…  But this is too complex for authors

(40) "Unique identifier for RDFS Entailment.".. "Unique identifier for RDFS Entailment."..  refix dc:. rdfs:seeAlso ; dc:description "Unique identifier for RDFS refix dc:. rdfs:seeAlso ; dc:description "Unique identifier for RDFS Entailment.".

(41)  Use compact URI-s when possible  Make use of XML structure for  shared subjects  shared predicates  create blank nodes  …

(42)  Just like in Turtle:  define a prefix  use prefix:reference to abbreviate a URI

(43) … <p about=" property=" Unique identifier for RDFS Entailment. … … <p about=" property=" Unique identifier for RDFS Entailment. …  can be replaced by: … <p about=" property="dc:description"> Unique identifier for RDFS Entailment. … … <p about=" property="dc:description"> Unique identifier for RDFS Entailment. …

(44)  Can be anywhere in the XML tree and is valid for the whole sub-tree  i.e., the html element is not the only place to have it  The attribute can hold several definitions:  prefix="dc: rdfs:

(45)  An alternative (deprecated) syntax is  xmlns:dc="  CURIEs and “real” URIs can be mixed  if an attribute value can be interpreted as a CURIE, fine  alternatively, it is considered as a URI  CURIEs can be used on RDFa attributes only!  e.g., not

(46)  In RDFa 1.0  only the xslt:XXX syntax is usable  CURIEs can only be used with the syntax: about="[pref:ref]"  Only CURIEs can be used on, (no fallback on URIs)

(47)  The basic is inherited by children nodes  i.e., no reason to repeat it

(48) <html p refix="dc: rdfs: … … Unique identifier for RDFS Entailment. …<a rel="rdfs:seeAlso" href=" RDFS Semantics … <html p refix="dc: rdfs: … … Unique identifier for RDFS Entailment. …<a rel="rdfs:seeAlso" href=" RDFS Semantics …

dc:. rdfs:seeAlso ; dc:description "Unique identifier for RDFS dc:. rdfs:seeAlso ; dc:description "Unique identifier for RDFS Entailment.".

(50)

(51)  What we said is: sets the subject sets the object  But that is not always good enough  we do not always want active links (i.e., the “a” element)

(52) <span rel="rdfs:seeAlso" resource=" Activity Lead <span rel="rdfs:seeAlso" resource=" Activity Lead  The attribute is equivalent  it sets the object, just  but it is ignored by a browser, i.e., not a link!  e.g.,:

(53) dc:creator. foaf:mailbox ; foaf:workplaceHomepage. dc:creator. foaf:mailbox ; foaf:workplaceHomepage.  Here is what we would like to have in RDFa

(54) … <span rel="dc:creator" resource=" <a rel="foaf:mailbox" <a rel="foaf:workplaceHomepage" href=" … <span rel="dc:creator" resource=" <a rel="foaf:mailbox" <a rel="foaf:workplaceHomepage" href="  A straightforward way:

(55) … <span rel="dc:creator" resource=" <a rel="foaf:mailbox" <a rel="foaf:workplaceHomepage" href=" … <span rel="dc:creator" resource=" <a rel="foaf:mailbox" <a rel="foaf:workplaceHomepage" href="  A straightforward way:

(56) … <span rel="dc:creator" resource=" <a rel="foaf:mailbox" <a rel="foaf:workplaceHomepage" href=" … <span rel="dc:creator" resource=" <a rel="foaf:mailbox" <a rel="foaf:workplaceHomepage" href="  An alternative:

(57) becomes a subject for the sub-tree  This feature is a bit like in RDF/XML

(58)

(59)  Blank nodes can be created using “_:XX”  Datatypes for literals can be set  Shorthand for RDF types  An API is being defined for Web Applications

(60)  Prefix declarations can be collected in a separate file and referred to via attribute  the “profile file”  RDFa1.0 warning: this is an RDFa1.1 feature!

(61)  A profile file can also define a term:  assign a URI to a simple string  The term can be used directly by authors, without prefixes

(62)  Say, file “ defines a mapping:  "desc" → "

(63) <html prefix="dc: rdfs: … … Unique identifier for RDFS Entailment. <html prefix="dc: rdfs: … … Unique identifier for RDFS Entailment.  dc:. "Unique identifier for RDFS dc:. "Unique identifier for RDFS Entailment."

(64)  Usage of CURIEs and URIs is intuitive for RDF people…  It is not for average HTML authors!  Profile files can be published by major publishers:  Dublin Core, FOAF, …  FaceBook, Google, …  … and users can simply refer to the profiles

(65)  RDFa gives an easy way of publishing RDF data on the Web  Often, the same RDF data is available in different formats, including RDFa  it is up to the client to choose which one to use  Web Applications would rely on RDFa, though…

(66)

(67)

(68)  Various search engines begin to consume RDFa  Google, Yahoo, … they may specify which vocabularies they “understand” this is still an evolving area  Facebook’s “social graph” is based on RDFa

(69)  Embedded metadata (in microformat or RDFa) is used to improve search result page  at the moment only a few vocabularies are recognized, but that will evolve over the years

(70)  A number of popular sites publish RDFa as part of their normal pages:  Tesco, BestBuy, Slideshare, The London Gazette, Newsweek, O’Reilly Catalog, the White House…  Creative Commons snippets are in RDFa

(71) Courtesy of Jay Myers, BestBuy, SemTech2010 Presentation

(72) Courtesy of Jay Myers, BestBuy, SemTech2010 Presentation

(73)  Reported in a BestBuy blog:  GoodRelations+RDFa improved Google rank tremendously  30% increase in traffic on BestBuy store pages  Yahoo observes a 15% increase in click-through rate  Not bad…

(74)

(75)

(76)

(77)  Data on the Web are mostly stored in databases  “Bridges” are being defined:  a layer between RDF and the relational data RDB tables are “mapped” to RDF graphs, possibly on the fly different mapping approaches are being used  a number RDB systems offer this facility already (eg, Oracle, OpenLink, …)  R2RML is W3C’s evolving standard in this area

(78)  It defines how a table is mapped on RDF  is defined in term of an RDB schema each row is mapped on a common subject column headers yield predicates each cell is mapped on an object  different tables within the same database are also linked in the graph

(79)  An R2RML processor has access to:  an RDB schema  an R2RML instance  a database governed by the schema  … and produces an RDF graph RDB Schema R2RML Instance R2RML Processing Tables

(80) …isbn/ X Ghosh, Amitav The Glass Palace 2000 a:title a:year a:name a:homepage a:author

(81) …isbn/ X Ghosh, Amitav The Glass Palace 2000 a:title a:year a:name a:homepage a:author

(82) …isbn/ X Ghosh, Amitav The Glass Palace 2000 a:title a:year a:name a:homepage a:author

(83) …isbn/ X Ghosh, Amitav The Glass Palace 2000 a:title a:year a:name a:homepage a:author

(84) …isbn/ X Ghosh, Amitav The Glass Palace 2000 a:title a:year a:name a:homepage a:author :P_Table rdf:type rr:TriplesMap ; rr:subjectMap [ rr:termtype "BlankNode" ; rr:column "ID" ; ] ; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate a:name ]; rr:objectMap [ rr:column "Name" ] ] ; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate a:homepage ]; rr:objectMap [ rr:column "Homepage" ; rr:termtype "IRI" ] ] ; :P_Table rdf:type rr:TriplesMap ; rr:subjectMap [ rr:termtype "BlankNode" ; rr:column "ID" ; ] ; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate a:name ]; rr:objectMap [ rr:column "Name" ] ] ; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate a:homepage ]; rr:objectMap [ rr:column "Homepage" ; rr:termtype "IRI" ] ] ;

(85) …isbn/ X Ghosh, Amitav The Glass Palace 2000 a:title a:year a:name a:homepage a:author :B_Table rdf:type rr:TriplesMap ; rr:subjectMap [ rr:value [ rr:prefix " ; rr:column "ISBN" ; ] ]; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate a:title ]; rr:objectMap [ rr:column "Title" ] ] ; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate a:year ]; rr:objectMap [ rr:column "Year" ; ] ] ; :B_Table rdf:type rr:TriplesMap ; rr:subjectMap [ rr:value [ rr:prefix " ; rr:column "ISBN" ; ] ]; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate a:title ]; rr:objectMap [ rr:column "Title" ] ] ; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate a:year ]; rr:objectMap [ rr:column "Year" ; ] ] ;

(86) …isbn/ X Ghosh, Amitav The Glass Palace 2000 a:title a:year a:name a:homepage a:author :B_Table a rr:TriplesMap ;... rr:refPredicateObjectMap [ rr:refPredicateMap [ rr:predicate a:author ]; rr:refObjectMap [ rr:parentTriplesMap :P_Table ; rr:joinCondition "{child}.Author = {parent}.ID" ] ]. :B_Table a rr:TriplesMap ;... rr:refPredicateObjectMap [ rr:refPredicateMap [ rr:predicate a:author ]; rr:refObjectMap [ rr:parentTriplesMap :P_Table ; rr:joinCondition "{child}.Author = {parent}.ID" ] ].

(87)  There are some additional features  assign a datatype to a literal object  more complicated object assignments (e.g., for a specific column the object is a cell of another column) :B_Table rdf:type rr:TriplesMap ;... rr:predicateObjectMap [... rr:objectMap [ rr:column "Year" ; rr:datatype xsd:year ] ] ; :B_Table rdf:type rr:TriplesMap ;... rr:predicateObjectMap [... rr:objectMap [ rr:column "Year" ; rr:datatype xsd:year ] ] ;

(88)  Back to our example: :B_Table rdf:type rr:TriplesMap ; rr:subjectMap [ rr:value [ rr:prefix " ; rr:column "ISBN" ; ] ]; :B_Table rdf:type rr:TriplesMap ; rr:subjectMap [ rr:value [ rr:prefix " ; rr:column "ISBN" ; ] ]; …isbn/ X ISBN… X…

(89)  An alternative could have been to use SQL  generate a “logical table”  all other definitions are on that logical table  Would be an overkill for our example, but can be very powerful for complicated cases! …isbn/ X ISBN… X… id… :B_Table rdf:type rr:TriplesMap ; rr:SQLQuery "Select (" || ISBN) AS id, Author, Title, Publisher, Year from b_table " ; :B_Table rdf:type rr:TriplesMap ; rr:SQLQuery "Select (" || ISBN) AS id, Author, Title, Publisher, Year from b_table " ; :B_Table rdf:type rr:TriplesMap ; … rr:subjectMap [ ff:column "id" ]; :B_Table rdf:type rr:TriplesMap ; … rr:subjectMap [ ff:column "id" ];

(90)  A R2RML processor might be complex  includes an SQL engine, for example  fine when bound to big RDB systems  An alternative: generate an crude RDF Graph  no transformations, links among tables only, etc.  it is the equivalent of a “Null” R2RML, i.e., no need to specify one  That graph can be processed further with RDFS, rules, etc  This is also properly defined, referred to as “Direct Mapping”

(91)

(92) The Glass Palace X

(93) Ghosh, Amitav The Glass Palace X

(94) …isbn/ X Ghosh, Amitav The Glass Palace 2000 a:title a:year a:name a:homepage a:author  Property names should be mapped  URI-s should be minted  Literals should be replaced by URI-s Ghosh, Amitav The Glass Palace X

(95) Ghosh, Amitav The Glass Palace X …isbn/ X Ghosh, Amitav The Glass Palace 2000 a:title a:year a:name a:homepage a:author CONSTRUCT { ?id a:title ?title ; a:year ?year ; a:author _:x. _:x a:name ?name ; a:homepage ?hp. } WHERE { ?book ?isbn ; ?title ; ?year ; ?author. ?author ?name ; <Author#Homepage ?homepage. BIND (IRI(fn:concat(" AS ?id) BIND (IRI(?homepage) AS ?hp) } CONSTRUCT { ?id a:title ?title ; a:year ?year ; a:author _:x. _:x a:name ?name ; a:homepage ?hp. } WHERE { ?book ?isbn ; ?title ; ?year ; ?author. ?author ?name ; <Author#Homepage ?homepage. BIND (IRI(fn:concat(" AS ?id) BIND (IRI(?homepage) AS ?hp) }

(96) These slides are also available on the Web: