Re: microformat for turtle?

Correction, you can do it all, stick this in an html document :)

<pre>
<script type="text/turtle" style="display:block;">
   @prefix : <http://webr3.org/nathan#> .
   @prefix foaf: <http://xmlns.com/foaf/0.1/> .
   @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

   :me a foaf:Person;
     foaf:age 29;
     foaf:holdsAccount [ foaf:accountName "webr3";
         foaf:homepage <http://twitter.com/webr3>;
         rdfs:label "Nathan's twitter account"@en ];
     foaf:homepage <http://webr3.org>;
     foaf:knows <http://example.com/bob#me>;
     foaf:name "Nathan";
     foaf:nick "webr3", "nath" .

   <http://example.com/bob#me> a foaf:Person;
     foaf:name "Bob" .
</script>
</pre>

Nathan wrote:
> You can pretty much already do this unambiguously in a nice way by 
> leveraging the <script> element:
> 
>  <body>
>   <p>some normal content</p>
>   <script type="text/turtle">
>     @prefix foaf: <http://xmlns.com/foaf/0.1/> .
> 
>     <http://example.com/bob#me> a foaf:Person;
>       foaf:name "Bob" .
> 
>     :a :b ( "apple" "banana" ) .
>   </script>
>   <p>more..</p>
> 
> Benefits are that it gets ignored by normal script processors, you can 
> specify the correct media type, and charset, you can include other 
> scripts or extensions which lift / work with / handle the data - and you 
>  don't need to do any special &lt; encoding or suchlike. Also allowing 
> anybody to copy and paste it directly and so on.
> 
> The drawback is that it's not visible in the browser, however that isn't 
> always a drawback, and a simple script could easily be included to 
> present it to a user, if needed.
> 
> Best,
> 
> Nathan
> 
> Sandro Hawke wrote:
>> Just a random idea.
>>
>> Can we make it legit for people to publish RDF triples just by putting
>> some turtle as plain text in an HTML page, with class="turtle" and an id
>> to give a URI to the graph?    Something like this:
>>
>> At http://example.org/page1:
>>
>>   <html>
>>     <head>
>>       ...
>>     </head>
>>     <body>
>>       ...
>>     <div class="turtle" id="g1">
>>    @prefix : &lt;http://example.org/stuff/1.0/&gt; .
>>    :a :b ( "apple" "banana" ) .
>>    </div>
>>    </body>
>>    </html>
>>
>> So the URI for that graph would be http://example.org/page1#g1
>>
>> I'd suggest the format be defined to allow markup, which is ignored.  I
>> imagine this being used for nicer styling of the turtle code, and to
>> allow the URLs to be clickable, if the author wants that.   (Some
>> systems like wikis try hard to do that automatically.)   None of the
>> markup should affect the graph -- if you print the page, or cut/paste
>> it, it's still real turtle, producing the same triples.
>>
>> I don't know anything about the html5 or microformats process, but I
>> assume there needs to be some consensus developed and recorded around
>> class="turtle" for this to be fully legitimate.
>>
>> What's compelling about this, to me, is it would allow even more people
>> to publish RDF even more easily, at very low implementation cost to
>> consumers.  (Perhaps consuming turtle embedded in HTML like this could
>> be part of the Turtle Recommendation, if/when that happens?  I don't
>> know.)   I think turtle is easier to learn than RDFa, and most
>> publication platforms (eg blogs and wikis) allow people to include divs
>> with a class and id.  Basically, this would be more viral than existing
>> techniques because it's easier to see (unless people style it to be
>> invisible), and requires less specialized knowledge to publish.
>> (Hopefully people would, near this kind of content, include a link to
>> some turtle tutorial they like, explaining this mysterious code.)
>>
>>      -- Sandro
>>
>>
>>
>>
>>
> 
> 
> 
> 

Received on Thursday, 25 November 2010 17:05:55 UTC