W3C home > Mailing lists > Public > public-rdf-comments@w3.org > May 2013

Re: Turtle data-type

From: Henry Story <henry.story@bblfish.net>
Date: Sun, 26 May 2013 17:31:59 +0200
Cc: Aidan Hogan <aidan.hogan@deri.org>, Richard Cyganiak <richard@cyganiak.de>, Andreas Harth <harth@kit.edu>, Eric Prud'hommeaux <eric@w3.org>
Message-Id: <91F3E78C-8968-496D-9FB8-A682F8F083EC@bblfish.net>
To: Semantic Web <semantic-web@w3.org>

On 20 May 2013, at 17:39, Henry Story <henry.story@bblfish.net> wrote:

> Hi,
> 
> In Turtle there is no way of specifying a graph. But one
> could get something close by having a datatype say lang:Turtle,
> such that the value of this would be the graph resulting from 
> interpreting the content of the string to a graph.
> 
> <member> log:semantics "<http://bblfish.net/#me> a <http://xmlns.com/foaf/0.1/Person>"^^lang:Turtle 
> 
> Then Turtle could have a way to express graphs, so we could
> do some of the things N3 does with Turtle in a less elegant
> fashion while waiting for N3 to be specfied.
> 
> Henry

Just re-merging the "N-Quads TR" thread into this one, where
this thread of the conversation makes more sense....

On 26 May 2013, at 16:14, Eric Prud'hommeaux <eric@w3.org> wrote:

> * Henry Story <henry.story@bblfish.net> [2013-05-26 15:06+0200]
>> 
>> On 26 May 2013, at 13:14, Andreas Harth <harth@kit.edu> wrote:
>> 
>>> Hi,
>>> 
>>> I've just stumpled across the Note about N-Quads.
>>> 
>>> You might want to reference our earlier document specifying
>>> N-Quads [1].  Actually, you should.
>> 
>> I wonder if this cannot be reduced down to triples again by going
>> through a content relation, relating a URI to the representation received 
>> from it:
>> 
>> <http://server.example/doc> :content [ turtle "<http://server.example/doc#me> a <http://xmlns.com/foaf/0.1/Person> ." ] .
>> 
>> or in short 
>> 
>> <http://server.example/doc> :content "<http://server.example/doc#me> a <http://xmlns.com/foaf/0.1/Person> ."^^lang:turtle .
>> 
>> No need for quads. You get the quad by indirection through a literal.
> 
> In theory, this seems like a clever way to write and refer to
> non-asserted triples, but in practice, we're always going to want to
> associate them with some label (i.e. we'll only know what to do with
> it when we see the :content predicate) and this triples-as-literal
> approach requires a recursive parser. I prefer to have the surface
> syntax express the expected behavior and to have the parser do all the
> work in one pass.

Quads are a very useful way to make contexts explicit.  What is 
important to me is that there be ways  to express in triples what 
can be more elegantly expressed in quads or N3 (without doing this 
using reification of course, as that is unnaceptably awkward ). 

We use context all the time. Just to take a vanilla XML format
such as Atom - rfc4287 - it requires one to talk about content.
If the LDP working group which is using Turtle by default at 
present wants to be able to express something like the content 
of a remote resource then it will need to quote the content.

One use case would be for example to allow simple Atom servers
to produce RDF representations. For example we can adapt the
simple example from Atom to use RDF like this
http://tools.ietf.org/html/rfc4287#section-1.1

   <entry>
      <title>Joe's Foaf Profile</title>
      <id>http://example.org/2003/12/13/card</id>
      <updated>2003-12-13T18:30:02Z</updated>
      <content type="text/turtle">
        @base &lt;http://example.org/2003/12/13/card&gt; .
	  &lt;#me&gt; a foaf:Person;
               foaf:name "Joe" .
      </content>
    </entry>

In LDP we could make this be:

 <> a ldp:Container;
    rdfs:member <card> .

 <card> dct:title "Joe's Foaf Profile";
        dc:author :joe;
        content """
        @base &lt;http://example.org/2003/12/13/card&gt; .
	  &lt;#me&gt; a foaf:Person;
               foaf:name "Joe" .
        """^^lang:Turtle .

or more elegantly in N3 

  <> a ldp:Container;
    rdfs:member <card> .

 <card> dct:title "Joe's Foaf Profile";
        dc:author :joe;
        content {
	  <card#me> a foaf:Person;
               foaf:name "Joe" .
        }

Or in N-Quads

...
<http://example.org/2003/12/13/card>    <http://www.w3.org/ns/ldp#content> _:g1 .
<http://example.org/2003/12/13/card#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> _:g1 .
<http://example.org/2003/12/13/card#me> <http://xmlns.com/foaf/0.1/name> "Joe" _:g1 .

which is certainly going to be easier to parse.

Now this is important because if this simple mapping is not explained clearly somewhere, then
we keep wasting huge amounts of time making the case again and again for the difference 
between a graph and a quoted graph. 


> 
> 
>> Now the question is can the :content relation be made to be equivalent to cwm's log:semantics ? Ie. can we have
>> the datatype lang:turtle be a map from a string to a graph where the string is interpreted as turtle?
>> 
>> 
>> Henry
>> 
>> 
>>> 
>>> Regards,
>>> Andreas.
>>> 
>>> [1] http://sw.deri.org/2008/07/n-quads/
>>> 
>> 
>> Social Web Architect
>> http://bblfish.net/
>> 
>> 
> 
> -- 
> -ericP
Received on Sunday, 26 May 2013 15:33:50 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:29:56 UTC