Skip to content

New test: frame-g010: Multiple named graphs #663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from Jul 11, 2018
Merged

New test: frame-g010: Multiple named graphs #663

merged 2 commits into from Jul 11, 2018

Conversation

pjohnston-wiley
Copy link
Contributor

This follows on from a bug and fix i filed on pyld: issue 81. At @davidlehn 's request i am submitting the test so that future implementations don't make the same mistake.

As far as i can tell there aren't any tests that deal with multiple named graphs yet, so i hope this is useful. Please note that none of the following implementations currently comply with what i think should be the results:

  • Stable JSON-LD playground processes the data OK, but omits the children of the two named graphs' @graphs.
  • Dev JSON-LD playground barfs. Unless i am missing something in the frame definition (entirely possible), the error message seems to indicate it has lost a property in its lookup table somewhere in applying the framing algorithm. I saw this on some occasions in pyld, though i cannot currently reproduce it there.

TypeError: Cannot read property 'https://json-ld.org/playground-dev/Montague' of undefined

  • For pyld, for it to pass i had to explicitly add {"pruneBlankNodeIdentifiers": true} to the framing tests, as well as applying my proposed fix. Since this is being removed from the spec, i figure the implementation itself will catch up in a future iteration.

"@graph": [
{
"@graph": [
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way the algorithm works, this graph object should come at the end of the array, as the node object values of the top-level @graph are processed in lexicographical order. The first entry gets a blank-node, assigned as _:b0, so the keys of the object map are ["ActTwo", "Capulet", "Montague", "Person", "_:b0"], when sorted, they have the same order.

Otherwise, this looks correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch, i missed the intermediate@id insertion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gkellogg pushed it now

@gkellogg
Copy link
Member

@pjohnston-wiley do you plan to update this PR?

@gkellogg
Copy link
Member

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants