ism2rdf transforms IC XML Schema Definition (XSD) and Schematron source files published by the U.S. Intelligence Community CIO (IC CIO) into RDF/OWL/SKOS representations, plus XSD-derived SHACL constraints, for use in Linked Data, semantic reasoning, and ontology-driven validation systems.
The XSDs are the primary input and the design center of the transformer: every OWL property, datatype, concept scheme, and SHACL pattern derives from the schema. Schematron is processed as a supplementary input that records the IC's constraint rules in RDF and lowers the safely translatable subset to SHACL.
The primary output is schema-derived: for each XSD processed, the transformer emits a self-contained RDF/OWL/SKOS rendering of the schema's types, attributes, enumerations, and facets.
- OWL ontologies — one
owl:DatatypePropertyper schema attribute, withrdfs:rangepointing at a generated custom datatype. - Custom datatypes —
rdfs:Datatypedeclarations withowl:oneOfenumerations linked back to the correspondingskos:ConceptSchemeviadc:sourceandrdfs:seeAlso. - SKOS concept schemes — XSD enumerations become
skos:ConceptSchemeresources whoseskos:Conceptmembers carryskos:notationand (when XSD documentation is present)skos:prefLabel. - SHACL pattern constraints — regex facets on simple types become
sh:patternproperties on the matching shape, derived directly from the XSD without hand authoring.- Schema header metadata — ISM self-marking attributes on
xs:schemaare mapped to standard predicates on the emittedowl:Ontology(see Schema Root Metadata Mapping below).
- Schema header metadata — ISM self-marking attributes on
The full pattern that ties these pieces together — datatype property → custom datatype → concept scheme — is documented in CVE Pattern.
Schematron processing runs alongside XSD processing and captures the IC's published rule set in RDF form for use by validators and reviewers.
- Source-faithful RDF for Schematron schemas, namespaces, includes, phases, patterns, rules, asserts, and reports.
- Resolved abstract-pattern rules (
ismsch:ResolvedRule) with parameter substitution. - SHACL shapes for the safely translatable subset (
sh:minCount,sh:hasValue,sh:pattern). - Preservation markers (
ismsch:translationStatus,ismsch:translationReason) on constraints that cannot be auto-translated. - Schema-term alignment links (
ismsch:alignsToSchemaTerm) connecting rule expressions back to the schema attributes they reference.
XSD processing is the main pipeline; Schematron processing runs as a deferred pass against the schema-derived graph so its outputs can reference the same IRIs.
- Load staged XSDs from
.ciartifacts/Schemaand walk imports/includes. - Emit OWL, SKOS, custom datatypes, SHACL
sh:patternshapes, and ontology header metadata for every schema. - Discover Schematron references from XSD
xml-modelprocessing instructions; parse the Schematron schemas and recursively resolve<include>chains. - Emit source-faithful Schematron RDF, then run the deferred enhancement passes:
- abstract-pattern instantiation (
ismsch:ResolvedRule), - safe-subset SHACL translation,
- constraint preservation metadata,
- rule-to-schema alignment extraction.
- abstract-pattern instantiation (
- Write standalone and convenience artifacts in all serializer targets (
jsonld,ttl,nt,trig+tdf).
The emitted Schematron vocabulary covers document and structural terms such as ismsch:SchematronDocument, ismsch:Schema, ismsch:NamespaceDeclaration, ismsch:Pattern, ismsch:AbstractPattern, ismsch:Rule, ismsch:AbstractRule, ismsch:ResolvedRule, ismsch:Assert, ismsch:Report, ismsch:Include, ismsch:ExecutionPhase, ismsch:Variable, ismsch:Parameter, and ismsch:Paragraph.
The transformer maps ISM self-marking attributes on xs:schema to ontology metadata using standard predicates:
ism:createDate->dc:dateism:DESVersion->owl:versionInfo(prefixed literalDESVersion:...)ism:ISMCATCESVersion->owl:versionInfo(prefixed literalISMCATCESVersion:...)ism:classification->dc:rightsism:ownerProducer->dc:publisherism:compliesWith->dcterms:conformsTo
For ism:compliesWith, the object is emitted as a URI when the schema declares xmlns:ismcomplies (for example, urn:us:gov:ic:cvenum:ism:complieswith#USGov). If the namespace alias is missing, the transformer falls back to a literal so source intent is still preserved.
- Detection Principle: The presence of
ism:classificationis sufficient to detect and process both classified and CUI-marked content. All marked data, including CUI, can be reliably identified by this property.
Rationale for review/debate/change:
dcterms:conformsTois the closest standard semantic for "complies with".- Using the CVE namespace URI keeps the value linkable to controlled-vocabulary resources.
- Literal fallback prevents silent data loss in non-standard schema variants.
If a different predicate or URI pattern is preferred (for example a custom ism: property), this behavior is isolated and can be changed without affecting the rest of the schema conversion pipeline.
All outputs are written in five formats per file: compact JSON-LD, human-readable Turtle, N-Triples, TriG (named-graph serialization), and TDF (Trusted Data Format payload wrapping the TriG).
Output is written directly under out/:
out/
├── jsonld/
│ ├── standalone/ # Each schema/schematron as a self-contained graph
│ │ ├── Schema/
│ │ └── Schematron/
│ └── convenience/ # All imports/includes merged inline
│ ├── Schema/
│ └── Schematron/
├── ttl/
│ ├── standalone/
│ │ ├── Schema/
│ │ └── Schematron/
│ └── convenience/
│ ├── Schema/
│ └── Schematron/
├── nt/
│ ├── standalone/
│ │ ├── Schema/
│ │ └── Schematron/
│ └── convenience/
│ ├── Schema/
│ └── Schematron/
└── trig/ # TriG + TDF pairs
├── standalone/
│ ├── Schema/
│ ├── Schematron/
│ └── manifest.json # Combined TriG+TDF manifest for standalone mode
└── convenience/
├── Schema/
├── Schematron/
└── manifest.json # Combined TriG+TDF manifest for convenience mode
Each manifest.json records a single entry per artifact pair with trigPath, tdfPath, payloadSha256, graphName, category, mode, and createdAt.
TypeScript compiler output goes to dist/. The entire out/ and dist/ trees are excluded from Git.
The Controlled Vocabulary Enumeration (CVE) pattern is the core design connecting XSD enumerations to semantic RDF structures. It is described in detail in Prescriptive _CVE_Pattern.pdf included in this repository.
An owl:DatatypeProperty references a custom rdfs:Datatype whose valid literal values are constrained via owl:oneOf to exactly match the skos:notation literals of skos:Concept members of a linked skos:ConceptScheme. This makes enumerated values simultaneously:
- Formally constrained for data validation
- Semantically enriched as browsable, linkable concepts
- Traceable —
dc:sourceandrdfs:seeAlsoconnect the datatype back to the concept scheme
The CVE pattern facts in detail:
- An
owl:DatatypePropertyhasrdfs:rangepointing to a custom datatype. - The custom datatype is an
rdfs:Datatypewithowl:equivalentClass → owl:oneOflisting allowed literals, plusdc:source/rdfs:seeAlsolinking to askos:ConceptScheme. - The
skos:ConceptSchemereferences all concepts viaskos:hasTopConcept. - Each
skos:Concepthasskos:inScheme, askos:notationmatching oneowl:oneOfliteral, and askos:prefLabelfrom XSD documentation annotations.
Authoritative source payloads are not stored in this repository. The current implementation expects staged local source folders to already exist under .ciartifacts/:
.ciartifacts/Schema.ciartifacts/Schematron
If .ciartifacts/Schema is missing, the runtime also accepts the legacy fallback .ciartifacts/schemas.
If required staged folders are missing, the transformer exits with an error and does not attempt network download, ZIP extraction, .env resolution, or CLI source selection.
In environments where source content differs from the public baseline (for example classified or disconnected enclaves, or later ISM releases), stage and overlay the local authoritative files directly into:
.ciartifacts/Schema.ciartifacts/Schematron
The transformer always reads whatever is currently staged in those folders. This lets you keep one codebase while supplying environment-specific source overlays without changing runtime flags.
All required source files must be manually staged in the following canonical folders before running the transformer:
.ciartifacts/
├── Schema/ # XSD schemas (maps from ISM/Schema/ inside ZIP)
│ ├── ISM/
│ ├── ISMCAT/
│ ├── IC-EDH/
│ ├── IC-ID/
│ ├── Taxonomy/
│ └── USAgency/
├── Schematron/ # Schematron rules (maps from ISM/Schematron/ inside ZIP)
│ └── ISM/
│ ├── Lib/ # Abstract pattern libraries
│ └── Rules/ # Concrete rules by jurisdiction and profile
├── config/
These folders are excluded from Git via .ciartifacts/.gitignore.
The transformer always reads whatever is currently staged in those folders. No automated acquisition or extraction is performed; users are responsible for ensuring the correct files are present.
Install dependencies and build the project:
git clone https://github.com/ewrayjohnson/ism2rdf.git
cd ism2rdf
npm install
npm run buildRun the transformer from the repository root:
npm startCurrent runtime behavior:
- Uses staged folders only (
.ciartifacts/Schema+.ciartifacts/Schematron, or legacy.ciartifacts/schemasfor schema root) - Writes output under
out/ - Prints processed XSD and Schematron document counts
The current implementation does not consume source-selection CLI flags (--source, --source-type, --source-version, --force-refresh) and does not read .env source settings.