Sparql-fiddle - an online app and code library

Please try out sparql-fiddle - an online app and gerneral purpose library for using SPARQL with Solid PODs, in-memory strings, and other sources.

The online app allows you to create RDF and SPARQL or load them from Solid, run the queries view the results, edit either the data or the query, re-run, rinse and repeat. It includes a few examples, more coming.

The code library is entirely based on rdflib.js so can run either in a browser or from the command line. It provides functions to run SPARQL from a variety of sources with a flexible API that supports retrieving results as text, HTML or as various kinds of data structures. It also includes a way to store, retrieve, and run a library of queries.

I’d really like feedback both on the API and on the ontology I propose for a community-based sharing of queries (see the README).

Caveats: 1. the SPARQL is the subset of SPARQL supported by rdflib.js. 2. I have not (yet) implemented a planned secondary fetcher which will allow the library to support full endpoint querying with traversal of multiple URLs.

6 Likes

I’m just trying to figure this out, so hopefully my comments make sense. I wonder if it could be extended to use pipelines of queries. So the query predicate maybe could be either be a single query or a list of queries drawn from other fiddles, so if someone makes a popular one it can be reused and the results fed into additional queries.

1 Like

The Import-Button does not work for me:

TypeError: Cannot read property 'uri' of undefined

1 Like

@aveltens : Thanks MUCH for the report. Should be fixed now, sorry.

1 Like

@anon36056958 Good idea. You can accomplish that now by chaining then()s but would be great to have a pipeline.

Yes, but does the ontology need to take that into account?

Good point, yes it would.

So the query could be either a single query (or a federated one) or it could be a pipeline of queries. So a fiddle writer wouldn’t need to know or worry about what pipeline the fiddle is used in.

This could be very useful for processing text. Different queries in a pipeline could lift different entities or word phrases into the graph.

I think I’m following you. Not sure about your last sentence. Presumably, the queries are all run against the same data store so the fiddle would look something like { data : foo; query : [bar1,bar2,bar3] }. It would be that fiddle which would be shared so I’m not sure what you mean by what fiddle it is used in.

Well maybe for example someone wrote a fiddle that assumed the data is text which has been put in a rdf graph with a part of speech tagger. So you have a graph that says this is a noun, this is a verb, etc. Say for example the text is “This Solid thing is taking off”. So you know from the graph that Solid is a noun but you don’t know it is that thing that Tim Berners Lee invented. So the first fiddle might detect entities or words related to the Solid project. Then you have that in the graph after the first stage of the pipeline. But then somebody else wrote a totally unrelated fiddle with a query that can detect phrasal verbs and can see that “taking off” means “gaining momentum” instead of just the verb “taking”. Then you could use both queries from unrelated fiddles in a pipeline to understand that the sentence means the Solid project is gaining momentum.

Ah, thanks for the extended example. I’ll keep this in mind for future improvements.

It just needs the abilty to pipeline queries from unrelated fiddles. The text processing stuff would be just one use case.

Sorry, I don’t mean to be too demanding or unappreciative. It’s a great app!

1 Like

No apologies necessary, I find your suggestions very useful and welcome both your ideas and support. Thanks!