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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions test-suite/tests/frame-g010-frame.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"@context": {
"@vocab": "http://example.com/",
"loves": {
"@type": "@id"
},
"unionOf": {
"@type": "@id",
"@id": "owl:unionOf",
"@container": "@list"
},
"Class": "owl:Class"
},
"@graph": [
{
"@explicit": false,
"@embed": "@last",
"@type": [
"Act",
"Class"
],
"@graph": [{
"@explicit": true,
"@embed": "@always",
"@type": "Person",
"@id": {},
"loves": {"@embed": "@never"}
}]
}
]
}
61 changes: 61 additions & 0 deletions test-suite/tests/frame-g010-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"@context": {
"@vocab": "http://example.com/",
"loves": {
"@type": "@id"
},
"unionOf": {
"@type": "@id",
"@id": "owl:unionOf",
"@container": "@list"
},
"Class": "owl:Class"
},
"@graph": [
{
"@type": "Act",
"@graph": [
{
"@id": "Romeo",
"@type": "Person"
},
{
"@id": "Juliet",
"@type": "Person"
}
]
},
{
"@id": "ActTwo",
"@type": "Act",
"@graph": [
{
"@id": "Romeo",
"@type": "Person",
"loves": "Juliet"
},
{
"@id": "Juliet",
"@type": "Person",
"loves": "Romeo"
}
]
},
{
"@id": "Person",
"@type": "Class",
"unionOf": {
"@list": [
{
"@id": "Montague",
"@type": "Class"
},
{
"@id": "Capulet",
"@type": "Class"
}
]
}
}
]
}
69 changes: 69 additions & 0 deletions test-suite/tests/frame-g010-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"@context": {
"@vocab": "http://example.com/",
"loves": {
"@type": "@id"
},
"unionOf": {
"@type": "@id",
"@id": "owl:unionOf",
"@container": "@list"
},
"Class": "owl:Class"
},
"@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

"@id": "Juliet",
"@type": "Person",
"loves": "Romeo"
},
{
"@id": "Romeo",
"@type": "Person",
"loves": "Juliet"
}
],
"@id": "ActTwo",
"@type": "Act"
},
{
"@id": "Capulet",
"@type": "Class"
},
{
"@id": "Montague",
"@type": "Class"
},
{
"@id": "Person",
"@type": "Class",
"unionOf": [
{
"@id": "Montague",
"@type": "Class"
},
{
"@id": "Capulet",
"@type": "Class"
}
]
},
{
"@graph": [
{
"@id": "Juliet",
"@type": "Person",
"loves": null
},
{
"@id": "Romeo",
"@type": "Person",
"loves": null
}
],
"@type": "Act"
}
]
}
12 changes: 11 additions & 1 deletion test-suite/tests/frame-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,17 @@
"frame": "frame-g009-frame.jsonld",
"expect": "frame-g009-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
},{
"@id": "#tg010",
"@type": ["jld:PositiveEvaluationTest", "jld:FrameTest"],
"name": "Multiple named graphs",
"purpose": "Test embedded graphs",
"input": "frame-g010-in.jsonld",
"frame": "frame-g010-frame.jsonld",
"expect": "frame-g010-out.jsonld",
"option": {"pruneBlankNodeIdentifiers": true}
},
{
"@id": "#tp010",
"@type": ["jld:PositiveEvaluationTest", "jld:FrameTest"],
"name": "property CURIE conflict (prune bnodes)",
Expand Down