Skip to content

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

@BigBlueHat

Description

@BigBlueHat

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? 💭

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions