Closed marcolarosa closed 4 years ago
So it looks like lines 58 and 59 in lib/rocrate.js
are the issue in that they don't handle the fully qualified properties. So, when I change those lines to:
58 if (t === "http://schema.org/CreativeWork" && item.hasOwnProperty("http://schema.org/identifier") && item['http://schema.org/identifier'] === this.defaults.roCrateMetadataID) {
59 this._rootId = item['http://schema.org/about']["@id"];
The pointer is identified. Thoughts?
The context is that when i write the templates, I use jsonld to flatten them but that's it. Should I also be compacting them to shorten those refs or is the rocrate library supposed to handle crates in that form?
Ok - this is not an issue with the lib. I think what's happened is that (using an earlier version of jsonld) my crates were being compacted at the same time as they were flattened. Looking at the API for jsonld now it seems I need to flatten then compact the crates before writing them out.
You can close this ticket when you're ready.
I'm now seeing the above error when I wasn't a week or so ago and my templates haven't changed.
I'm using the feature/objectify branch and this is happening when I try to objectify a crate.
Here's an example:
Note the last entry in the graph - isn't that the pointer to the root dataset?