Cross-disciplinary Interoperability Framework is a service designed to deliver AI-ready DDI-CDI variable cascades, enabling seamless integration with leading data repositories such as Dataverse, Kaggle, Zenodo, as well as compatibility with emerging machine learning standards like Croissant ML. It provides a structured foundation for connecting diverse datasets across domains, ensuring interoperability, reusability, and readiness for advanced AI and ML applications.
Quick start:
cp .env_sample .env
docker-compose build
docker-compose up -d
All endpoints are exposed by the FastAPI application in api/api.py. By default the service runs on port 8012 in Docker Compose, or port 80 inside the container image.
Base URL examples:
- Local (docker-compose):
http://localhost:8012 - Deployed dev:
https://cdif-4-xas.dev.codata.org
Below GET /path and POST /path are relative to the chosen base URL.
Health/info endpoint, returns a simple JSON banner:
- Response:
{"message": "DDI-CDI Service v.0.1"}
Generate a CDI graph for a dataset and return JSON-LD, enriched with:
- a framed/compacted CDI
@graphusing schema.org-style context, xdiCdifMapping: JSON-LD representation of the XDI–CDIF spreadsheet mapping,CDIGenerated: the original CDI graph as JSON-LD (schema.org rich).
Query parameters:
- url (optional): direct URL to a data file (e.g. Dataverse access URL).
- fileid (optional): Dataverse file ID.
- siteUrl (optional): Dataverse base URL (e.g.
https://dataverse.dev.codata.org). - format (default:
json-ld): CDI export format (json-ldorturtle– internally CDI is always serialized to JSON-LD for wrapping). - resources (optional): custom resources directory path.
- type (default:
xas): dataset type key. - datasetid, datasetversion, locale: passed through for downstream enrichment and compatibility.
If both fileid and siteUrl are provided, the service constructs:
<siteUrl>/api/access/datafile/<fileid>
and uses it as the url.
Low-level CDI generator used mainly for debugging.
Query parameters:
- url (required): source URL for the dataset (e.g. Dataverse access URL).
- format (default:
turtle): eitherturtleorjson-ld.
Response:
text/turtlewhenformat=turtle.application/jsonwhenformat=json-ld.
Expose CDI datapoints directly.
Query parameters:
- url (required): dataset URL (e.g. Dataverse file URL).
- format (default:
turtle):turtleorjson-ld.
Return the XDI–CDIF mapping derived from the Excel spreadsheet as JSON-LD or RML (Turtle).
Query parameters:
- spreadsheet_url (optional): URL or file path to an
.xlsxmapping file. - export (optional):
"json-ld"or"rml".- If missing and fileid is provided → defaults to
"rml". - Otherwise → defaults to
"json-ld".
- If missing and fileid is provided → defaults to
- fileid, siteUrl, datasetid, datasetversion, locale:
- If
spreadsheet_urlis not given and bothfileidandsiteUrlare set, the service builds:spreadsheet_url = <siteUrl>/api/access/datafile/<fileid>
- Other parameters are accepted for symmetry with
/cdiand future extension.
- If
Behaviour:
- When a (derived) spreadsheet URL is available:
- Reads the Excel via
pandas.read_excel. - If
export=rml→ returnstext/turtlewith RML TriplesMaps. - Else → returns JSON-LD with
@graphof mapping entries.
- Reads the Excel via
- When no URL is available:
- Falls back to the built‑in mapping in
resources/XDI-CDIF-Mapping.xlsx(or the GitHub URL) usingutils.load_xdi_cdif_mapping(_jsonld|_to_rml).
- Falls back to the built‑in mapping in
Example (JSON-LD mapping for a Dataverse file):
GET /mapping/xdi-cdif?fileid=41&siteUrl=https://dataverse.dev.codata.org
Example (RML mapping from GitHub-hosted spreadsheet https://github.com/codata/cdi-xas/raw/refs/heads/ai/resources/XDI-CDIF-Mapping.xlsx):
GET /mapping/xdi-cdif?spreadsheet_url=https://github.com/codata/cdi-xas/raw/refs/heads/ai/resources/XDI-CDIF-Mapping.xlsx&export=rml
These endpoints use the DataLearning class to introspect and expose a CDI‑encoded dataset configuration.
Return the full loaded data as a Pandas‑like JSON table (for debugging).
Load and return an example CDI dataset.
Query parameters:
- configurationfile (optional): path or filename of a configuration file.
- If not provided, uses the default
datafilefromconfig.py.
- If not provided, uses the default
Response:
- JSON-LD with:
@contextfor DDI-CDI and SKOS.DDICDIModels: list of models exported fromDataLearning.
Generate data + CDI graph for a particular dataset configuration.
Query parameters:
- url (required): path/URL of a JSON-LD configuration file.
Response:
- JSON with:
DDICDIModels: exportedDataLearningmodels.CDIGenerated: CDI graph generated bygenerate_cdi.
Return the entire loaded data as serialized JSON-LD from DataLearning.
Query parameters:
- subject (required): IRI/identifier of a node.
Returns the RDF type(s) of the subject from the full graph.
Query parameters:
- subject (required): IRI/identifier of a node.
Returns all related triples for that subject.
Query parameters:
- subject (required).
Returns triples related to the subject in a “triple by triple” view.
GET /data/lookup?subject=...– lookup a subject.GET /data/lookup/predicate?predicate=...– lookup triples by predicate.GET /data/lookup/object?object=...– lookup triples by object.GET /data/lookup/subject?subject=...– alias for subject lookup.
Intended as a Dataverse webhook/receiver.
- If a file is uploaded as
multipart/form-data(filefield):- Tries to parse it as JSON, otherwise returns the raw text.
- If no file is uploaded:
- Tries to parse JSON body expecting Dataverse dataset metadata (e.g.
datasetFileDetails). - Extracts
dataVariables, spawns parallel SKOS & Ollama lookups, and returns an enriched JSON payload.
- Tries to parse JSON body expecting Dataverse dataset metadata (e.g.
Proxy to an Ollama‑compatible text generation service for variable descriptions.
Query parameters:
- term (required): variable name / concept to describe.
- model (optional; default from
DEFAULTMODELenv var): model identifier.
Response:
- JSON with
{"name": <term>, "ollama": <parsed_or_raw_response>}.
Return a JSON list of all registered FastAPI routes (path, methods, name). Useful for quick inspection and debugging. ***!