paulovn / sparql-kernel

A Jupyter kernel to launch queries against SPARQL endpoints
BSD 3-Clause "New" or "Revised" License
98 stars 17 forks source link

how to store a SPARQL query result in a data structure #20

Closed amorgat closed 5 years ago

amorgat commented 6 years ago

Thank you very much for your contribution, that is really helpful!

Sorry if my questions are naive, I'm new with SPARQL and notebook things.

I need to do the following things:

so how can I store the results of a SPARQL queries into variables?

Have you tried to use your sparql-kernel into SoS (https://vatlab.github.io/blog/post/sos-notebook/)? That's really I'd like to do ;-)

Thanks for your support

Cheers, Anne

paulovn commented 6 years ago

Hi. I'm afraid the support for doing things via programming does not exist at this moment; the kernel is a simple showcase to execute SPARQL queries. To share results elsewhere you could use the %outfile magic:

%outfile name

saves the result of the cell in the file name. It's crude, but then you can load it elsewhere. There are currently no iteration facilities (the query results are sent as cell output whole)

I haven't tried SoS, but it sounds indeed good.

amorgat commented 6 years ago

Thanks for your quick answer Paulo. I have opened a ticket on SoS https://github.com/vatlab/SoS/issues/869 They will certainly contact you quickly (hopefully!)