As you may know, SPARQLing an endpoint is as easy as a REST call, like this:
http://YOUR_ENDPOINT_HERE/sparql?query=YOUR_CONSTRUCT_QUERY_HERE

You can add a Accept header to such a REST call, so you can force the
returned RDF to be formatted (for example) as 'text/n3'.

In Javascript, REST calls are done via XmlHttpRequest (in the browser)
or something similar (in NodeJS).
Once you get the response string (as N3) from the REST call, pass that
string to the N3 parser. And with a very simple callback attached to
the N3 parser, you retrieve the graph of Javascript objects
corresponding to the N3 data.

Nothing complicated.
I am surprised it has never been captured in a ready-to-use JS lib.
(anyway, it is very simple to code by yourself).





On Tue, Feb 17, 2015 at 9:15 PM, Nauman Ramzan
<[email protected]> wrote:
> Hey Olivier Rossel
> I was reading and trying to configure its store for jena fuseki sparql
> endpoint . Is there any help/details for this ?
> because on that page that you shared they are using that store only for
> store triples in memory.
>
> Regards
> Nauman
>
> On Tue, Feb 17, 2015 at 8:23 PM, Olivier Rossel <[email protected]>
> wrote:
>
>> You definitely want to use the N3 parser from
>> https://www.npmjs.com/package/n3
>> With some tweaking, you can build a small js lib on top of that
>> parser, that returns a Javascript graph of objects, given a SPARQL
>> query.
>>
>> Once you get used to this, it is MUCH MUCH more convenient than Json.
>> (because you can traverse the graph of objects in any direction you
>> want, whereas Json forces you to traverse in one predefined tree
>> structure).
>>
>>
>>
>> On Tue, Feb 17, 2015 at 4:09 PM, Mark Feblowitz
>> <[email protected]> wrote:
>> > I’ve just been trying out Thomas Fritz’ node-sparql-client,
>> https://github.com/thomasfr/node-sparql-client. I’ve wrapped it for
>> node-red.
>> >
>> > I’ve noticed a bug or two, but it does the basic job just fine.
>> >
>> > Mark
>> >
>> >
>> >> On Feb 17, 2015, at 2:47 AM, Nauman Ramzan <[email protected]>
>> wrote:
>> >>
>> >> Hi !
>> >> I know this platform is for jena. But I am sending because people who
>> are
>> >> working on jena may be they are also working on nodeJS app.
>> >> My question is can some one help me to find a good module which is
>> working
>> >> great with jena fuseki?
>> >>
>> >> Thanks in advance
>> >>
>> >> Regards
>> >> Nauman
>> >
>>

Reply via email to