Repetition

INF3580/4580 – Semantic Technologies – Spring 2015 Lecture 15: RDFa 18 June: Guest lecture, Lars Marius Garshol 25 May: no lecture (Whit Monday) Martin Giese 1st June is reserved for “Repetition” No fixed lecture material 11th May 2015 You, the students, say what you want to hear Let me know in time, so I’m prepared. Department of University of Drop a mail to [email protected] until 18th May Informatics Oslo

INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 2 / 29

Reminder Today’s Plan Outline

1 Reminder 1 Reminder

2 Linking RDF to HTML 2 Linking RDF to HTML

3 RDFa 3 RDFa

4 Conclusion 4 Conclusion

INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 3 / 29 INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 4 / 29 Reminder Linking RDF to HTML RDF on the Web Outline

RDF data exists in many forms: 1 Reminder In RDF files, downloadable with HTTP, FTP, etc. FOAF profiles data files from .org, geonames, etc. 2 Linking RDF to HTML In RSS 1.0 feeds Published using LOD principles (hash/slash namespaces) As in PDF/A files 3 RDFa As data model behind SPARQL query endpoints for instance dbpedia.org, dblp, and others Embedded in HTML, as RDFa 4 Conclusion

INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 5 / 29 INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 6 / 29

Linking RDF to HTML Linking RDF to HTML The Problem Embedding RDF/XML in (X)HTML

First idea: Embed RDF/XML in HTML or XHTML: The HTML web contains lots of human-readable information How can clients discover the location of corresponding machine-readable information? My Homepage Martin Giese ? ... −→ Not recommended: Does not fit HTML or XHTML DTDs No satisfactory solution, due to flexible RDF vocabulary B.t.w. there is a metadata element in SVG for this!

INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 7 / 29 INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 8 / 29 Linking RDF to HTML Linking RDF to HTML HTML LINK elements LINKing to RDF

LINK may occur inside HTML HEAD elements relate a document to other documents CSS style sheets Alternative languages To link to an RDF representation: Next, previous, index, etc. xml" rel – the kind of relation title="RDF/XML version" type – the of the related document href="http://dbpedia.org/data/Oslo.xml"> href – the URL of the other document title – the title of the other document Also: rel="meta" (and some more) Note: difference between meta-data and alternative representation E.g. a style sheet: Various web browser plugins exist to detect these LINKs My Homepage INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 9 / 29 INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 10 / 29

Linking RDF to HTML RDFa HTTP Link: response headers Outline

Problems with elements: Only works with HTML data, not PDF, Images, etc. 1 Reminder Need to download HTML content and search LINK. Idea: put information in HTTP response header. Non-standardized proposal, originally by Berners-Lee, 1992 2 Linking RDF to HTML Generated by a few servers, recognized by a few clients Same information as in LINK HTML element, but as HTTP header: 3 RDFa Link: ; rel="alternate"; type="application/rdf+xml" Advantages: 4 Conclusion can be sent also with non-HTML data requires only HEAD request

INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 11 / 29 INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 12 / 29 RDFa RDFa Once More: Embedding RDF in (X)HTML RDFa Processing

Web browsers ignore RDFa attributes Directly embedding RDF/XML in (X)HTML does not work well RDFa processors extract a single RDF graph from a document Use a different “serialization” that blends well with (X)HTML!

From the RDFa specification (http://www.w3.org/TR/rdfa-syntax/) XHTML+RDFa The aim of RDFa is to allow a single RDF graph to be carried in various types of document mark-up. Web browser RDFa processor XHTML in spec., but works with HTML and other XML RDFa adds a fixed set of attributes to (X)HTML Document type: Web page RDF graph

INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 13 / 29 INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 14 / 29

RDFa RDFa RDFa Concepts Reminder: (X)HTML Meta and Link

Links and metadata in HTML header: RDFa adds semantic annotations to hyper-links (href) Page 507 textual content RDFa attributes can appear in (almost) any element As the XHTML is processed, there is always a “current subject” that generated triples refer to ... The current subject starts as the base URI of the document, but can change on the way Meaning of name and rel informal Only a few values defined by the standard

INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 15 / 29 INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 16 / 29 RDFa RDFa RDFa property and rel Attribute rel on A elements

“semantic” meta and link in RDFa: rel="cc:license" MG’s home page href="http://creativecommons.org/licenses/by-nc-nd/3.0/"> Creative Commons License . ... Extracted triple: <> cc:license . Extracted triples: (<> is base URI!) Can use rev instead of rel to swap subject and object <> dc:creator "Martin Giese" . <> foaf:topic .

INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 17 / 29 INF3580/4580 :: Spring 2015 Lecture 15 :: 11th May 18 / 29

RDFa RDFa The property attribute Changing the Subject

rel is for resource objects, property for literal objects: about changes subject of contained rel and property annotations: xmlns:foaf="http://xmlns.com/foaf/0.1/"> ...

Martin Giese

Email:

Kransen

Written in 1920 [email protected]

Phone: Extracted triples: 31 41 59 26

<> dc:title "Kransen" ; dc:created "1920" .