On 28/04/15 22:47, Claude Warren wrote:
I'm not sure this is an error so I thought I'd see what the consensus is
here before I do anything.

My understanding is that the Graph interface has no restrictions on the
types of objects in the subject, predicate or object.  That is that I could
store an anonymous node as the predicate in a triple even though this is
not allowed in a model.

The FileGraph implementation uses a model internally and when it writes the
data out the model restrictions seem to apply -- that is I can not store an
anonymous node as a predicate.

All other graphs tested thus far allow saving the anonymous node as a
predicate.

It may be that the format of the output is enforcing the restrictions.  I
am currently using a TURTLE format.  However any functional format would be
acceptable.  Is there a way to write the filegraph output when the graph
does not meet the model restrictions?

Claude

Short answer: no, not without some work but it's not a lot of work.

The fact that triples allow generalized RDF [1] (anon predicates etc) is needed because they arise in rules and SPARQL.

It would be a burden to be forever testing before making a triple or pattern, rather, they are allowed then don't match naturally or get filtered out (CONSTRUCT).

Generalised graphs are less needed as far as I know.

None of the I/O will write generalized RDF though it's not hard (except for RDF/XML where it's impossible). It all assumes RDF not generalized.

The NT writer doesn't even check but the NT read does as does the parser to graph step. Some of the other I/O would work (SSE, DataBags). Writing generalized-NT I/O is trivial; Turtle is less so as it's about pretty forms.

        Andy

[1] http://www.w3.org/TR/rdf11-concepts/#section-generalized-rdf

Reply via email to