Callidon / sparql-engine

🚂 A framework for building SPARQL query engines in Javascript/Typescript
https://callidon.github.io/sparql-engine
MIT License
99 stars 14 forks source link

Documentation / help on how to use in the browser #75

Open tfrancart opened 2 years ago

tfrancart commented 2 years ago

Is your feature request related to a problem? Please describe.

It's not related to a problem, but I would like documentation or examples on how to use sparql-engine + N3.js in the browser.

Describe the solution you'd like

A documentatio/example HTML page that demonstrates how to :

  1. Init an N3 storage + sparql-engine on top of that
  2. Load an RDF file from a URL in the N3 storage
  3. Executes a SPARQL query
  4. Shows the necessary Javascript files to do that (from a CDN ? needs to be compiled locally ?)

Describe alternatives you've considered

-

Additional context

My goal is to use a local SPARQL-compliant triplestore to execute SPARQL queries built with Sparnatural : https://github.com/sparna-git/Sparnatural

ccing @dwhitney As I read in another issue you are caching local data in the browser, so maybe you could share an example ?

Thanks for your help !

tfrancart commented 1 year ago

@Callidon I was wondering if you help with this issue ? My first attempt at compiling the beast are a failure, I tried

npm install
npm run build

But got a bunch of errors like these:

node_modules/@types/lodash/common/object.d.ts:2429:67 - error TS1005: ';' expected.

2429          * This method is like `_.update` except that it accepts `customizer` which is
                                                                       ~~~~~~~~~~

node_modules/@types/lodash/common/object.d.ts:2430:47 - error TS1005: ';' expected.

2430          * invoked to produce the objects of `path`.  If `customizer` returns `undefined`
lucafabbian commented 1 year ago

@tfrancart I managed to get it working. Check my fork here https://lucafabbian.github.io/sparql-engine/browser/example.html

tfrancart commented 1 year ago

Thanks @lucafabbian ! I grabbed the sparqlEngine.js from your deployment as I am still not able to compile. And for the moment it seems to do the trick, so thanks !