Download presentation
Presentation is loading. Please wait.
Published byDale Fox Modified over 9 years ago
1
Speaker: Raúl García Castro rgarcia@fi.upm.es ORCO 2013 Madrid, Spain 8 February 2013 RDFa Raúl García-Castro Ontology Engineering Group Universidad Politécnica de Madrid, Spain
2
ORCO 2013. 8 February 2013© Raúl García Castro Index Overview Introduction RDFa Lite RDFa Core RDFa tools Wrap-up 2 Hay que explicar un poco de HTML, los scopes, los DIV, etc. The way in which you annotate will depend on how your HTML is
3
ORCO 2013. 8 February 2013© Raúl García Castro RDFa Goal -To embed RDF data into (X)HTML (and others) We are not discussing other alternatives: -Microformats -HTML5 microdata 3 RDF(S) RDF Schema RDF
4
ORCO 2013. 8 February 2013© Raúl García Castro RDFa in the Semantic Web 4
5
ORCO 2013. 8 February 2013© Raúl García Castro Index Overview Introduction RDFa Lite RDFa Core RDFa tools Wrap-up 5
6
ORCO 2013. 8 February 2013© Raúl García Castro RDFa RDFa 1.1 Working Group Note RDF Syntax for embedding metadata into documents Specified for XHTML, HTML5 and other XML-based languages (e.g., SVG) Allows using generic metadata, instead of ad-hoc metadata RDFa-specific metadata do not have effect on visualization 6 SyntaxSubjectPredicateResourceTypeLiteralList RDFa Litevocab prefix propertyresourcetypeof RDFa Coreaboutrel rev href src content datatype inlist
7
ORCO 2013. 8 February 2013© Raúl García Castro Index Overview Introduction RDFa Lite RDFa Core RDFa tools Wrap-up 7
8
ORCO 2013. 8 February 2013© Raúl García Castro RDFa Lite Syntax vocab. Defines the vocabularies used prefix. Defines IRI abbreviations, useful for multiple vocabularies Resource resource. Defines non-navigable resources Predicate property, Defines relationships between a subject and either a resource or a literal Type typeof. Defines the type of a resource 8 SyntaxSubjectPredicateResourceTypeLiteralList RDFa Litevocab prefix propertyresourcetypeof RDFa Coreaboutrel rev href src content datatype inlist
9
ORCO 2013. 8 February 2013© Raúl García Castro Properties @property -By default the subject is the document itself 9... The Trouble with Bob Date: 2011-09-10... “The Trouble with Bob”. “2012-09-10”. http://example.com/alice/posts/trouble_with_bob “The trouble with Bob” http://purl.org/dc/terms/title “2012-09-10” http://purl.org/dc/terms/created
10
ORCO 2013. 8 February 2013© Raúl García Castro Changing the base URL -Valid for (X)HTML 10 Jo's Blog... “Jo’s Blog”.
11
ORCO 2013. 8 February 2013© Raúl García Castro Defining vocabularies @vocab -Can appear anywhere in the file, only affecting elements below 11...... The Trouble with Bob Date: 2011-09-10...
12
ORCO 2013. 8 February 2013© Raúl García Castro IRI abbreviations + Multiple vocabularies @prefix -Can appear anywhere in the file, only affecting elements below Can be mixed with @vocab RDFa pre-defines a number of useful and popular prefixes -Good practice: always define your prefixes 12... The trouble with Bob... Alice The trouble with Bob is that he takes much better photos than me:...
13
ORCO 2013. 8 February 2013© Raúl García Castro Multiple subjects per document @resource -The innermost value has precedence 13 The trouble with Bob Date: 2011-09-10 Jo's Barbecue Date: 2011-09-14 The trouble with Bob Beautiful Sunset by Bob.
14
ORCO 2013. 8 February 2013© Raúl García Castro Resources as objects @resource -Highest priority -Non-navigable links 14 On Crime and Punishment Rodion Romanovitch! My dear friend!.
15
ORCO 2013. 8 February 2013© Raúl García Castro Typing resources @typeof Implicit rdf:type predicate -Highest priority 15 Albert Einstein Albert rdf:type foaf:Person. foaf:namee “Albert Einstein”. foaf:givenName “Albert”.
16
ORCO 2013. 8 February 2013© Raúl García Castro Typing blank nodes @typeof for creating a new context, i.e., blank node 16 Albert Einstein Albert _:a rdf:type foaf:Person. _:a foaf:name "Albert Einstein". _:a foaf:givenName "Albert".
17
ORCO 2013. 8 February 2013© Raúl García Castro Index Overview Introduction RDFa Lite RDFa Core RDFa tools Wrap-up 17
18
ORCO 2013. 8 February 2013© Raúl García Castro RDFa Core Resource href. Defines a resource from a navigable IRI src. Defines a resource from an embedded object Subject about. Defines triple subjects Predicate rel. Defines relationships between two resources rev. Defines reverse relationships between two resources Literal content. Defines literals datatype. Defines the datatype of a literal List inlist. Defines lists and empty lists 18 SyntaxSubjectPredicateResourceTypeLiteralList RDFa Litevocab prefix propertyresourcetypeof RDFa Coreaboutrel rev href src content datatype inlist
19
ORCO 2013. 8 February 2013© Raúl García Castro Changing the current subject By default the subject is the document itself may change the subject in (X)HTML @resource may define multiple subjects @about Unlike @resource, @about is only used to set the subject 19 The trouble with Bob Jo's Barbecue... dc:title “The trouble with Bob”. cd:title “Jo’s Barbecue”.
20
ORCO 2013. 8 February 2013© Raúl García Castro Subject inheritance When neither @about or @typeof are present Inheriting subject from @resource Inheriting an anonymous subject 20 Albert Einstein the German Empire foaf:name "Albert Einstein". dbp:birthPlace. dbp:conventionalLongName "the German Empire". Albert Einstein dbp-owl:influenced _:a. _:a foaf:name "Albert Einstein”.
21
ORCO 2013. 8 February 2013© Raúl García Castro Relationships between resources @property @rel -Establishes a relationship between the current subject as subject and the current object as object @rev -Establishes a relationship between the current object as subject and the current subject as object 21 My name is John Doe and my blog is called Understanding Semantics. @prefix foaf:. foaf:name "John Doe" ; foaf:homepage.
22
ORCO 2013. 8 February 2013© Raúl García Castro Defining resources When no @resource is present @href -Navigable IRI @src -Embedded object IRI 22 <img about="http://www.blogger.com/profile/1109404" src="photo1.jpg" rev="dc:creator" rel="foaf:img"/> dc:creator. foaf:img. foaf:knows
23
ORCO 2013. 8 February 2013© Raúl García Castro Typing resources (II) @typeof + @resource @typeof + @about @typeof + @rel 23 Albert Einstein rdf:type foaf:Person. <div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/German_Empire" typeof="http://schema.org/Country"> rdf:type.
24
ORCO 2013. 8 February 2013© Raúl García Castro Literals Plain literals: @content (precedence) Plain literals with language tag: “@en” Typed literals: @datatype 24 <meta about="http://internet-apps.blogspot.com/" property="dc:creator" content="Mark Birbeck" /> <span about="http://internet-apps.blogspot.com/” property="dc:creator">Mark Birbeck dc:creator "Mark Birbeck". <meta about="http://example.org/node" property="ex:property" xml:lang="fr" content="chat" /> "chat"@fr. September 16th at 4pm. <> cal:dtstart "2015-09-16T16:00:00-05:00"^^xsd:dateTime.
25
ORCO 2013. 8 February 2013© Raúl García Castro XML Literals XML literals: @datatype=“rdf:XMLLiteral” “Plain” XML literals: @datatype=“” 25 E = mc 2 : The Most Urgent Problem of Our Time <> dc:title "E = mc 2 : The Most Urgent Problem of Our Time"^^rdf:XMLLiteral. Albert Einstein. foaf:name "Albert Einstein".
26
ORCO 2013. 8 February 2013© Raúl García Castro Lists @inlist. -Object should be put in a list with common predicate and subject -The order in the list is determined by the document order Empty list 26 <p prefix="bibo: http://purl.org/ontology/bibo/ dc: http://purl.org/dc/terms/ typeof="bibo:Chapter"> " Semantic Annotation and Retrieval " by Ben Adida, Mark Birbeck, and Ivan Herman.
27
ORCO 2013. 8 February 2013© Raúl García Castro RDFa example 27 people:hasColleague people:Raul people:Asun people:hasHomePage http://www.oeg-upm.net/ people:hasColleague people:Oscar “Óscar Corcho García” people:hasName Asunción Gómez Pérez Has home page. Is friend of Raúl. Óscar Corcho García Is friend of Asun.
28
ORCO 2013. 8 February 2013© Raúl García Castro Index Overview Introduction RDFa Lite RDFa Core RDFa tools Wrap-up 28
29
ORCO 2013. 8 February 2013© Raúl García Castro RDFa Tools RDFa tool lists -http://www.w3.org/2001/sw/wiki/RDFa -http://rdfa.info/tools/ Beware of the RDFa version! 29 (X)HTML + RDFa (X)HTML + RDFa Editor Validator Browser Publisher Distiller RDF Translator Programming library OK ! RDF Microdata JSON... RDF Microdata JSON...
30
ORCO 2013. 8 February 2013© Raúl García Castro RDFa editors and browsers Editors Online -RDFaCE http://aksw.org/Projects/RDFaCE http://rdface.aksw.org/test/tinymce/examples/rdfaDemo.html (demo) Standalone -TopBraid Composer http://www.topquadrant.com/products/TB_Composer.html Browsers Online -RDFa / Play http://rdfa.info/play/ -Structured Data Linter http://linter.structured-data.org/ -Sig.ma http://sig.ma/ Firefox extension -RDFa Developer http://rdfadev.sourceforge.net/ 30
31
ORCO 2013. 8 February 2013© Raúl García Castro RDFa validators Validators Online -check-rdfa http://check.rdfa.info/ -W3C Nu Markup Validation Service http://validator.w3.org/nu/ -W3C (X)HTML Validator (using the right DTD) http://validator.w3.org/ Standalone -Total Validator ((X)HTML validator with RDFa validation) http://www.totalvalidator.com/ 31
32
ORCO 2013. 8 February 2013© Raúl García Castro RDFa publishers and distillers RDFa publishers (RDF RDFa) Online -RDF2HTML+RDFa (XSL style sheet) http://rhizomik.net/html/redefer/ http://rhizomik.net/redefer/rdf2html-form (demo) -RDF2RDFa Converter (XSLT transformation) http://www.ebusiness-unibw.org/tools/rdf2rdfa/ RDFa Distillers (RDFa RDF) Online -RDFa 1.1 Distiller and Parser http://www.w3.org/2012/pyRdfa/Overview.html -RDFa Distiller and Parser http://www.w3.org/2007/08/pyRdfa/ Standalone -Krextor http://trac.kwarc.info/krextor/ 32
33
ORCO 2013. 8 February 2013© Raúl García Castro RDFa translators and APIs Translators Online -RDF Translator (multiformat) http://rdf-translator.appspot.com/ -RDF Distiller (multiformat) http://rdf.kellogg-assoc.com/distiller Programming libraries Perl -RDF-RDFa-Parser http://search.cpan.org/dist/RDF-RDFa-Parser/ Java -java-rdfa https://github.com/shellac/java-rdfa#readme 33
34
ORCO 2013. 8 February 2013© Raúl García Castro Index Overview Introduction RDFa Lite RDFa Core RDFa tools Wrap-up 34
35
ORCO 2013. 8 February 2013© Raúl García Castro RDFa in the Semantic Web 35
36
ORCO 2013. 8 February 2013© Raúl García Castro Main References Adida B, Herman I, Sporny M, Birbeck M (2012) RDFa 1.1 Primer - Rich Structured Data Markup for Web Documents. W3C Working Group Note 07 June 2012 http://www.w3.org/TR/rdfa-primer/ Adida B, Birbeck M, McCarron S, Herman I (2012) RDFa Core 1.1 - Syntax and processing rules for embedding RDF through attributes. W3C Recommendation 07 June 2012 http://www.w3.org/TR/rdfa-core/ Tennison J (2012) HTML Data Guide. W3C Interest Group Note 08 March 2012 http://www.w3.org/TR/html-data-guide/ 36
37
Speaker: Raúl García Castro rgarcia@fi.upm.es ORCO 2013 Madrid, Spain 8 February 2013 Thank you for your attention!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.