Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.py]
indent_size = 4

[Makefile]
indent_style = tab

root = true

[*]
indent_style = space
indent_size = 2
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/auto-add-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Auto add issues and PRs to EKGF Data Product Workgroup project

on:
issues:
types: [opened, reopened]
pull_request:
types: [opened, reopened]

jobs:
add_to_project:
runs-on: ubuntu-latest
steps:
- name: Add to org project
uses: actions/add-to-project@v1.0.1
with:
project-url: https://github.com/orgs/EKGF/projects/5
github-token: ${{ secrets.PROJECTS_WRITE_TOKEN }}

12 changes: 7 additions & 5 deletions .github/workflows/build-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ concurrency:
jobs:
build:
runs-on: macos-latest
permissions:
contents: read
steps:
- name: Debug - Show event info
run: |
echo "Event name: ${{ github.event_name }}"
echo "Ref: ${{ github.ref }}"
echo "SHA: ${{ github.sha }}"
echo "Actor: ${{ github.actor }}"
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip' # caching pip dependencies
- name: Install dependencies and run generator
run: |
Expand All @@ -38,7 +40,7 @@ jobs:
echo "Running spec generator..."
python spec-generator/main.py
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4
with:
# Upload the contents of the dist directory
path: 'dist'
Expand Down Expand Up @@ -67,4 +69,4 @@ jobs:
echo "Workflow run ID: ${{ github.run_id }}"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
uses: actions/deploy-pages@v4
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter"
]
}


6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"makefile.configureOnOpen": false
}


66 changes: 66 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## What This Project Is

DPROD (Data Product Ontology) is an OMG standard that extends the W3C DCAT vocabulary to describe data products in data mesh architectures. The repository contains the OWL ontology, SHACL validation shapes, a Python spec generator, and worked examples.

## Build

```bash
bash build.sh
```

This sets up a `.venv` with Python 3.12+, installs dependencies, and runs the spec generator. Output goes to `dist/`. The build fetches `https://www.w3.org/ns/dcat2.ttl` remotely, so it requires internet access.

To run just the generator (after initial setup):

```bash
source .venv/bin/activate
python spec-generator/main.py
```

There are no tests or linters configured.

## Architecture

### Spec Generation Pipeline

The spec generator (`spec-generator/main.py`) produces the specification HTML and serialized ontology files:

1. **Load** — Three RDF sources are parsed into a single graph: `dprod-ontology.ttl` (OWL classes/properties), `dprod-shapes.ttl` (SHACL shapes), and the remote W3C DCAT vocabulary.
2. **Discover** — The graph is scanned for SHACL NodeShapes. Each NodeShape is linked to its OWL target class via `sh:targetClass`. Properties come from `sh:property` on each NodeShape.
3. **Two-pass property loading** — For both NodeShapes and PropertyShapes, OWL properties are loaded first, then SHACL properties override them. Predicates in `IGNORED_NODE_SHAPE_PREDICATES` / `IGNORED_PROPERTY_SHAPE_PREDICATES` (in `globals.py`) are skipped during the SHACL pass to prevent shape metadata from leaking into the spec.
4. **Examples** — Each subdirectory in `examples/` with a `README.md` is loaded; the markdown is converted to HTML.
5. **Render** — Jinja2 renders `respec/template.html` with the discovered classes and examples, producing `dist/index.html`.
6. **Serialize** — The ontology is serialized to Turtle, JSON-LD, and RDF/XML in multiple combinations (ontology-only, shapes-only, combined). A standalone `dprod-context.jsonld` is also generated for use as a remote `@context` in JSON-LD documents.

### Key relationships

- `dprod-ontology.ttl` defines OWL classes and properties (the "what").
- `dprod-shapes.ttl` defines SHACL shapes that constrain those classes (the "how to validate"). Each NodeShape targets an OWL class; each PropertyShape constrains an OWL property via `sh:path`.
- `respec/template.html` is both a W3C ReSpec document and a Jinja2 template. Static sections (preamble, scope, namespaces) are plain HTML. Dynamic sections use `{% for cls in classes %}` loops to render class and property tables.
- Class ordering in the spec is hardcoded in `main.py` (the `reorder_list` call), not derived from the ontology.
- Examples referenced in `@context` use `dprod-context.jsonld` (standalone context), not `dprod.jsonld` (full ontology dump).

### Namespace

The canonical namespace is `https://www.omg.org/spec/DPROD/`. The shapes namespace is `https://www.omg.org/spec/DPROD/shapes/`. These are defined in `globals.py`.

## Branch Model and Git Workflow

- **`main`** — The officially accepted OMG standard. Deploys to GitHub Pages.
- **`develop`** — Working branch where the EKGF evolves the standard.
- **Issue branches** — Created from `develop`, named after the OMG JIRA issue number (e.g., `DPROD-16`). Commit messages should reference both the JIRA issue and the GitHub issue (e.g., `Resolves: DPROD-16, #29`).
- **Ballot branches** — Named `ballot/N` (e.g., `ballot/3`), created by the ballot administrator to group issue branches for a formal OMG vote. Merged into `develop` with a merge commit (not squash/rebase) to preserve individual issue history.

See `CONTRIBUTING.md` for the full process.

## Common Modifications

- **Add/modify an ontology class or property**: Edit both `ontology/dprod/dprod-ontology.ttl` (OWL definition) and `ontology/dprod/dprod-shapes.ttl` (SHACL shape). Keep descriptions in sync.
- **Change spec rendering or layout**: Edit `respec/template.html`. Static content is plain HTML; dynamic content uses Jinja2 syntax.
- **Change class ordering in the spec**: Edit the `reorder_list` call in `spec-generator/main.py`.
- **Add an example**: Create a subdirectory in `examples/` with a `README.md` (and optionally an `example.jsonld`). Update `examples/README.md`.
- **Add a namespace to the spec**: Add a `<tr>` to the namespace table in `respec/template.html` and ensure the prefix is declared in the relevant `.ttl` files.
86 changes: 86 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Contributing

This document provides guidelines for contributing to the
[Data Product (DPROD)](https://www.omg.org/spec/DPROD/) specification
using a Git workflow designed for issue-based development and a formal
OMG balloting process.

## Branches

- **`main`** &mdash; The officially accepted OMG standard.
- **`develop`** &mdash; The working branch where the
[Enterprise Knowledge Graph Forum (EKGF)](https://www.ekgf.org),
an OMG community, continues to evolve the standard.
- **Issue branches** &mdash; Created from `develop` for each issue,
named after the OMG JIRA issue number (e.g., `DPROD-16`).
- **Ballot branches** &mdash; Created by the ballot administrator
to group issue branches for a formal vote (e.g., `ballot/3`).

## 1. Issue Branches

- **Create a branch**: For every issue you work on, create a dedicated
branch from `develop`. Name it after the OMG JIRA issue number
(e.g., `DPROD-16`).
- **Isolate changes**: Only commit changes related to the specific issue
on that branch. Keep commits concise and focused.
- **No pull requests for issue branches**: Do not create a pull request
for your issue branch. Issue branches are included in a ballot branch
by the ballot administrator, and only the ballot branch gets a pull
request.

## 2. Keeping Your Branch Up-to-Date

- **Rebase from `develop`**: Regularly rebase your issue branch to
incorporate the latest changes. This helps prevent merge conflicts and
keeps your branch current.

```bash
git checkout DPROD-16
git rebase develop
```

- **Avoid merging from other branches**: Do not merge changes from other
issue branches into yours. If absolutely necessary, use squash merging
to maintain a clean history.

## 3. Ballot Preparation

- **Notification**: You will be notified when your issue is being
considered for a ballot.
- **Ensure your branch is ready**: Make sure your issue branch is
up-to-date with `develop` (rebase if needed) and that all commits are
clear and well-organized.

## 4. Ballot Review

- **Pull request**: The ballot administrator will create a pull request
for the ballot branch (e.g., `ballot/3`), which includes your issue
branch.
- **Review**: Review the ballot pull request as a whole or examine your
individual issue branch to ensure the changes are correct. Provide
feedback or approvals as needed.

## 5. Post-Ballot

- **Merge to `develop`**: If the ballot passes, the administrator will
merge the ballot branch into `develop`.
- **Rejected issues**: If your issue is rejected in a ballot:
- Address the feedback provided.
- Rebase your branch from `develop` (after the ballot branch is merged).
- Optionally rename your branch (e.g., add `.1`) to indicate the
revision.
- Your issue will be included in a future ballot.

## 6. Important Considerations

- **Commit messages**: Write clear and informative commit messages that
explain *why* the change was made, not just what changed.
- **Issue tracking**: Keep both
[GitHub Issues](https://github.com/EKGF/dprod/issues) and
[OMG JIRA](https://issues.omg.org/browse/DPROD) updated with the
status of your work. Reference the OMG JIRA issue number in your
branch name and commit messages (e.g., `DPROD-16`), and reference the
GitHub issue number where applicable (e.g., `#29`).
- **Communication**: Communicate with the ballot administrator and other
team members throughout the process, especially if you have questions
or encounter issues.
47 changes: 26 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
MIT License

Copyright (c) 2024 Enterprise Knowledge Graph Forum, Object Management Group, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Creative Commons Attribution 4.0 International (CC BY 4.0)

Copyright (c) 2024-2026 Enterprise Knowledge Graph Forum, EDM Council, Inc.

This work is licensed under the Creative Commons Attribution 4.0
International License. To view a copy of this license, visit:

https://creativecommons.org/licenses/by/4.0/

You are free to:

- Share — copy and redistribute the material in any medium or format
for any purpose, even commercially.
- Adapt — remix, transform, and build upon the material for any
purpose, even commercially.

Under the following terms:

- Attribution — You must give appropriate credit, provide a link to the
license, and indicate if changes were made. You may do so in any
reasonable manner, but not in any way that suggests the licensor
endorses you or your use.

- No additional restrictions — You may not apply legal terms or
technological measures that legally restrict others from doing
anything the license permits.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ REPO_DIR="$(dirname "$(realpath ${BASH_SOURCE[0]})")"
venv_dir="${REPO_DIR}/.venv"
system_python_bin="/usr/bin/python3"
system_python_version="0.0.0"
system_python_minimum_version="3.12"
system_python_minimum_version="3.13"
venv_python_bin="${venv_dir}/bin/python${system_python_minimum_version}"

function check_system_python() {
Expand Down
Loading