Coder Social home page Coder Social logo

Comments (2)

elf-pavlik avatar elf-pavlik commented on June 20, 2024

Capturing #17

@elf-pavlik: This assumes relying on hydra helper from namespaces module. At the same time I would like to understand better advantages of relying on that helper instead of keeping hydra: prefix in JSON-LD context and rely on use of CURIEs hydra.Collection (helper) vs. "hydra:Collection" (CURIE)

@alien-mcl: As for the question regarding hydra helper - it's purely for code readability and to avoid string literals flying here and there. We could have a list of constants defining each term IRI, but I thought that having a hierarchy of IRIS arranged with constant names relating to original prefixes are a better way. It has nothing to do with the JSON-LD context and it's purely for TypeScript/JavaScrpt readability while accessing some of the JSON-LD originating Javascript objects.

It seems to me that hydra namespace helper depends directly on the JSON-LD context used for framing the "hypermedia interface". Terms from hydra vocab used in that interface get matched in code against full IRIs provided by that namespace helper. In PR #17 we can see that matching against the IRIs provided by helper puts particular requirements on the JSON-LD context used for framing.

Do we intend that hydra namespace helper only gets used internally by the client or also expose it to the developers who use the client in their applications?

from heracles.ts.

alien-mcl avatar alien-mcl commented on June 20, 2024

The situation now is Heracles.ts no more uses JSON-LD framing for data model processing. The namespace helper is still used for obtaining hydra (and couple of other vocabs) specific resources, but there is no assumption for the data payload which is obtain from the server.

The response is first flattened to contextles form with all IRIs (including blank nodes) expanded and all values normalized. Then the internal engine traverse such a graph searching for resources matching hydra IRIs to build a data model. The only assumption is these resources and their matching is compliant with the spec and how they were expected to be organized.

I hope this answers your doubtes.

As for the JSON-LD context used - there is neither special requirement nor limitation on using it by other developers.

from heracles.ts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.