Query Apache Fuseki Default Graph

127 views
Skip to first unread message

tonh...@gmail.com

unread,
Mar 12, 2017, 12:19:56 AM3/12/17
to rdflib-dev
Hi guys

I am new to RDFLib as well as Apache Jena. I've been trying to use the sample file sparqlstore_example.py in GitHub to query Apache Jena Fuseki with no luck.

The problem is I am trying to query the default graph in Jena Fuseki but I don't know what to put in the identifier of the graph

graph = Graph('SPARQLStore', identifier="what should be here???")

If I put None or empty string, RDFLib replaces it with a GUID and send to Fuseki like so: &default-graph-uri=N3f1203e707c1441c88c1fe0664903f78

If I use CURL and execute the same query generated by RDFLib removing default-graph-uri parameter then it works.

How can I get rid of default-graph-uri ????

Thank you

Best Regards

Alex To

Gunnar Aastrand Grimnes

unread,
Mar 12, 2017, 4:21:22 AM3/12/17
to rdfli...@googlegroups.com
I believe if you use a ConjunctiveGraph, this will just work (it knows
about the concept of a default graph)

You can also use the magic URL urn:x-arq:DefaultGraph for your Graph,
which Fuseki will know what to do with.

- Gunnar
> --
> http://github.com/RDFLib
> ---
> You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+...@googlegroups.com.
> To post to this group, send email to rdfli...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/194615aa-39b6-42a0-92e7-b879c02e975b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
http://gromgull.net

Alex To

unread,
Mar 12, 2017, 4:41:19 AM3/12/17
to rdflib-dev
You're right, I found out that there is a constant in rdflib DATASET_DEFAULT_GRAPH_ID which is the magic URL that does the job

Thanks a lot
Reply all
Reply to author
Forward
0 new messages