Closed vhf closed 5 years ago
Hi Thank you :) Well, it appears that the levelgraph example has not been updated after the introduction of major API changes made to the project. I will try to update it as soon as possible.
Nice, thanks in advance!
I've updated the levelgraph example in commit ff5a024a1152a08f1d6b1a8b702ec865ffeee008. It is working for me, I would be glad if you can retry with your own setup.
Thank you!
I had a few issues with the first two changes here: https://github.com/Callidon/sparql-engine/commit/ff5a024a1152a08f1d6b1a8b702ec865ffeee008#diff-51e908970d27907e5ab4a3e609e1508d
sparql-engine@0.5.3
in my project, I had to replace
- const { BindingBase, HashMapDataset, Graph, PlanBuilder, Pipeline } = require('../dist/api')
+ const { BindingBase, HashMapDataset, Graph, PlanBuilder, Pipeline } = require('sparql-engine')
level-browserify
cannot be installed by npm@6.11.3
(it's the latest one) with node@12.10.0
(again, the latest one). The issue is most probably not with NPM but with node: this package requires native building (with node-gyp
) and the node binding changed. It's not really a surprised, npm install level-browserify
shows this:
npm WARN deprecated level-browserify@2.0.0: No longer maintained: superseded by level v5.0.0
node@8.16.1
, it builds fine but doesn't run because:
Error: Could not locate the bindings file. Tried:
→ /foo/node_modules/level-browserify/node_modules/leveldown/build/leveldown.node
→ /foo/node_modules/level-browserify/node_modules/leveldown/build/Debug/leveldown.node
→ /foo/node_modules/level-browserify/node_modules/leveldown/build/Release/leveldown.node
→ /foo/node_modules/level-browserify/node_modules/leveldown/out/Debug/leveldown.node
→ /foo/node_modules/level-browserify/node_modules/leveldown/Debug/leveldown.node
→ /foo/node_modules/level-browserify/node_modules/leveldown/out/Release/leveldown.node
→ /foo/node_modules/level-browserify/node_modules/leveldown/Release/leveldown.node
→ /foo/node_modules/level-browserify/node_modules/leveldown/build/default/leveldown.node
→ /foo/node_modules/level-browserify/node_modules/leveldown/compiled/8.16.1/darwin/x64/leveldown.node
at bindings (/foo/node_modules/bindings/bindings.js:96:9)
at Object.<anonymous> (/foo/node_modules/level-browserify/node_modules/leveldown/leveldown.js:3:36)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/foo/node_modules/level-browserify/level.js:1:106)
level@5
instead works fine in my setup!
- const level = require('level-browserify')
+ const level = require('level')
With this, the example runs with node 12 and prints:
Find solutions: { '?name': '"c"' }
Find solutions: { '?name': '"d"' }
Query evaluation complete!
(This require isn't used in the example 😉 https://github.com/Callidon/sparql-engine/blob/ff5a024a1152a08f1d6b1a8b702ec865ffeee008/examples/levelgraph.js#L6 )
Thanks again!
Hello,
Since I'm have npm installed sparql-engine@0.5.3 in my project, I had to replace
- const { BindingBase, HashMapDataset, Graph, PlanBuilder, Pipeline } = require('../dist/api') + const { BindingBase, HashMapDataset, Graph, PlanBuilder, Pipeline } = require('sparql-engine')
I used the relative import for my local, but I forgot to replace it, my bad. This will be fixed.
level-browserify
cannot be installed bynpm@6.11.3
(it's the latest one) withnode@12.10.0
(again, the latest one).
About this one, I simply followed the README of levelgraph and it works well for me. Nonetheless, I will update the example with level@5
, as you suggested.
(This require isn't used in the example 😉
Whoops, my bad 😄 Another fix for me.
And voilà: I've integrated your feedback into the both examples (commit 796b690047d665cd14018f846a8e19e9f494718d).
I've also added an implementation for the Graph.insert
and Graph.delete
method in the levelgraph examples.
Let me know if you have any more suggestions/remarks on this topic!
It works well 👍
A little update on the subject. In v0.5.5, I've added a new method for using Node.JS streams in the framework. Since levelgraph has a Stream API, I've updated the levelgraph example so it can use it during SPARQL query processing. This should also improve performance!
Thanks for this great project! ❤️
Describe the bug
The levelgraph example doesn't run: https://github.com/Callidon/sparql-engine/blob/2d699c93033d8e9737f19d50395f8c4fb13d2b87/examples/levelgraph.js
To Reproduce Steps to reproduce the behavior:
sparql-engine
node levelgraph.js
Expected behavior Example should not crash.