Skip to main content

Configuration (opencgmes.jsonc)

This is the canonical reference for configuring CIMVocabCheck. Every form of CIMVocabCheck — the CLI, the CIMLangServer, and the CIMNotebook editors — reads the same opencgmes.jsonc file and the same cimvocabcheck section described here.

The file

CIMVocabCheck is configured by an opencgmes.jsonc file. All settings live under a top-level "cimvocabcheck" section, so the same file can host configuration for other OpenCGMES tools:

A plain opencgmes.json (no comments) is also recognised, for tooling that generates config files without JSONC support. If both exist in the same directory, opencgmes.jsonc wins.

{
"cimvocabcheck": {
"schemasDirectory": "schemas/cgmes-3.0",
"strictness": "default"
}
}

JSON comments (//) and trailing commas are allowed.

Discovery — nearest config wins

The file is discovered git-style: CIMVocabCheck walks up the directory tree from each file being validated and uses the nearest opencgmes.jsonc. Different subtrees of a repository can therefore use different configurations. The CLI auto-discovers upward from the current working directory (or takes an explicit --config).

Generate a commented starter file with:

  • Editors: the CIMNotebook: Create Config File command (VS Code Command Palette, or IntelliJ Tools menu).
  • CLI: cimvocabcheck init.
No bundled default schema

If no config file is found (and the query declares no # [endpoint=...] directive), or the config sets no schemas, CIMVocabCheck performs a syntax-only check. There is no bundled default schema — you must point it at your CGMES profiles for schema-based validation. Other settings (like strictness and standard-vocabulary checking) still apply in syntax-only mode.

Settings

KeyTypeDefaultPurpose
schemasDirectorystringDirectory of RDFS/profile files (.rdf, .ttl, .owl)
schemasstring[]Explicit list of RDFS/profile files
strictnessenumdefaultHow findings map to severities
namedGraphsobjectMap graph IRIs / short names to profile IRIs
prefixesobject(built-in set)PREFIX declarations injected into queries
standardVocabularyenumcheckWhether to typo-check rdf/rdfs/owl/sh terms
cimNamespacesobjectMap custom cim namespace URIs to a built-in profile shape

All fields are optional. Paths are resolved relative to opencgmes.jsonc.

schemas / schemasDirectory

Point at a directory or list individual files:

{
"cimvocabcheck": {
"schemasDirectory": "schemas"
}
}
{
"cimvocabcheck": {
"schemas": [
"schemas/61970-600-2_Equipment-AP-Voc-RDFS2020.rdf",
"schemas/61970-600-2_Topology-AP-Voc-RDFS2020.rdf"
]
}
}

If you omit both, no schema is loaded and validation is syntax-only (unless a # [endpoint=...] directive supplies one).

strictness

Controls which findings are reported and how their severities are mapped:

LevelBehaviour
permissiveStructural errors only (SYNTAX_ERROR, UNKNOWN_CLASS, UNKNOWN_PROPERTY, UNKNOWN_VOCABULARY_TERM, INVALID_CARDINALITY, INVALID_VALUE_RANGE); semantic checks and hints suppressed
defaultAll findings as-is (errors are errors, warnings are warnings)
strictWarnings promoted to errors — recommended for CI
pedanticWarnings and infos/hints promoted to errors
{ "cimvocabcheck": { "strictness": "strict" } }

namedGraphs

Maps named-graph IRIs (or short relative names) to one or more profile version IRIs. When set, terms inside a GRAPH <iri> {} block are validated against only the mapped profiles:

{
"cimvocabcheck": {
"namedGraphs": {
"urn:uuid:my-equipment-graph": ["http://iec.ch/TC57/ns/CIM/CoreEquipment-EU/3.0"],
"urn:uuid:my-topology-graph": ["http://iec.ch/TC57/ns/CIM/Topology-EU/3.0"]
}
}
}

Each value is an array, so one graph can be validated against multiple profiles. Keys can be full absolute IRIs or short relative names matching how you write the graph in the query — a query using FROM NAMED <EQ> or GRAPH <EQ> {} matches the key "EQ":

{
"cimvocabcheck": {
"namedGraphs": {
"EQ": ["http://iec.ch/TC57/ns/CIM/CoreEquipment-EU/3.0"],
"TP": ["http://iec.ch/TC57/ns/CIM/Topology-EU/3.0"]
}
}
}
BehaviourWhen
All profiles, no GRAPH_NOT_CONFIGURED diagnosticsnamedGraphs not set (default)
Per-graph profiles; graphs not in the map produce GRAPH_NOT_CONFIGUREDnamedGraphs set
Don't want to map graphs by hand?

When the schema is loaded from a SPARQL endpoint, this graph→profile mapping is auto-detected from the data (each named graph is classified by its discriminating terms), so you can skip namedGraphs entirely.

prefixes

Default PREFIX declarations injected into every SPARQL query/update that does not already declare them, so you can write cim:ACLineSegment without repeating PREFIX cim: everywhere. When the field is absent, this built-in set is used:

PrefixNamespace
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfshttp://www.w3.org/2000/01/rdf-schema#
owlhttp://www.w3.org/2002/07/owl#
xsdhttp://www.w3.org/2001/XMLSchema#
shhttp://www.w3.org/ns/shacl#
cimhttp://iec.ch/TC57/CIM100#
mdhttp://iec.ch/TC57/61970-552/ModelDescription/1#

Providing an explicit "prefixes" object replaces the built-in set entirely:

{
"cimvocabcheck": {
"prefixes": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"cim": "http://iec.ch/TC57/CIM100#",
"mycim": "http://example.com/my-extension#"
}
}
}

Use {} to disable automatic prefix injection entirely. Prefixes already declared inside the query file are never overwritten.

standardVocabulary

Controls typo-checking of terms in the closed standard vocabularies (rdf, rdfs, owl, sh), validated against the official W3C vocabularies:

ValueBehaviour
check (default)Typos such as rdf:typ or sh:minCountt are reported as UNKNOWN_VOCABULARY_TERM (ERROR)
ignoreThese namespaces are accepted without inspection (legacy behaviour)
{ "cimvocabcheck": { "standardVocabulary": "ignore" } }

Open annotation/datatype namespaces (xsd, dcterms, dc, skos, dcat, and the IEC extension namespaces) are always accepted regardless of this setting. The vendored W3C vocabulary documents are redistributed under the W3C Software and Document License.

cimNamespaces

Schema files and endpoint graphs are only parsed if their cim namespace is known to CIMXML's CimNamespaceFactoryRegistry — out of the box that's just the three well-known CIM 16/17/18 namespaces. If your schema uses a custom cim namespace (a vendor extension, an internal profile, a not-yet-standard CIM version), declare it here, mapping the namespace URI to whichever built-in profile shape matches its ontology's conventions:

{
"cimvocabcheck": {
"cimNamespaces": {
"https://example.com/my-vendor-cim#": "cim17"
},
"schemasDirectory": "schemas/my-vendor-profiles"
}
}
ShapeOntology conventionAs used by
cim16cims:isFixed version IRIs, {Profile}Version.shortName keywordsCGMES 2.4.15
cim17owl:versionIRI, dcat:keywordCGMES 3.0+
cim18Like cim17, plus CIM18's DocumentHeader-based header-profile detectionCIM 18

CimProfile16/CimProfile17/CimProfile18 are parsing strategies, not code tied to their specific namespace — reusing one of them for a custom namespace works as long as your ontology follows the same convention. Most new vendor/extension profiles follow the modern owl:versionIRI/dcat:keyword convention, so cim17 is the right choice unless you know otherwise.

Registration happens as a side effect of loading the config, so it takes effect for schema files, --endpoint/# [endpoint=...] loads, and any other schema source in the same process — you don't need to declare it more than once. An unknown shape name (anything other than cim16/cim17/cim18) fails config loading with a clear error naming the bad value.

Writing your own CimProfile

If your ontology doesn't follow either built-in convention, cimNamespaces can't help — implement CimProfile yourself and call CimNamespaceFactoryRegistry.registerProfileFactory from your own code before CIMVocabCheck loads. See CIMXML → Compliance.

Full example

{
// CIMVocabCheck settings — see https://opencgmes.soptim.de/cimvocabcheck/configuration
"cimvocabcheck": {
"schemasDirectory": "schemas/cgmes-3.0",
"strictness": "strict",
"standardVocabulary": "check",
"namedGraphs": {
"EQ": ["http://iec.ch/TC57/ns/CIM/CoreEquipment-EU/3.0"],
"TP": ["http://iec.ch/TC57/ns/CIM/Topology-EU/3.0"]
},
"prefixes": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"cim": "http://iec.ch/TC57/CIM100#"
}
}
}

See also

  • Validation checks — the diagnostic codes these settings affect.
  • Endpoints — load the schema from a SPARQL endpoint instead of files.
  • CLI--config, --schema, --strictness flags mirror these settings.