← Back to demo

Cross-Dataspace SPARQL Query

A single SPARQL SELECT traverses the assembly graph and retrieves material properties from both dataspaces — no UNION needed because both PMDCO pipelines produce the same predicate pattern.

1. Why one traversal path covers both dataspaces

Both the Catena-X and Manufacturing-X pipelines produce PMDCO-conformant RDF that follows the same graph pattern: the component is linked to a material entity via BFO part-whole relations; the material carries its qualities via obo:RO_0000086; each quality is measured as an OBI datum; and the datum has a QUDT QuantityValue with qudt:numericValue.

# Shared pattern — identical for both Catena-X and Manufacturing-X
?component  obo:BFO_0000051  ?mat .
?mat        obo:RO_0000086   ?quality .
?quality    obo:IAO_0000417  ?datum .
?datum      obo:OBI_0001938  ?qv .
?qv         qudt:numericValue  ?value .

Because both datasets land on this identical predicate chain, the query needs no UNION. The two components — Pulley Wheel from Catena-X and Tensioner Bracket from Manufacturing-X — are found by traversing the assembly graph, and the same triple pattern retrieves material properties from both named graphs in a single pass.

The shared quality type IRIs — tto:TTO_0000053 for tensile strength, tto:TTO_0000009 for yield strength, pmd:PMD_0000618 for elastic modulus, etc. — allow a VALUES filter to select only the properties of interest and attach human-readable labels to them regardless of which dataspace they came from.

2. The full query

PREFIX rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX obo:   <http://purl.obolibrary.org/obo/>
PREFIX pmd:   <https://w3id.org/pmd/co/>
PREFIX tto:   <https://w3id.org/pmd/tto/>
PREFIX qudt:  <https://qudt.org/schema/qudt/>
PREFIX ex:    <http://example.org/assembly/>

SELECT ?componentLabel ?materialLabel ?property ?value ?unitLabel
FROM <urn:graph:assembly>
FROM <urn:graph:catx>
FROM <urn:graph:mfgx>
WHERE {
  # Start from the assembly: Tension Pulley has two components
  ex:TensionPulley_001 obo:BFO_0000051 ?component .
  ?component rdfs:label ?componentLabel .

  # Each component has a material entity (BFO part-of)
  ?component obo:BFO_0000051 ?mat .
  ?mat rdfs:label ?materialLabel .

  # Material carries qualities → OBI datums → QUDT quantity values
  ?mat obo:RO_0000086 ?quality .
  ?quality a ?qualityType .
  ?quality obo:IAO_0000417 ?datum .
  ?datum obo:OBI_0001938 ?qv .
  ?qv qudt:numericValue ?value .
  OPTIONAL { ?qv qudt:unit ?unit .
    BIND(REPLACE(STR(?unit), "^.*/", "") AS ?unitLabel) }

  # Filter to known quality types and attach human-readable property names
  VALUES (?qualityType ?property) {
    (tto:TTO_0000009  "yield strength")
    (tto:TTO_0000033  "elongation at fracture")
    (tto:TTO_0000053  "tensile strength")
    (pmd:PMD_0000618  "elastic modulus")
    (pmd:PMD_0000851  "melting point")
    (pmd:PMD_0000518  "impact strength")
  }
}
ORDER BY ?componentLabel ?property

3. The result

Six rows covering both components: three polymer properties from Catena-X (elastic modulus, impact strength, melting point) and three steel properties from Manufacturing-X (elongation at fracture, tensile strength, yield strength). The column names correspond directly to the SPARQL SELECT bindings.

?componentLabel ?materialLabel ?property ?value ?unitLabel
Pulley WheelPA6GF30 (Z1234)elastic modulus9800MegaPA
Pulley WheelPA6GF30 (Z1234)impact strength74000J-PER-M2
Pulley WheelPA6GF30 (Z1234)melting point223DEG_C
Tensioner BracketSteel 316/4401elongation at fracture60
Tensioner BracketSteel 316/4401tensile strength632
Tensioner BracketSteel 316/4401yield strength276

Blue rows: Catena-X / PA6GF30. Purple rows: Manufacturing-X / Steel 316/4401. Both materialised from the same PMDCO ontology — same graph topology, one query path. Unit labels are blank for Manufacturing-X rows because that dataset uses obo:IAO_0000039 for the unit predicate rather than qudt:unit.

4. In-browser triplestore (Oxigraph WASM)

This demo runs entirely in the browser — no server required. The triplestore is Oxigraph 0.5.11 compiled to WebAssembly, loaded via a Web Worker. Each dataset is fetched as a Turtle file and loaded into a named graph; the SPARQL query runs inside the worker and returns a JSON result set to the main thread.

Named graphs in the store at query time: urn:graph:catx-samm ← assets/data/catx-samm.ttl + catx-samm-model.ttl (CatX SAMM/RDF staging + aspect model) urn:graph:mfgx-aas ← assets/data/mfgx-aas.ttl (MfgX AAS/RDF staging) urn:graph:assembly ← assets/data/assembly.ttl (company product KG) urn:graph:pmdco-ontology ← assets/data/pmdco-ontology.ttl (PMDCO 3.0 ontology) urn:graph:tto-ontology ← assets/data/tto-ontology.ttl (TTO ontology) urn:graph:catx ← written by PMDCO Transform INSERT (CatX PMDCO output) urn:graph:mfgx ← written by PMDCO Transform INSERT (MfgX PMDCO output)

Three FROM clauses merge the assembly, CatX PMDCO, and MfgX PMDCO named graphs into the query's default dataset — so the WHERE clause needs no GRAPH pattern to traverse across all three.

The two staging graphs are also queryable independently for round-trip verification: urn:graph:catx-samm supports reconstruction of the original CatX SAMM JSON payload; urn:graph:mfgx-aas supports reconstruction of the MfgX mechanical test results and chemical composition. Both queries run from the KG Inspector panel and assert the result against the reference files from the data portal.