store.dump('application/ld+json', 'urn:graph:mfgx-aas') serialises the entire
named graph as expanded JSON-LD — every triple loaded from mfgx-aas.ttl comes
back out. The 12 expected values are then located in the node array by AAS
idShort and asserted against the original AAS inspection document.
Node B loads the AAS-ontology RDF (mfgx-aas.ttl, produced by py-aas-rdf)
into urn:graph:mfgx-aas. The round-trip uses store.dump()
(not a SPARQL query) to export the entire named graph as expanded JSON-LD. The result is
a flat array of RDF node objects — one per subject IRI — rather than the original nested
AAS hierarchy, but the data is semantically equivalent.
@context and is not valid JSON-LD, so it cannot
be loaded back into Oxigraph for a direct graph diff. Instead, 12 known Property values
are located in the dump by idShort and asserted against ground truth from
inspectiondocument_316_4401_alloy.json.
Oxigraph WASM includes a built-in JSON-LD serialiser. The call is a single JS expression — no SPARQL involved:
// Dump urn:graph:mfgx-aas as expanded JSON-LD const jsonLdStr = store.dump({ format: 'application/ld+json', from_graph_name: namedNode('urn:graph:mfgx-aas') }); const nodes = JSON.parse(jsonLdStr); // nodes is an array of expanded JSON-LD node objects, e.g.: // [{ "@id": "urn:...", "https://admin-shell.io/aas/3/0/Referable/idShort": [{"@value":"TensileStrengthMean"}], ... }, ...]
Each node corresponds to one RDF subject. Properties are keyed by their full IRI (expanded
form), and values are wrapped in {"@value": "..."} objects. The total node
count equals the number of distinct subjects in the graph.
To find a value by idShort:
const AAS_PROP_VAL = 'https://admin-shell.io/aas/3/0/Property/value'; // py-aas-rdf encodes idShort in the subject IRI — not as a separate triple. // IRIs look like: …submodel-elements/MechanicalTests.TensileTest__00__.TensileStrengthMean function findByIdShort(nodes, idShort) { const node = nodes.find(n => { const id = n['@id'] ?? ''; return id.endsWith('.' + idShort) || id.endsWith('/' + idShort); }); return node ? Number(node[AAS_PROP_VAL]?.[0]?.['@value']) : null; }
The dump returns all nodes in the graph. The 12 values located by idShort:
| Section | Key | Value |
|---|---|---|
| mechanicalTests | TensileStrengthMean | 632 |
| mechanicalTests | YieldOrProofStrengthMean | 276 |
| mechanicalTests | ElongationAfterFractureMean | 60 |
| chemicalAnalysis | MassFraction_C | 0.022 |
| chemicalAnalysis | MassFraction_Cr | 16.9 |
| chemicalAnalysis | MassFraction_Mn | 1.51 |
| chemicalAnalysis | MassFraction_Mo | 2.01 |
| chemicalAnalysis | MassFraction_N | 0.024 |
| chemicalAnalysis | MassFraction_Ni | 10 |
| chemicalAnalysis | MassFraction_P | 0.036 |
| chemicalAnalysis | MassFraction_S | 0.002 |
| chemicalAnalysis | MassFraction_Si | 0.4 |