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

How should Heracle's internal data model look like? #8

Closed
lanthaler opened this issue Jul 7, 2017 · 5 comments
Closed

How should Heracle's internal data model look like? #8

lanthaler opened this issue Jul 7, 2017 · 5 comments

Comments

@lanthaler
Copy link
Member

Currently it uses JSON-LD framing to get to a specific JSON-LD representation.

@tpluscode
Copy link
Contributor

My concerns with JSON-LD API functions are that

  1. in some cases (framing in particular), objects get duplicated. that's why originally I processed the representation to create a fully navigable JavaScript object graph (aka. the objectify() function missing from JSON-LD spec)
  2. it's sometimes awkward to get the desired information from a JSON-LD tree. at least without reframing with different settings multiple times. in other words there is no one JSON-LD tree which will serve all Heracles' needs

Doing the objectify() processing allowed me to retain the JSON-LD shape whilst adding convenience getters/setters for built-in Hydra properties and also those possibly not explicitly stated in a particular representation. An example are partial collections, where additional processing allows simply traversing the collection/view objects with native JS.

And I hit an issue with 2 around collections as well when I wanted to get the parent collection from a partial view resource. At that point I resorted to SPARQL where it's a simple query with subject and object reversed. I'm sure there is a better solution though and I do hope so because the SPARQL-able implementations for browsers are lacking or quite heavy :(

@tpluscode
Copy link
Contributor

Oh, and regarding JSON-LD API functions - cycles will be a problem when representing a graph as tree. There is only as far as a frame can get us.

@elf-pavlik
Copy link
Member

In the last telecon minutes I see rdf-ext mentioned. I think @bergos would offer his help with potentially adopting it. Possibly another relevant reference - draft for RDF/JS High Level API rdfjs/data-model-spec#95

@elf-pavlik
Copy link
Member

What does it currently takes to add support for parsing responses with those content types

  • 'text/turtle'
  • 'text/trig'
  • 'text/n-triples'
  • 'text/n-quads'
  • 'text/n3' (optional)

N3.js supports parsing all of them.

@alien-mcl
Copy link
Member

As for support of other RDF serialization, I've added a separate issue #69 for that.
For the data model - JSON-LD framing is used no more for quite some time in favor of internal mechanism for build the data model used by the client internally making this issue obsolete.

For details please refer to the docs and the DataModel namespace types description.

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

4 participants