graphs load_dir_if_modified

1 view
Skip to first unread message

Bruce

unread,
May 28, 2008, 12:15:02 PM5/28/08
to Oort RDF Toolkit
I want to use the load_dir_if_modified method to load a triple store,
where each file gets a context URI that consists of a standard base
uri + file name sans extension.

Can someone provide an example of how to do this using the
"computeContextUri" callback?

I thought I had this working, but am observing some bizarre behavior
where if I do graph.serialize() everything works fine, but if I do
graph.serialize(format="n3") I get a "attributeError: 'str' object has
no attribute 'n3'" error. So I presume I'm doing something wrong.

Bruce

PS - I wonder if it would be worth giving the graphs.py file in some
form to the rdflib project, since it's really of general use?

Niklas Lindström

unread,
Jul 10, 2008, 4:21:41 PM7/10/08
to bdarcu...@gmail.com, oo...@googlegroups.com
Hi Bruce!

I'm terribly sorry, this mail was miscategorized in my overcrowed
mailbox (too many mailing-lists ;] ), so I only just now read it. Is
this still relevant for you?

It sounds like your callback returns a str, it must be an URIRef
instance. This is something I hope will be fixed in RDFLib: there
should be type assertions in the core of it since issues like this
comes up a lot (because all parts of a triple must be of type
Identifier (the base class of Literal, URIRef and BNode), but rdflib
graphs accept "raw" values as input).

(Without a callback, graph.absolutize(filepath) is used.)

.. In regard to your suggestion to give the graphs.py to rdflib -
you're probably right, it's general enough to fit there (after some
cleanup perhaps). I haven't had time to spend on either oort nor
rdflib the last couple of months I'm afraid, but I hope to do so - and
then contribute more to RDFLib 3.0 which I've spoken some to Daniel
about.

Best regards - and again apologies for the long overdue reply,
Niklas

Reply all
Reply to author
Forward
0 new messages