W3C home > Mailing lists > Public > semantic-web@w3.org > June 2012

Re: best practice RDF in HTML

From: Sebastian Hellmann <hellmann@informatik.uni-leipzig.de>
Date: Wed, 13 Jun 2012 11:13:34 +0200
Message-ID: <4FD859BE.6020308@informatik.uni-leipzig.de>
To: Ivan Herman <ivan@w3.org>
CC: public-lod <public-lod@w3.org>, semantic-web <semantic-web@w3.org>
Ivan,
thanks for the link. This helps a lot. It is difficult for outsiders to 
keep track of the progress at W3C, which is why I opened this thread.
The Turtle language and therefore also the Turtle in HTML <script> will 
be part of RDF 1.1, right?

I am asking, because we might make use of this in NIF[1] in the 
following both ways. (Note that RDFa might also be an option or 
alternative).
Both options (especially B) are drafts, so feedback is welcome.


*****OPTION A (using hash - ids)*****
<html>
<head>
<script>
@base <...#>
@prefix str: <http://nlp2rdf.lod2.eu/schema/string/> .
@prefix itsx: <http://www.w3.org/20XX/XX/its2.0/> .
<hash_10_6_03925a352b25cb24e02e1dae623d0936_Berlin>
itsx:mentions <http://dbpedia.org/resource/Berlin> ;
itsx:entityType <http://nerd.eurecom.fr/ontology#City> .
</script>
<body>
Berlin is the capital of Germany.
</body>


*****OPTION B (using id milestones)*****
<html>
<head>
<script>
@base <...#>
@prefix str: <http://nlp2rdf.lod2.eu/schema/string/> .
@prefix itsx: <http://www.w3.org/20XX/XX/its2.0/> .
<id_Berlin_uuid_3488jdndu438>
itsx:mentions <http://dbpedia.org/resource/Berlin> ;
itsx:entityType <http://nerd.eurecom.fr/ontology#City> .
</script>
<body>
<span id="id_Berlin_uuid_3488jdndu438">Berlin<span> is the capital of 
Germany.
</body>


All the best,
Sebastian

[1] http://svn.aksw.org/papers/2012/WWW_NIF/public/string_ontology.pdf

On 06/12/2012 06:40 PM, Ivan Herman wrote:
> Sebastian,
>
> Stéphane Corlosquet has already commented on this, but somehow the thread went on: the upcoming Turtle standard refers to the possibility of adding Turtle into an HTML file using the<script>  element[1]. [1] refers to the editor's draft, but the RDF WG is very close to Last Call.
>
> Some (essentially RDFa) tools already implement that, eg, pyRdfa[2], or (as far as I know) the Ruby based RDF Distiller[3] do it (possibly through a separate option setting).
>
> Does this help?
>
> Ivan
>
>
>
> [1] http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#in-html
> [2] http://www.w3.org/2012/pyRdfa/
> [3] http://rdf.greggkellogg.net/distiller
>
>
>
>
> On Jun 12, 2012, at 18:22 , 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
>>
>>
>
> ----
> Ivan Herman, W3C Semantic Web Activity Lead
> Home: http://www.w3.org/People/Ivan/
> mobile: +31-641044153
> FOAF: http://www.ivan-herman.net/foaf.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
Received on Wednesday, 13 June 2012 09:14:15 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 21:45:49 GMT