Skip to content

Remove self-referential owl:imports from bundled SHACL templates - #11

Merged
marco-volpini merged 2 commits into
CIRPASS-2:mainfrom
opendpp-node:fix/shacl-template-self-imports
Aug 4, 2026
Merged

Remove self-referential owl:imports from bundled SHACL templates#11
marco-volpini merged 2 commits into
CIRPASS-2:mainfrom
opendpp-node:fix/shacl-template-self-imports

Conversation

@opendpp-node

Copy link
Copy Markdown
Contributor

Remove self-referential owl:imports from bundled SHACL templates

Fixes #10.

What

Each bundled SHACL template declared its ontology as importing itself:

<http://example.org/battery-passport> a owl:Ontology ;
    owl:imports <http://example.org/battery-passport> .

This PR drops the self-referential owl:imports clause (keeping the owl:Ontology
declaration) in:

  • core/src/test/resources/shacl-templates/battery_pass_shacl.ttl
  • core/src/test/resources/shacl-templates/vehicle_shacl.ttl
  • core/src/test/resources/shacl-templates/electronics_shacl.ttl
  • api/rest/src/test/resources/shacl-templates/test-addition.ttl
  • datastore/pgsql/src/test/resources/shacl-templates/test-addition.ttl

Why

A self owl:imports is a no-op at best and can send import-resolving loaders into a
redundant self-fetch. These templates are the only shapes the repo ships, and downstream
users copy them as starting points.

Tests

Data-only change to test resources — no code paths altered. Verified locally with the full
reactor (./mvnw test, JDK 21): all modules green, including the tests that load and
register these exact templates (testAddTemplate, ValidationResourceAPITest, pgsql
datastore tests). Happy to add a guard test that scans bundled templates for self-imports if
you'd like one.

— Giovanni Savastano · OpenDPP (opendpp-node.eu)

…plates

Each bundled template declared its ontology as importing itself — a no-op
that can send import-resolving loaders into a redundant self-fetch. Keep
the owl:Ontology declaration, drop the self-import. Data-only change;
the tests that load and register these templates stay green.

Fixes CIRPASS-2#10

@marco-volpini marco-volpini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@marco-volpini
marco-volpini merged commit 08fee43 into CIRPASS-2:main Aug 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SHACL template ontologies owl:imports themselves

3 participants