Code Monkey home page Code Monkey logo

Comments (5)

lanthaler avatar lanthaler commented on July 23, 2024

That was a deliberate design decision. Blank node identifiers are a serialization fragment.. they are not stable identifiers and as such you shouldn’t use them. You have to keep a reference to a blank node (or navigate to it via some other nodes) if you need it. What problem are you trying to solve that requires this?

from jsonld.

indeyets avatar indeyets commented on July 23, 2024

Well, that's what I do right now.

I implemented json-ld serialisation for EasyRDF. see https://github.com/njh/easyrdf/blob/master/lib/EasyRdf/Serialiser/JsonLd.php#L66

I iterate over EasyRDF nodes, create corresponding JsonLd nodes and then export the document. Blank nodes needs to be consistent, so I do manual tracking right now, but I hoped to move the burden to the library :)

from jsonld.

lanthaler avatar lanthaler commented on July 23, 2024

I understand. Nevertheless I‘m a bit reluctant to make that change as it easily yields to wrong results if you, e.g., merge two graphs. It also makes it difficult to rely on the consistency of the graph if it is used in different places (code written by different people). If by coincidence the same bnode ID is used twice, the properties are merged on a single node instead of creating two nodes.

Wouldn't subclassing Graph and overriding the createNode method solve your problem in quite an elegant way?

from jsonld.

indeyets avatar indeyets commented on July 23, 2024

Wouldn't subclassing Graph and overriding the createNode method solve your problem in quite an elegant way?

It would have solved for a one-shot application, but I don't think that would be a good choice for a framework code, as it will start to ignore any changes that you implement in this method in newer versions. Current solution with external caching is more robust, as it relies only on interface.

I understand your reasons. So I'll close the issue. thanks

from jsonld.

lanthaler avatar lanthaler commented on July 23, 2024

It would have solved for a one-shot application, but I don't think that
would be a good choice for a framework code, as it will start to ignore
any changes that you implement in this method in newer versions.

You are of course completely right.

Current solution with external caching is more robust, as it relies only
on interface.
I understand your reasons. So I'll close the issue. Thanks

Thank you for integrating this into EasyRDF!

from jsonld.

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.