Skip to content

Feature: Implement conditional SHACL logic for smarter validation #33

@MartinM10

Description

@MartinM10

Currently, our SHACL shapes in edaan-shapes.ttl primarily validate structural existence using minCount (e.g., "A Profile must have metrics"). However, they do not enforce business logic dependent on specific data types.

We need to upgrade our validation layer to support Conditional SHACL (sh:if, sh:then, sh:else) to catch logical inconsistencies.

Proposed Task

  • Update edaan-shapes.ttl to include conditional rules.
  • Rule 1: IF a Profile declares bigdat:VectorData, THEN edaan:hasCRS must be mandatory (minCount 1).
  • Rule 2: IF a Profile declares bigdat:TabularData, check for relevant tabular metrics (optional but recommended warning).

Example Implementation

:VectorDataCRSShape a sh:NodeShape ;
    sh:targetClass :DataProfile ;
    sh:if [
        sh:path :declaresDataClass ;
        sh:hasValue bigdat:VectorData ;
    ] ;
    sh:then [
        sh:path :hasCRS ;
        sh:minCount 1 ;
        sh:message "Vector Data MUST have a Coordinate Reference System (CRS)."@en ;
    ] .

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionopen for discussion, community feedback, or consensusenhancementNew feature or requestvalidationRelated to SHACL shapes, constraints, and data integrity checks

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions