@prefix : <https://w3id.org/citydata/part1/v1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@base <https://w3id.org/citydata/part1/v1/> .

<https://w3id.org/citydata/part1/v1/AgreementSHACL> rdf:type owl:Ontology ;
                                                     owl:imports :AgreementPattern ,
                                                                 :CoreSHACL ;
                                                     dcterms:title "City Data Model Part 1 - Agreement Pattern - SHACL constraints" ;
                                                     vann:preferredNamespacePrefix "cdm1" ;
                                                     vann:preferredNamespaceUri "https://w3id.org/citydata/part1/v1/" ;
                                                     skos:definition "SHACL validation shapes for the Agreement Pattern pattern module." .

#################################################################
#    Shapes
#################################################################

###  https://w3id.org/citydata/part1/v1/AgentShape
:AgentShape rdf:type sh:NodeShape ;
            sh:property [ sh:class :AtomicAgreement ;
                          sh:path :hasClaim
                        ] ,
                        [ sh:class :AtomicAgreement ;
                          sh:path :hasDuty
                        ] ,
                        [ sh:class :AtomicAgreement ;
                          sh:path :hasPrivilege
                        ] ,
                        [ sh:class :AtomicAgreement ;
                          sh:path :hasNoClaim
                        ] ;
            sh:targetClass :Agent .


###  https://w3id.org/citydata/part1/v1/AgreementShape
:AgreementShape rdf:type sh:NodeShape ;
                sh:property [ sh:class :Location ;
                              sh:path :validIn
                            ] ,
                            [ sh:class time:Interval ;
                              sh:path :validFor
                            ] ,
                            [ sh:class :Agent ;
                              sh:minCount "2"^^xsd:integer ;
                              sh:path :involvesAgent
                            ] ,
                            [ sh:class time:Instant ;
                              sh:path :establishedOn
                            ] ;
                sh:targetClass :Agreement .


###  https://w3id.org/citydata/part1/v1/AtomicAgreementShape
:AtomicAgreementShape rdf:type sh:NodeShape ;
                      sh:property [ sh:class :Agreement ;
                                    sh:maxCount "0"^^xsd:integer ;
                                    sh:path :hasSubAgreement
                                  ] ,
                                  [ sh:class :Agent ;
                                    sh:path [ sh:inversePath :hasNoClaim
                                    ]
                                  ] ,
                                  [ sh:class :Agent ;
                                    sh:path [ sh:inversePath :hasClaim
                                    ]
                                  ] ,
                                  [ sh:class :Agent ;
                                    sh:path [ sh:inversePath :hasPrivilege
                                    ]
                                  ] ,
                                  [ sh:class :Activity ;
                                    sh:node :MinOneShape ;
                                    sh:path :commitsToActivity
                                  ] ,
                                  [ sh:class :Agent ;
                                    sh:path [ sh:inversePath :hasDuty
                                    ]
                                  ] ;
                      sh:targetClass :AtomicAgreement .


###  https://w3id.org/citydata/part1/v1/ComplexAgreementShape
:ComplexAgreementShape rdf:type sh:NodeShape ;
                       sh:property [ sh:class :Agreement ;
                                     sh:minCount "2"^^xsd:integer ;
                                     sh:path :hasSubAgreement
                                   ] ;
                       sh:targetClass :ComplexAgreement .
