Graph Databases
Resolve resource dependencies from RDF records
BOTIE
Examples, experiments and workspace controls
Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.
Try your own inputs
Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.
Context for this challenge
Project expanded IRI statements into a graph. Notice that identical statements collapse and literal objects are excluded from this particular projection.
The same identifier text occurs as a resource and as a literal.
Inspect the component calculation
Project resource triples as a graph( Expanded RDF triple records: Expanded statement records )
Examples and results
- Expanded statement records
[ { "s": "https://perceptronlab.example/P7", "p": "https://perceptronlab.example/dependsOn", "o": "https://perceptronlab.example/S1", "kind": "iri" }, { "s": "https://perceptronlab.example/P8", "p": "https://perceptronlab.example/dependsOn", "o": "https://perceptronlab.example/S1", "kind": "iri" }, { "s": "https://perceptronlab.example/P7", "p": "https://perceptronlab.example/dependsOn", "o": "https://perceptronlab.example/S1", "kind": "iri" }, { "s": "https://perceptronlab.example/P9", "p": "https://perceptronlab.example/dependsOn", "o": "https://perceptronlab.example/S1", "kind": "literal" }, { "s": "https://perceptronlab.example/P7", "p": "https://perceptronlab.example/near", "o": "https://perceptronlab.example/S2", "kind": "iri" } ]- Required result
Nodes and properties (4)
- https://perceptronlab.example/P7 · Resource
- https://perceptronlab.example/S1 · Resource
- https://perceptronlab.example/P8 · Resource
- https://perceptronlab.example/S2 · Resource
- https://perceptronlab.example/P7 to https://perceptronlab.example/S1: https://perceptronlab.example/dependsOn
- https://perceptronlab.example/P8 to https://perceptronlab.example/S1: https://perceptronlab.example/dependsOn
- https://perceptronlab.example/P7 to https://perceptronlab.example/S2: https://perceptronlab.example/near
Inspect the node and relationship records
{ "nodes": [ { "id": "https://perceptronlab.example/P7", "kind": "Resource" }, { "id": "https://perceptronlab.example/S1", "kind": "Resource" }, { "id": "https://perceptronlab.example/P8", "kind": "Resource" }, { "id": "https://perceptronlab.example/S2", "kind": "Resource" } ], "edges": [ { "id": "[\"https://perceptronlab.example/P7\",\"https://perceptronlab.example/dependsOn\",\"https://perceptronlab.example/S1\"]", "source": "https://perceptronlab.example/P7", "target": "https://perceptronlab.example/S1", "type": "https://perceptronlab.example/dependsOn" }, { "id": "[\"https://perceptronlab.example/P8\",\"https://perceptronlab.example/dependsOn\",\"https://perceptronlab.example/S1\"]", "source": "https://perceptronlab.example/P8", "target": "https://perceptronlab.example/S1", "type": "https://perceptronlab.example/dependsOn" }, { "id": "[\"https://perceptronlab.example/P7\",\"https://perceptronlab.example/near\",\"https://perceptronlab.example/S2\"]", "source": "https://perceptronlab.example/P7", "target": "https://perceptronlab.example/S2", "type": "https://perceptronlab.example/near" } ] }
- Expanded statement records
[ { "s": "https://perceptronlab.example/P4", "p": "https://perceptronlab.example/dependsOn", "o": "https://perceptronlab.example/S2", "kind": "iri" }, { "s": "https://perceptronlab.example/P7", "p": "https://perceptronlab.example/near", "o": "https://perceptronlab.example/S2", "kind": "iri" } ]- Required result
Nodes and properties (3)
- https://perceptronlab.example/P4 · Resource
- https://perceptronlab.example/S2 · Resource
- https://perceptronlab.example/P7 · Resource
- https://perceptronlab.example/P4 to https://perceptronlab.example/S2: https://perceptronlab.example/dependsOn
- https://perceptronlab.example/P7 to https://perceptronlab.example/S2: https://perceptronlab.example/near
Inspect the node and relationship records
{ "nodes": [ { "id": "https://perceptronlab.example/P4", "kind": "Resource" }, { "id": "https://perceptronlab.example/S2", "kind": "Resource" }, { "id": "https://perceptronlab.example/P7", "kind": "Resource" } ], "edges": [ { "id": "[\"https://perceptronlab.example/P4\",\"https://perceptronlab.example/dependsOn\",\"https://perceptronlab.example/S2\"]", "source": "https://perceptronlab.example/P4", "target": "https://perceptronlab.example/S2", "type": "https://perceptronlab.example/dependsOn" }, { "id": "[\"https://perceptronlab.example/P7\",\"https://perceptronlab.example/near\",\"https://perceptronlab.example/S2\"]", "source": "https://perceptronlab.example/P7", "target": "https://perceptronlab.example/S2", "type": "https://perceptronlab.example/near" } ] }
Try a fresh construction
This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.
Stuck? Inspect a worked construction
The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.
Assumptions and test precision
These components operate on the supplied records in your browser. They do not run a graph database or interpret Cypher. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
Your last tested pieces can start the full construction. An existing draft there keeps its own pieces.
A familiar local name belongs to another vocabulary
This check uses the pieces from “Match the dependency predicate and requested resource”.
BOTIE
- Expanded statement records
[ { "s": "https://perceptronlab.example/R2", "p": "https://perceptronlab.example/dependsOn", "o": "https://perceptronlab.example/S8", "kind": "iri" }, { "s": "https://perceptronlab.example/R3", "p": "https://vendor.example/dependsOn", "o": "https://perceptronlab.example/S8", "kind": "iri" }, { "s": "https://perceptronlab.example/R4", "p": "https://perceptronlab.example/dependsOn", "o": "https://perceptronlab.example/S8", "kind": "literal" }, { "s": "https://perceptronlab.example/R2", "p": "https://perceptronlab.example/dependsOn", "o": "https://perceptronlab.example/S8", "kind": "iri" }, { "s": "https://perceptronlab.example/R5", "p": "https://perceptronlab.example/dependsOn", "o": "https://perceptronlab.example/S8", "kind": "iri" } ]- Requested resource IRI
https://perceptronlab.example/S8
Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
Why would two distinct inspection events need more than repeating an identical RDF triple?
Preserve entity and event identity when moving between graph data models.
These components operate on the supplied records in your browser. They do not run a graph database or interpret Cypher.
Work through the Python challenges →