Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

One of the requirements for all CDIF conformant metadata records is the inclusion of a conformance declaration that is part of the record. This is implemented in the schema.org JSON-LD implementation with a schema:subjectOf key that has @type schema:Dataset and schema:additionalType dcat:CatalogRecord. We refer to this as the catalog record part of the metadata — metadata about the metadata. The catalog record includes a dcterms:conformsTo statement that is a list of object references for the profiles the document conforms to.

"schema:subjectOf": {
  "@id": "ex:gom-water-quality-wide-2025/catalog-record",
  "@type": ["schema:Dataset"],
  "schema:additionalType": ["dcat:CatalogRecord"],
  "...": "...",
  "dcterms:conformsTo": [
    {"@id": "https://w3id.org/cdif/core/1.1"},
    {"@id": "https://w3id.org/cdif/discovery/1.1"},
    {"@id": "https://w3id.org/cdif/data_description/1.1"}
  ]
}

The conformance URIs are set up to resolve as follows:

Thus, to validate an instance document that declares conformance to more than one profile, each profile’s validation artefact (schema or SHACL) must be retrieved and used to test the instance. The CDIF team has implemented Python tooling to execute this validation workflow. The tools live in the CDIF validation repository on GitHub, created with the assistance of Anthropic’s Claude Code. They are Python command-line tools; several also expose their validation logic as a function that can be imported into other code. The software is licensed under the Apache License 2.0, and the schemas, SHACL shapes, documentation and example metadata under Creative Commons Attribution 4.0 International (CC BY 4.0) (see Licensing below).

These tools are prototypes for demonstrating the CDIF validation approach, and should be tested carefully before being relied on in a production setting. Feedback and contributions are welcome through the repository’s issue tracker.

Validation tools at a glance

Framing and per-profile validation

CDIF metadata is JSON-LD, which is a graph format; JSON Schema validates trees. So validation is a two-step workflow: first frame the document (reshape the graph into the nested tree the schemas expect, using CDIF-frame-2026.jsonld), then validate the framed result against a profile’s JSON Schema. The framing step also normalises prefixes, embeds referenced nodes inline, and regularises arrays versus single values.

To facilitate simple JSON Schema validation for the common composite profiles, the framed-tree schemas are published for core + Discovery, core + Discovery + DataDescription, and core + Discovery + DataDescription + DataStructure.

Conformance-URI-driven validation

Content-derived conformance detection

SHACL validation

JSON Schema validates structure; SHACL validates the RDF graph and can express constraints JSON Schema cannot — SPARQL-based targeting, cross-node relationships, and cardinality rules. The composite SHACL shape bundles are compiled from the modular rules.shacl files in the metadataBuildingBlocks repository, one bundle per profile (CDIF-Discovery-Shapes.ttl, CDIF-DataDescription-Shapes.ttl, CDIF-DataStructure-Shapes.ttl, CDIF-Provenance-Shapes.ttl, CDIF-Manifest-Shapes.ttl, and the aggregate CDIF-Complete-Shapes.ttl).

SHACL severity is aligned with JSON Schema: properties that are optional in the JSON Schema are sh:Warning (not sh:Violation) in SHACL, so only structurally required properties fail a record.

Batch validation

Supporting utilities

Generating the validation artefacts

The schemas and SHACL shapes are generated from the building-block sources, not hand-maintained, so they track the normative profiles.

Choosing a tool

If you want to …Use
Validate against one profile you already knowtools/FrameAndValidate.py
Validate against every profile a record declares, with SHACL and a declared-vs-detected checkConformanceValidate.py
Find out which profiles a record’s content actually supportsdetect_conformance.py
Run SHACL on its ownShaclValidation/ShaclJSONLDContext.py
Validate a whole corpus at oncebatch_validate.py

Getting started

git clone https://github.com/Cross-Domain-Interoperability-Framework/validation.git
cd validation
pip install PyLD jsonschema rdflib pyshacl requests

# Validate one document against the Discovery profile schema
python tools/FrameAndValidate.py my-metadata.jsonld -v \
    --schema CDIFDiscoverySchema.json --frame CDIF-frame-2026.jsonld

# Validate against every profile the record declares (schema + SHACL)
python ConformanceValidate.py my-metadata.jsonld --source local

# Detect which profiles the content actually supports
python detect_conformance.py my-metadata.jsonld

Licensing

The CDIF validation repository is dual-licensed by content type, matching the converters repository:

ContentLicense
Software: the Python tools and generators (*.py), the oXygen batch wrapper (.bat), the Node.js CLI (.js), and the CI workflows (.github/)Apache License 2.0 — see LICENSE
The JSON Schemas (*.json), the JSON-LD frame and context (*.jsonld), the SHACL shape bundles (*.ttl), the documentation (*.md), and the example metadata recordsCreative Commons Attribution 4.0 International (CC BY 4.0) — see LICENSE-CC-BY-4.0

Third-party material bundled in the repository for testing and reference (for example the DDI-CDI normative schemas and the example metadata corpora) keeps its original license.


We appreciate constructive feedback. Contact us at cdif-feedback@codata.org or file a GitHub Issue.

Copyright (c) 2022-2026 Committee on Data of the International Science Council (CODATA). The Cross Domain Interoperability Framework (CDIF) is licenced under CC-BY-4.0.

Funded by the EU

CDIF v.1 was supported by the EU Horizon Europe funded WorldFAIR project (GA 10105839). CDIF v.1.1 is is a community effort coordinated by CODATA. Further development will be supported by the EU Horizon Europe funded CDIF4EOSC project (GA 101292473).