Re: relational data as a bona fide member of the SM

On Thu, 3 Nov 2011 09:57:08 +0200 (EET)
Sampo Syreeni <decoy@iki.fi> wrote:

> As a relational minded guy, I wonder why there aren't any genuinely 
> relational minded formats/syntaxes/data around

Strikes me that N3 and SPARQL could be extended with some pretty
simple syntactic sugar to get this done.

#### employment_history.n3x ###########################
@prefix j: <http://example.com/job#> .
@relation JOB; j:Job, j:Employment; (j:title j:employer) .

<#joe>
  foaf:name "Joe Bloggs" ;
  is j:employee of
    JOB("Bee Keeper" "W3C") ,
    JOB("Senior Vice-President" "CompuGlobalHyperMeganet") ,
    JOB("Polar Bear Wrangler" "DHARMA Initiative") .
#######################################################

The "@relation" directive would establish a relationship identifier. (In
the above case, "JOB".) Relationship types take a set of classes (above,
j:Job and j:Employment) and a list of properties.

When parsing, if the relationship identifier is encountered, the parser
consumes this, and then consumes an RDF list, but rather than adding
the list to the graph, it interpolates the classes and properties.

    JOB("Bee Keeper" "W3C")

is treated as:

    [ a j:Job, j:Employment; j:title "Bee Keeper"; j:employer "W3C" ]

An extended version of SPARQL (SPARQL-R, say) could include a similar
facility.

I've been playing with extending N3 syntax:

http://www.w3.org/wiki/ShorthandRDF#RDF-TriN3_Implementation
http://goddamn.co.uk/svn-web/perlmods/view/RDF-TriN3/examples/vcard_ttl.pl

This certainly seems like a useful idea, and I'd be happy to experiment
with something along these lines.

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>

Received on Saturday, 12 November 2011 01:41:30 UTC