Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
victor felder
@vhf
I think this discussion is relevant to your question: rdfjs/dataset-spec#23
That part of the spec is still WIP, any input is welcome on this. My implementation of equals compares the toCanonical version of both but this might change. toCanonical doesn't canonicalize the graph, that's correct, similar to toString
Eric Prud'hommeaux
@ericprud
so in your implementation, there's no apparent rewriting of bnode labels in either this or the argument?
victor felder
@vhf
I think toCanonical does rewrite bnodes, it uses https://github.com/digitalbazaar/rdf-canonize under the hood
Eric Prud'hommeaux
@ericprud
If rdf-canonize() makes a new canonical copy of the original, calling .toCanonical() won't modify the argument; so that argument can be thought of as immutable.
victor felder
@vhf
Yes, that argument should be thought of as immutable. This is why we added these notes making implementers aware that they should think of the argument as immutable.
Eric Prud'hommeaux
@ericprud
but the .equals() text sort of overrides that by suggesting bnode rewrite
i'm trying to figure out the details of the current plan for .equals(), to the extent those details have been considered.
victor felder
@vhf
I see your point now, I agree it could be made clearer. This: Blank Nodes will be normalized. should be taken as Copies of this and the argument will be compared after blank nodes normalization, the normalization shouldn't be applied to the originals, they shouldn't be modified.
Let's try to make the final version better than the WIP once we agree on what exactly .equals should compare
Eric Prud'hommeaux
@ericprud
sounds good. i weighed in on that as well. tx for the pointer
Austin Wright
@awwright
Why does RDF Dataset Normalization apply to us? Two bnodes can have the same label and still be different bnodes.
Or more specifically, bnode labels are a property of the media type, if any are defined at all. [ ] is an example of an unlabeled bnode in Turtle. The label doesn't exist in RDF proper, and since RDFjs isn't a serialization, I'm not sure it makes sense to have process-wide bnode labels.
Eric Prud'hommeaux
@ericprud
The RDF spec documents how the outside world should interact with RDF graphs. The practical programmer interface can be much more intimate.
Eric Prud'hommeaux
@ericprud
I believe that not having bnodes in the process would mean you can't use bnodes. If you get a quad with a bnode back from getQuads(), you expect to be able to identify that bnode in subsequent getQuads(), removeMatching(), addAll(), etc
otherwise, getting a bnode back would basically be a dead end.
Austin Wright
@awwright
New version of "rdf" out with Dataset, Quad, factory, Graph#simplyEntails, TermMap, PrefixMap, and several improvements: https://yarnpkg.com/en/package/rdf
Please test and submit feedback :)
elf Pavlik
@elf-pavlik
:clap: :clap: :clap:
Angelo Veltens
@angelo-v
Hi, I am trying to use fetch-lite in a browser environment. What I got from the readme it is meant to work there.
Unfortunately I am getting an error, because the finished imported here from readable-stream is undefined.
finished is somehow not exported in the browsers version, see https://github.com/nodejs/readable-stream/blob/master/readable-browser.js
cc @bergos
Tomasz Pluskiewicz
@tpluscode
would be nice if you could share a stackblitz or smth which reproduces the problem
readable-stream is yet another package? how are you serving your code? webpack?
Angelo Veltens
@angelo-v
yep tested with webpack dev server so far, I could prepare an example, just wanted to be sure that this is nothing obvious
Tomasz Pluskiewicz
@tpluscode
have not had this myself and I've used those packages in web projects
Angelo Veltens
@angelo-v
ok, good to know this :thumbsup:
getting a different error at stackblitz... https://stackblitz.com/edit/react-5hkahd?file=index.js
Tomasz Pluskiewicz
@tpluscode
well damn ;)
victor felder
@vhf
I think you have to tell webpack to transpile fetch-lite
Tomasz Pluskiewicz
@tpluscode
doesn't stackblitz do that?
victor felder
@vhf
I'd be suprised it does by default, node_modules should default to being excluded from transpilation steps
This seems relevant: facebook/create-react-app#6195
Angelo Veltens
@angelo-v
transpile to what? Its ES5 already if I see this correctly
Thomas Bergwinkl
@bergos
@angelo-v i'm not an webpack expert, but if the readable-browser.js code is used for readable stream, then the original package, which is also for the browser, got overwritten. here the package.json: https://github.com/rdfjs/fetch-lite/blob/master/package.json#L29 and the actual code which should be used: https://www.npmjs.com/package/readable-stream
Angelo Veltens
@angelo-v
You are right, @bergos this is the library, but it is actually used. The thing is, it overrides the readable.js with a readable-browser.js in it's own package.json (see https://github.com/nodejs/readable-stream/blob/c7dee8c4d0e7315ab7ebf6ea3eb3c9669f00fb96/package.json#L57). And the readable-browser.js does not export finished for some reason. Not sure if this is intentionally or a bug, I will file an issue there to clarify this
Angelo Veltens
@angelo-v
victor felder
@vhf

transpile to what? Its ES5 already if I see this correctly

It's ES2017 (which makes it ES8 I guess) but more importantly the transpile step could add the polyfills for Buffer, etc.

Angelo Veltens
@angelo-v
yeah, the polyfills seam to be missing at stackblitz, but this is not the case in my real app. There I just have the issue with the missing finished from readable-stream.
Thomas Bergwinkl
@bergos
@angelo-v thanks for creating the issue. i started to use the function also in some other packages (not rdfjs), hopefully prevents any trouble for these packages.
also i still don't get why it get's overwritten with the code you posted the link to. the idea of the readable-stream package is to have a stream implementation which is consistent on all node versions and in the browser. if it gets overwritten, it's almost like using the stream package and rely on the node version people are using.
Angelo Veltens
@angelo-v
The code base that is re-exported in readable-browser.js is the same as in readable.js so it should be no difference. It's just that some parts in readable-browser.js are missing for unknown reason. But good question, why even having the readable-browser.js if it exports the same?
Thomas Bergwinkl
@bergos
yes. i think the code is there to map the stream package to readable-browser.js. maybe made sense once, but maybe it's better now to just map stream to readable-stream.
Tomasz Pluskiewicz
@tpluscode
oh bugger, I just got the same problem with finished
@angelo-v what do I need to do?
Angelo Veltens
@angelo-v
@tpluscode you need to support this PR :)
Tomasz Pluskiewicz
@tpluscode
really. anything we can do on our end @bergos ?
Thomas Bergwinkl
@bergos
@tpluscode i'm not an webpack expert, but maybe it could be solved somehow via the resolve logic/config: https://webpack.js.org/configuration/resolve/
Angelo Veltens
@angelo-v
I do not think so. Even if we manage to enforce readable.js instead of readable-browser.js, it will fail in the browser, because there is no process.env