Ontology Version: 2.2.0

cacontology-production:ProducerRoleConflictShape leaf node


URI

https://cacontology.projectvic.org/production#ProducerRoleConflictShape

Label

Producer Role Conflict Shape

Description

Prevents conflicting roles from being assigned simultaneously.

Target Classes (1)

Shape Properties

Instances of cacontology-production:Producer can have the following properties:

PROPERTY

MIN COUNT

MAX COUNT

TYPE

Implementation

@prefix cacontology-production: <https://cacontology.projectvic.org/production#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
cacontology-production:ProducerRoleConflictShape a sh:NodeShape ;
    rdfs:label "Producer Role Conflict Shape"@en ;
    rdfs:comment "Prevents conflicting roles from being assigned simultaneously."@en ;
    sh:sparql [ sh:message "Individual cannot simultaneously be Producer and VictimRole."@en ;
            sh:prefixes [ sh:declare [ sh:namespace "https://cacontology.projectvic.org/production#"^^xsd:anyURI ;
                            sh:prefix "cacontology-production" ],
                        [ sh:namespace "https://cacontology.projectvic.org/gufo#"^^xsd:anyURI ;
                            sh:prefix "cacontology-gufo" ] ] ;
            sh:select """
            PREFIX cacontology-production: <https://cacontology.projectvic.org/production#>
            PREFIX cacontology-gufo: <https://cacontology.projectvic.org/gufo#>
            PREFIX gufo: <http://purl.org/nemo/gufo#>
            SELECT ?this WHERE {
                ?entity gufo:playsRole ?this .
                ?entity gufo:playsRole ?victimRole .
                ?this a cacontology-production:Producer .
                ?victimRole a cacontology-gufo:VictimRole .
                ?this cacontology-production:hasRoleBeginPoint ?producerBegin .
                ?victimRole cacontology-production:hasRoleBeginPoint ?victimBegin .
                FILTER(?producerBegin <= ?victimBegin)
                OPTIONAL { ?this cacontology-production:hasRoleEndPoint ?producerEnd }
                OPTIONAL { ?victimRole cacontology-production:hasRoleEndPoint ?victimEnd }
                FILTER(
                    (!BOUND(?producerEnd) && !BOUND(?victimEnd)) ||
                    (!BOUND(?producerEnd) && ?victimBegin <= ?victimEnd) ||
                    (!BOUND(?victimEnd) && ?producerBegin <= ?producerEnd) ||
                    (BOUND(?producerEnd) && BOUND(?victimEnd) && 
                     !((?producerEnd < ?victimBegin) || (?victimEnd < ?producerBegin)))
                )
            }
        """ ] ;
    sh:targetClass cacontology-production:Producer .