Skip to main content

CIMVocabCheck

Static SPARQL and SHACL validation against RDFS / CIM profile schemas. CIMVocabCheck answers the question "does this query (or shapes graph) make sense for the schema I'm working with?"without executing anything and without needing any RDF data.

It catches mistakes at development time, in unit tests, or in CI: unknown classes and properties, domain/range violations, datatype mismatches, invalid SHACL cardinalities, and typos in the standard rdf:/rdfs:/owl:/sh: vocabularies.

CIMVocabCheck ships in several forms:

FormWhat it isPage
Librarycimvocabcheck-core — the validation engine, callable from JavaLibrary & tests · API
CLIcimvocabcheck-cli — a command-line tool for CI pipelinesCLI
CIMLangServercimvocabcheck-lsp — an LSP 3.17 server over stdioLanguage server
EditorsThe CIMNotebook VS Code extension & IntelliJ plugin front the language serverCIMNotebook

Inspired by gdotv's "SPARQL Query Guardrails".

Why static validation?

Running a SPARQL query against a triplestore does not tell you whether the query is correct for your schema — a typo'd property name simply returns no rows. CIMVocabCheck compares every class and property IRI in your query or shapes graph against the schema and reports what doesn't fit.

ConcernCIMVocabCheckSPARQL executionSHACL validation
Needs an RDF dataset
Needs a schema (RDFS / profile)✅ (shapes)
Detects unknown class / property IRI❌ (returns ∅)
Detects domain / range mismatch
Detects bad data values

CIMVocabCheck is complementary to SHACL data validation, not a replacement: it validates the query/shape itself against the schema, where SHACL validates data against shapes.

What it checks

  • Existence — every class and property IRI must exist in the selected profiles.
  • Semanticsrdfs:domain / rdfs:range / rdfs:subClassOf compatibility, implied types, datatype mismatches.
  • SHACL structuresh:targetClass, sh:class, sh:path, node-kind vs range, cardinality.
  • Embedded SPARQLsh:sparql, sh:target, sh:validator, sh:rule fragments are extracted and fully validated.
  • Standard vocabularies — typos like rdf:typ or sh:minCountt are flagged against the official W3C vocabularies.

See Validation checks for the complete catalogue of diagnostic codes, and Known limitations for what is intentionally not checked.

Next steps