Issue #64

I’ve proposed this as a conversation opener to fix the issue I’ve had with refinements:

 
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix ex: <http://example.org/> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
 
# Main new shape
ex:ShapeThatFixesRefinementIssue
  a sh:NodeShape ;
  sh:or (
    [ sh:property [
        sh:path odrl:relation ;
        sh:or (
          [ sh:class odrl:Asset ]
          [ sh:class ex:Refinement ]
        )
      ] ]
    [ sh:property [
        sh:path odrl:function ;
        sh:or (
          [ sh:class odrl:Party ]
          [ sh:class ex:Refinement ]
        )
      ] ]
    [ sh:property [
        sh:path odrl:action ;
        sh:or (
          [ sh:class odrl:Action ]
          [ sh:class ex:Refinement ]
        )
      ] ]
  ) .
 
# Shape for nodes of class ex:Refinement
ex:RefinementShape
  a sh:NodeShape ;
  sh:targetClass ex:Refinement ;
 
  # One of these three must exist and match the correct class
  sh:or (
    [ sh:property [
        sh:path odrl:relation ;
        sh:class odrl:Asset
      ] ]
    [ sh:property [
        sh:path odrl:function ;
        sh:class odrl:Party
      ] ]
    [ sh:property [
        sh:path odrl:action ;
        sh:class odrl:Action
      ] ]
  ) ;
 
  # refinement property must be a Constraint or LogicalConstraint
  sh:property [
    sh:path ex:refinement ;
    sh:or (
      [ sh:class odrl:Constraint ]
      [ sh:class odrl:LogicalConstraint ]
    )
  ] .
 

I’ve also added a comment:

 

I am also aware that for declarative implementations (SPARQL) you will need to check that there's a match between the class inside a refinement and the property in the ex:ShapeThatFixesRefinementIssue.

... the issue is trivial on imperative implementations.

 

Regards,

 

___________________________________

Joshua Cornejo

marketdata

smart authorisation management for the AI-era

Received on Wednesday, 23 April 2025 09:05:22 UTC