Comments (5)
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.
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.
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.
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.
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)
- No expansion of JSON field with name "0" HOT 1
- Process very slow
- Processing fails if @protected or @version are used HOT 1
- How json minify? HOT 3
- Fatal Error - Lists are not supported by getDocument() yet HOT 1
- Failing to parse content with special chars HOT 1
- JSON-LD always framing single object as array HOT 1
- Problem parsing relative @id HOT 1
- Double-quotes need to be escaped in NQuads serialization
- User-Agent required in some Web APIs
- Schema with duplicate value causes infinite loop HOT 1
- Build failure with latest PHP HOT 3
- How to apply all known prefixes to a result set
- Compact properties, but not URIs
- Always return arrays with frame
- Support for JSON-LD 1.1 HOT 2
- Only first JSON+LD block is parsed HOT 1
- Parsing for some sites is broken, maybe a schema.org change: Loading http://schema.org failed HOT 16
- Hydra Support HOT 1
- schema.org no longer returning application/ld+json HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonld.