Re: best practice RDF in HTML

Hi all:

First, a few arguments in favor of using invisible data content in RDFa are in [1]. Also note our two tools [2] and [3] that can generate RDFa snippets from other RDF syntaxes with ease, so you can e.g. model your data structures in nice Turtle and then derive the RDFa patterns automatically.

My main argument for the past three years of advocating this is that:

1. It is way more productive to do so as compared to manually weaving in RDFa patterns into *existing* HTML page templates for *non-trivial* data structures (e.g. GoodRelations).

2. In the case of dynamically generated content from templates using templating engines like Smarty or Jinja, the invisible content will be as current as the visible content, so the old argument of the data not being in sync with the visible content does mostly not hold. 

3. If the HTML is non valid / buggy, then the extraction of data from a part of invisible RDFa that itself is valid (e.g. no missing closing HTML elements) is way more reliable. HTML cleaners applied to buggy HTML can often only guess the intended tree structure and thus often attach properties to the wrong entities.

4. The two principles of avoiding redundancy (DRY) and separation of concerns (keeping the modeling of rendering aspects separate from conceptual data modeling issues) conflict in the case of RDF in HTML.

As for the practical aspect, I recommend putting the block of invisible RDFa closely BEFORE the respective visible content. Search engines do not seem to like such blocks towards the end of the page.

Best wishes

Martin Hepp


[1] Hepp, Martin; García, Roberto; Radinger, Andreas: RDF2RDFa: Turning RDF into Snippets for Copy-and-Paste, Technical Report TR-2009-01, 2009.
http://www.heppnetz.de/files/RDF2RDFa-TR.pdf
[2] http://www.ebusiness-unibw.org/tools/rdf2rdfa/ 
[3] http://rdf-translator.appspot.com/


On Jun 12, 2012, at 6:22 PM, Sebastian Hellmann wrote:

> Dear Mark,
> my main concerns are:
> 1. What are the best practices to include invisible RDFa in an HTML document. I think Keith answered that. Maybe at the end of the body would be the most unobtrusive way.  The same question was raised here: http://answers.semanticweb.com/questions/10161/is-visually-hidden-rdfa-an-anti-pattern 
> I just wanted to reassure that hidden RDFa is not contradicting the intention of RDFa.
> Are there any practical disadvantages (besides the obvious increase in byte size)?
> 
> 2. Are there any alternatives to RDFa to include RDF in HTML ?
> 
> All the best,
> Sebastian
> 
> 
> On 06/12/2012 05:52 PM, Mark Birbeck wrote:
>> Hi Sebastian,
>> 
>> It's not clear to me whether you are saying that you don't want to use
>> RDFa because:
>> 
>> * you don't like it, or;
>> 
>> * you think that it needs to have some user-oriented manifestation.
>> 
>> There is no requirement that the RDFa in a document is displayed to
>> the user in any way, or that the triples somehow 'double-up'. This
>> means that your example could also be marked up like this:
>> 
>>   <div
>>     xmlns:cd="http://www.recshop.fake/cd#"
>>     about="http://www.recshop.fake/cd/Empire_Burlesque"
>>   >
>>      <span property="cd:artist" content="Bob Dylan"></span>
>>     <span property="cd:dbpedia"
>> resource="http://dbpedia.org/resource/Empire_Burlesque"></span>
>>   </div>
>> 
>> Regards,
>> 
>> Mark
>> 
>> 
>> On Tue, Jun 12, 2012 at 3:02 PM, Sebastian Hellmann
>> <hellmann@informatik.uni-leipzig.de>  wrote:
>>> Dear list,
>>> What are the best practice to include a set of RDF triples in HTML.
>>> *Please note*: I am not looking for the RDFa way to include triples. I just
>>> want to add a set of triples somewhere in an HTML document. They are not
>>> supposed to show up like "Wikinomics", "Don Tapscott" in  the following
>>> example:
>>> 
>>> <div  xmlns:dc="http://purl.org/dc/elements/1.1/"
>>>  about="http://www.example.com/books/wikinomics">
>>>  <span  property="dc:title">Wikinomics</span>
>>>  <span  property="dc:creator">Don Tapscott</span>
>>>  <span  property="dc:date">2006-10-01</span>
>>> </div>
>>> 
>>> I don't want to use the strings in the HTML document as objects in the
>>> triples. My use case is that I just have a large set of triples, e.g. 1000
>>> that I want to include as a bulk somewhere and ship along with the html.
>>> Which way is the best? Do the examples below work?
>>> All the best,
>>> Sebastian
>>> 
>>> *******************************************
>>> Include in head
>>> ******************************************
>>> <html>
>>> <head>
>>> <script type="application/rdf+xml">
>>> <rdf:RDF
>>> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>>> xmlns:cd="http://www.recshop.fake/cd#">
>>> 
>>> <rdf:Description
>>> rdf:about="http://www.recshop.fake/cd/Empire Burlesque">
>>> <cd:artist>Bob Dylan</cd:artist>
>>> <cd:dbpedia rdf:resource="http://dbpedia.org/resource/Empire_Burlesque">
>>> </rdf:Description>
>>> </rdf:RDF>
>>> </script>
>>> </head>
>>> <body>
>>> </body>
>>> </html>
>>> ******************************
>>> attach after html
>>> *****************************
>>> <html>
>>> <head>
>>> </head>
>>> <body>
>>> </body>
>>> </html>
>>> <rdf:RDF
>>> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>>> xmlns:cd="http://www.recshop.fake/cd#">
>>> 
>>> <rdf:Description
>>> rdf:about="http://www.recshop.fake/cd/Empire Burlesque">
>>> <cd:artist>Bob Dylan</cd:artist>
>>> <cd:dbpedia rdf:resource="http://dbpedia.org/resource/Empire_Burlesque">
>>> </rdf:Description>
>>> </rdf:RDF>
>>> 
>>> 
>>> --
>>> Dipl. Inf. Sebastian Hellmann
>>> Department of Computer Science, University of Leipzig
>>> Projects: http://nlp2rdf.org , http://dbpedia.org
>>> Homepage: http://bis.informatik.uni-leipzig.de/SebastianHellmann
>>> Research Group: http://aksw.org
>>> 
>>> 
>> 
> 
> 
> -- 
> Dipl. Inf. Sebastian Hellmann
> Department of Computer Science, University of Leipzig
> Projects: http://nlp2rdf.org , http://dbpedia.org
> Homepage: http://bis.informatik.uni-leipzig.de/SebastianHellmann
> Research Group: http://aksw.org
> 
> 



--------------------------------------------------------
martin hepp
e-business & web science research group
universitaet der bundeswehr muenchen

e-mail:  hepp@ebusiness-unibw.org
phone:   +49-(0)89-6004-4217
fax:     +49-(0)89-6004-4620
www:     http://www.unibw.de/ebusiness/ (group)
         http://www.heppnetz.de/ (personal)
skype:   mfhepp 
twitter: mfhepp

Check out GoodRelations for E-Commerce on the Web of Linked Data!
=================================================================
* Project Main Page: http://purl.org/goodrelations/

Received on Tuesday, 12 June 2012 17:22:53 UTC