-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
506 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* A blank node identifier is a string starting with `"_:"` | ||
* | ||
* @see https://json-ld.github.io/json-ld.org/spec/latest/json-ld/#dfn-blank-node-identifiers | ||
*/ | ||
export type BlankNodeIdentifier = `_:${string}`; | ||
|
||
/** | ||
* A blank node is a node with `@id` starting with `"_:"` | ||
* | ||
* @see https://json-ld.github.io/json-ld.org/spec/latest/json-ld/#dfn-blank-nodes | ||
*/ | ||
export type BlankNode = { '@id': BlankNodeIdentifier }; |
92 changes: 92 additions & 0 deletions
92
packages/component/src/Utils/JSONLinkedData/__snapshots__/dereferenceBlankNodes.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should dereference unconnected blank nodes in array in cyclic fashion 1`] = ` | ||
Object { | ||
"@type": "Book", | ||
"about": Array [ | ||
Object { | ||
"@id": "_:isaac", | ||
"@type": "Person", | ||
"name": "Isaac Stevens", | ||
"worksFor": Object { | ||
"@id": "_:uw", | ||
"@type": "Organization", | ||
"founder": [Circular], | ||
"name": "University of Washington", | ||
}, | ||
}, | ||
Object { | ||
"@id": "_:uw", | ||
"@type": "Organization", | ||
"founder": Object { | ||
"@id": "_:isaac", | ||
"@type": "Person", | ||
"name": "Isaac Stevens", | ||
"worksFor": [Circular], | ||
}, | ||
"name": "University of Washington", | ||
}, | ||
], | ||
"author": Object { | ||
"@type": "Person", | ||
"name": "Edmond S. Meany", | ||
}, | ||
"name": "Governors of Washington: territorial and state", | ||
} | ||
`; | ||
|
||
exports[`should dereference unconnected blank nodes in cyclic fashion 1`] = ` | ||
Object { | ||
"@type": "Book", | ||
"author": Object { | ||
"@id": "_:isaac", | ||
"@type": "Person", | ||
"name": "Isaac Stevens", | ||
"worksFor": Object { | ||
"@id": "_:uw", | ||
"@type": "Organization", | ||
"founder": [Circular], | ||
"name": "University of Washington", | ||
}, | ||
}, | ||
"name": "Report of Explorations for a Route for the Pacific Railroad near the 47th and 49th Parallels of North Latitude, from St. Paul, Minnesota, to Puget Sound", | ||
"sourceOrganization": Object { | ||
"@id": "_:uw", | ||
"@type": "Organization", | ||
"founder": Object { | ||
"@id": "_:isaac", | ||
"@type": "Person", | ||
"name": "Isaac Stevens", | ||
"worksFor": [Circular], | ||
}, | ||
"name": "University of Washington", | ||
}, | ||
} | ||
`; | ||
|
||
exports[`should dereference unconnected blank nodes in the graph 1`] = ` | ||
Array [ | ||
Object { | ||
"@id": "_:isaac", | ||
"@type": "Person", | ||
"name": "Isaac Stevens", | ||
"worksFor": Object { | ||
"@id": "_:uw", | ||
"@type": "Organization", | ||
"founder": [Circular], | ||
"name": "University of Washington", | ||
}, | ||
}, | ||
Object { | ||
"@id": "_:uw", | ||
"@type": "Organization", | ||
"founder": Object { | ||
"@id": "_:isaac", | ||
"@type": "Person", | ||
"name": "Isaac Stevens", | ||
"worksFor": [Circular], | ||
}, | ||
"name": "University of Washington", | ||
}, | ||
] | ||
`; |
Oops, something went wrong.