We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
db.search()
Essentially, it'd be nice to do something like this: https://github.com/mcollina/levelgraph-n3#exporting-ntriples-from-levelgraph
But I'm finding it tricky to accomplish using "raw" jsonld.js stuff coupled with the output of search.
However, even if it's possible via db.search() + jsonld.* (something), it'd be super to have this streamlined in some way, so that's more intuitive.
jsonld.*
The text was updated successfully, but these errors were encountered:
What I'm doing now (fwiw) is using db.search (or db.nav) to get the subjects I want and then using db.jsonld.get to create the JSON-LD output.
db.search
db.nav
db.jsonld.get
It's working well enough atm, but I'm not sure how (yet) to best turn that into a db.jsonld.search() method. Ideas welcome! 💡
db.jsonld.search()
Sorry, something went wrong.
Just hacked this together in a local copy of the playground + term() from https://github.com/warpr/turtle-to-jsonld/blob/master/lib/turtle-to-jsonld.js#L20-L45 for expanding the SPO to match what jsonld.js uses internally:
term()
db.search([{subject: db.v('s'), predicate: db.v('p'), object: db.v('o')}], {}, (err, rv) => { var graphs = []; rv.forEach((spo) => { graphs.push({subject: term(spo.s), predicate: term(spo.p), object: term(spo.o)}); }); jsonld.fromRDF({'@default': graphs}, console.log); });
The results seem accurate...so I'll try and hack this in + tests. However, before I dig too deeply, I'd appreciate any input on API preferences.
No branches or pull requests
Essentially, it'd be nice to do something like this:
https://github.com/mcollina/levelgraph-n3#exporting-ntriples-from-levelgraph
But I'm finding it tricky to accomplish using "raw" jsonld.js stuff coupled with the output of search.
However, even if it's possible via
db.search()
+jsonld.*
(something), it'd be super to have this streamlined in some way, so that's more intuitive.The text was updated successfully, but these errors were encountered: