Skip to content
New issue

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

Make .get() match LevelGraph and levelgraph-n3 APIs #64

Open
BigBlueHat opened this issue Mar 30, 2017 · 0 comments
Open

Make .get() match LevelGraph and levelgraph-n3 APIs #64

BigBlueHat opened this issue Mar 30, 2017 · 0 comments

Comments

@BigBlueHat
Copy link
Member

levelgraph-jsonld uses db.jsonld.get("...@id value..."), but levelgraph (db.get()) and levegraph-n3 (db.n3.get()) require an SPO object with at least subject set (ex: {subject: "...@id value..."}).

Additionally, if you pass any string (instead of an object) to these other .get() APIs, you will get the entire database of results (possibly a very costly situation...).

I do like the simpler code (avoiding the object expression), but object-based approach is also useful when you're already dealing with them.

So, I'd propose that we:

  • make db.jsonld.get() support both a string and the {subject: ""} style
  • make db.get() and db.n3.get() handle a string--which would map to {subject: ""} internally (a short hand for that...essentially).

That would:
a) clear up confusion
b) avoid full-db return results
c) clear up confusion 😉

Thoughts? 💭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant