N3 model in Trine

Toby Inkster tai at g5n.co.uk
Wed Jun 9 23:14:28 CEST 2010


On Wed, 9 Jun 2010 14:37:32 -0400
Gregory Williams <greg at evilfunhouse.com> wrote:

> I think graph literals might be hard to work in. I'm not totally up
> to speed on N3, but it seems like they'd overlap with graph
> names/quads, but have to be distinct from them to distinguish when a
> term is a resource and when its a graph (or maybe that's a false
> dichotomy?).

I'd probably implement them as a subclass of RDF::Trine::Node::Literal.
They'd have pretty much no overlap with quads.

The following N3:

	{ ?foo foaf:knows ?bar . }
	  => { ?foo a foaf:Person . } .

Would be represented as a single statement in the model. The predicate
would be log:implies and the subject and object would be graph
literals.

This is because, say:

	{ <#x> a foaf:Person . } a rdfg:Graph .

Does not imply:

	<#x> a foaf:Person .

So you wouldn't actually want the latter in the model.

A graph literal would probably internally be implemented as a reference
pointing to an RDF::Trine::Pattern. By overriding $node->literal_value
and $node->literal_datatype, it would be possible to make a graph
literal look like any other literal to code that doesn't "know about"
graph literals.

It's only once you add in N3 reasoning that you start wanting to
copy triples from inside the graph literal to outside it.

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


More information about the Dev mailing list