If you check plugins/surf.sesame2/sesame2/test/test_sesame2.py you can find the
following settings used:
kwargs = {"reader": "sesame2",
"writer" : "sesame2",
"server" : "localhost",
"port" : 8080,
"root_path" : "/openrdf-sesame",
"repository" : "test"}
You would have to create the "test" repository before though (here:
http://localhost:8080/openrdf-workbench/). This settings above run locally
without changes for a Jetty installation. For tomcat you might have a different
port.
I should probably blog about the steps used to install OpenRDF & sesame &
surf.
-Christoph
Reading older bug reports it seems that the origins of the sesame2 plugin in
SuRF lie with AllegroGraph. Many of its features only work with extensions
provided by AllegroGraph and are not available with OpenRDF.
Doing a quick search on Sesame2 + load doesn't turn up any good hits so I
believe there is no direct way of doing the same with OpenRDF. A solution
though is to do the following:
from surf.rdf import Graph
function load(source, format='xml', context=None):
g = Graph()
g.parse(source=source, format=format)
for s, p, o in g:
store.add_triple(s, p, o, context=context)
This gets the file locally, parses it and then adds all triples to the remote
store.
I filed a bug report to track this issue
(http://code.google.com/p/surfrdf/issues/detail?id=71), but I believe there's
not much we can do than to mark this method as unsupported.
A fact I learned about just now is that OpenRDF supports SPARQL (not SPARUL
though it seems) so we could try to support OpenRDF through the
sparql_protocol or something similar.
-Christoph
Correction. Of course SuRF uses SPARQL on OpenRDF but we could check if
there's a more generic way of doing the connection bits.
> Reading older bug reports it seems that the origins of the sesame2
> plugin in
> SuRF lie with AllegroGraph. Many of its features only work with
> extensions
> provided by AllegroGraph and are not available with OpenRDF.
Ok, i see
> from surf.rdf import Graph
>
> function load(source, format='xml', context=None):
> g = Graph()
> g.parse(source=source, format=format)
> for s, p, o in g:store.add_triple(s, p, o, context=context)
thanks for this workaround Christoph,
just a pity that it gets back to RDFlib parser, or xmlreader in rdflib
and doesn't like literals
MALFORMED DATA: Expected '.', found: " [line 1]
Perhaps Sesame would have eaten the timbl FOAF profile without
complaining...
> A fact I learned about just now is that OpenRDF supports SPARQL (not
> SPARUL
> though it seems) so we could try to support OpenRDF through the
> sparql_protocol or something similar.
I'll try the SPARQL access and dig into the sesame2 code if I find
time to.
Is it still important to maintain its compatibility with allegro since
allegro has its own plugin ?
If I find some time I'll have a look at the rdflib code there.
> I'll try the SPARQL access and dig into the sesame2 code if I find
> time to.
> Is it still important to maintain its compatibility with allegro since
> allegro has its own plugin ?
The Allegro specific bits are provided as an extra class on top of the Sesame2
code. It seems though that a better separation is needed. I believe the code
there is one of the oldest parts of SuRF so cleaning up is needed. If you find
time to look into this, cool.
Btw, I created another issue report to extend the test cases so that your
issue is found by unittesting:
http://code.google.com/p/surfrdf/issues/detail?id=72
I'll have this on my radar.
-Christoph
Do you have a file/URL where this error occurs? I thought you meant
http://www.w3.org/People/Berners-Lee/card but this is parsed correctly under
rdflib 3.1.0
-Christoph