Skip to content

Data Model

Sample datasets and the knowledge graph structure.

Dual Graph Architecture

The system uses a single Oxigraph store with two named graphs:

Schema Graph (<urn:graph:schema>)

Contains the ontology definitions — OWL class hierarchies, SHACL shapes with sh:in value constraints, property definitions. Raw SHACL files are read directly for the LLM prompt (via SHACL reader), and schema-queries.ts runs SPARQL against this graph to derive asset domains, domain references, shape groups, and other compiler metadata.

Default Graph (instance data)

Contains 358 simulation assets — the actual data that users search (exact counts track the sample TTL files and may shift as they evolve):

Asset TypeCountExample Properties
HD Maps165roadTypes, laneCount, formatType, country, length
Environment Models70terrainType, vegetationType, weatherCondition
OSI Traces53roadTypes, granularity, fileFormat, numberFrames
Scenarios50scenarioCategory, weather, timeOfDay
Surface Models20materialType, frictionCoefficient, textureFormat

RDF Structure

Each asset in the demo dataset follows the ENVITED-X pattern:

turtle
# An HD Map asset
<did:web:provider35.net:HdMap:karlsruhe-parking-garage-001> a hdmap:HdMap ;
  rdfs:label "Karlsruhe Parking Garage HD Map"@en ;
  hdmap:hasResourceDescription [
    a envited-x:ResourceDescription ;
    gx:name "Karlsruhe Parking Garage HD Map" ;
    gx:license "CC0-1.0"
  ] ;
  hdmap:hasDomainSpecification [
    a hdmap:DomainSpecification ;
    hdmap:hasContent [
      a hdmap:Content ;
      hdmap:roadTypes "custom" ;
      hdmap:laneCount 3 ;
      hdmap:trafficDirection "right-hand"
    ] ;
    hdmap:hasFormat [
      a hdmap:Format ;
      hdmap:formatType "Lanelet2"
    ] ;
    hdmap:hasGeoreference [
      a georeference:Georeference ;
      georeference:hasProjectLocation [
        a georeference:ProjectLocation ;
        georeference:country "DE" ;
        georeference:region "Baden-Wuerttemberg"
      ]
    ]
  ] .

Dataset Sources

Ontology schema files are resolved from ontology-sources.json. Runtime sample instance data is loaded by packages/search/src/data-loader.ts, which prefers JSON-LD files and falls back to the equivalent Turtle, from packages/search/data/:

  • sample-hdmap.jsonld — HD maps
  • sample-scenarios.jsonld — scenarios (each embedding the HD maps and environment models it references)
  • sample-ositrace.jsonld — OSI traces
  • sample-environment-models.jsonld — environment models
  • sample-surface-models.jsonld — surface models

Because the scenario file embeds the assets it references, the loaded store reports more HD maps (165) and environment models (70) than the standalone HD-map and environment-model files contain. Parallel .ttl files are kept as a fallback for environments without JSON-LD support.

SPARQL Store Abstraction

The SparqlStore interface decouples the application from any specific triplestore:

typescript
interface SparqlStore {
  query(sparql: string): Promise<SparqlResults>
  update(sparql: string): Promise<void>
  loadTurtle(data: string, graphUri?: string): Promise<void>
  loadJsonLd(data: string, graphUri?: string): Promise<void>
  isReady(): Promise<boolean>
}
ImplementationDescription
OxigraphStoreWASM-based, runs in-process, zero infrastructure
RemoteSparqlStoreHTTP client for any SPARQL 1.1 endpoint
CachedSparqlStoreLRU query cache decorator (wraps either)

Query Results

SPARQL SELECT queries return bindings as key-value pairs, streamed via SSE:

json
[
  {
    "asset": "manifest:asset-autobahn-a9",
    "name": "Autobahn A9 Munich-Nuremberg",
    "roadTypes": "motorway",
    "country": "DE"
  },
  {
    "asset": "manifest:asset-i95",
    "name": "US Interstate I-95 Section",
    "roadTypes": "interstate",
    "country": "US"
  }
]