@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <http://purl.org/dcat-br/vocabularies#> .
@prefix adms: <http://www.w3.org/ns/adms#> .
@prefix cc: <http://creativecommons.org/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix locn: <http://www.w3.org/ns/locn#> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix spdx: <http://spdx.org/rdf/terms#> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dcatbr: <http://purl.org/dcat-br/> .

<http://purl.org/dcat-br/docs/vocabularies/mdr_shapes>
    dcat:accessURL <https://www.gov.br/governodigital/pt-br/infraestrutura-nacional-de-dados/catalogo-nacional-de-dados/releases/DCAT-BR-1.0.0/shacl/mdr-vocabularies.shape.ttl> ;
    dct:format <http://publications.europa.eu/resource/authority/file-type/RDF_TURTLE> ;
    dct:conformsTo <https://www.w3.org/TR/shacl> ;
    dct:description "Este documento especifica as restrições de vocabulários controlados sobre propriedades expressas pelo DCAT-BR em SHACL."@pt-BR ;
    dct:description "This document specifies the controlled vocabulary constraints on properties expressed by DCAT-BR in SHACL."@en ;
    dct:title "Restrições de Vocabulários Controlados do Perfil de Aplicação DCAT-BR"@pt-BR ;
    dct:title "Controlled Vocabulary Constraints of DCAT-BR Application Profile"@en ;
    owl:versionInfo "1.0.0" ;
    dct:license <https://creativecommons.org/licenses/by/4.0> ;
    cc:attributionURL <https://www.gov.br/> ;
    dct:modified "2025-12-05"^^xsd:date ;
    dct:publisher <https://www.gov.br/gestao/pt-br> .

#-------------------------------------------------------------------------
# Restrições de Vocabulários Controlados para DCAT-BR
#-------------------------------------------------------------------------

# Temas (dcat:theme)
:ThemeRestriction
    a sh:NodeShape ;
    rdfs:comment "Restrição de tema"@pt-BR ;
    rdfs:comment "Theme restriction"@en ;
    rdfs:label "Restrição de Tema"@pt-BR ;
    rdfs:label "Theme Restriction"@en ;
    sh:property [
        sh:hasValue <https://dcat-br.github.io/dcat-br/docs/vocabularies/themes/> ;
        sh:minCount 1 ;
        sh:nodeKind sh:IRI ;
        sh:path skos:inScheme
    ] .

# Tipo de Recurso (dct:type)
:ResourceTypeRestriction
    a sh:NodeShape ;
    rdfs:comment "Restrição de tipo de recurso"@pt-BR ;
    rdfs:comment "Resource type restriction"@en ;
    rdfs:label "Restrição de Tipo de Recurso"@pt-BR ;
    rdfs:label "Resource Type Restriction"@en ;
    sh:property [
        sh:hasValue <https://dcat-br.github.io/dcat-br/docs/vocabularies/tipo-recurso/> ;
        sh:minCount 1 ;
        sh:nodeKind sh:IRI ;
        sh:path skos:inScheme
    ] .

# Cobertura Espacial (dct:spatial) - VCR-CE
:SpatialRestriction
    a sh:NodeShape ;
    rdfs:comment "Restrição de cobertura espacial"@pt-BR ;
    rdfs:comment "Spatial restriction"@en ;
    rdfs:label "Restrição de Cobertura Espacial"@pt-BR ;
    rdfs:label "Spatial Restriction"@en ;
    sh:property [
        sh:hasValue <https://dcat-br.github.io/dcat-br/docs/vocabularies/VCR-CE/> ;
        sh:minCount 1 ;
        sh:nodeKind sh:IRI ;
        sh:path skos:inScheme
    ] .

# Periodicidade de Atualização (dct:accrualPeriodicity) - VCR-FR
:PeriodicityRestriction
    a sh:NodeShape ;
    rdfs:comment "Restrição de periodicidade de atualização"@pt-BR ;
    rdfs:comment "Accrual periodicity restriction"@en ;
    rdfs:label "Restrição de Periodicidade"@pt-BR ;
    rdfs:label "Periodicity Restriction"@en ;
    sh:property [
        sh:hasValue <https://dcat-br.github.io/dcat-br/docs/vocabularies/VCR-FR> ;
        sh:minCount 1 ;
        sh:nodeKind sh:IRI ;
        sh:path skos:inScheme
    ] .

# Observância Legal / Direitos de Acesso (dct:accessRights) - SEI
:AccessRightRestriction
    a sh:NodeShape ;
    rdfs:comment "Restrição de observância legal / direitos de acesso"@pt-BR ;
    rdfs:comment "Access rights restriction"@en ;
    rdfs:label "Restrição de Observância Legal"@pt-BR ;
    rdfs:label "Access Rights Restriction"@en ;
    sh:property [
        sh:hasValue <https://dcat-br.github.io/dcat-br/docs/vocabularies/SEI/esquema> ;
        sh:minCount 1 ;
        sh:nodeKind sh:IRI ;
        sh:path skos:inScheme
    ] .

# Formato de Arquivo (dct:format) - Vocabulário DCAT-BR
:FormatRestriction
    a sh:NodeShape ;
    rdfs:comment "Restrição de formato usando vocabulário DCAT-BR"@pt-BR ;
    rdfs:comment "Format restriction using DCAT-BR vocabulary"@en ;
    rdfs:label "Restrição de Formato"@pt-BR ;
    rdfs:label "Format Restriction"@en ;
    sh:property [
        sh:hasValue <https://dcat-br.github.io/dcat-br/docs/vocabularies/formato/esquema> ;
        sh:minCount 1 ;
        sh:nodeKind sh:IRI ;
        sh:path skos:inScheme
    ] .

# Licença de Uso (dct:license) - VCR-LU
:LicenseRestriction
    a sh:NodeShape ;
    rdfs:comment "Restrição de licença de uso"@pt-BR ;
    rdfs:comment "License restriction"@en ;
    rdfs:label "Restrição de Licença de Uso"@pt-BR ;
    rdfs:label "License Restriction"@en ;
    sh:property [
        sh:hasValue <https://dcat-br.github.io/dcat-br/docs/vocabularies/VCR-LU/esquema> ;
        sh:minCount 1 ;
        sh:nodeKind sh:IRI ;
        sh:path skos:inScheme
    ] .


#-------------------------------------------------------------------------
# Shapes para Dataset com restrições de vocabulários controlados
#-------------------------------------------------------------------------

:Dataset_ShapeCV
    a sh:NodeShape ;
    sh:property [
        sh:node :PeriodicityRestriction ;
        sh:nodeKind sh:IRI ;
        sh:path dct:accrualPeriodicity ;
        sh:description "Um conceito não gerenciado pelo DCAT-BR é usado para indicar a periodicidade. Se nenhum correspondente for encontrado, informe o mantenedor do vocabulário de periodicidade do DCAT-BR."@pt-BR ;
        sh:description "A non DCAT-BR managed concept is used to indicate the accrualPeriodicity frequency. If no corresponding can be found inform the maintainer of the DCAT-BR frequency vocabulary."@en ;
        sh:severity sh:Violation
    ], [
        sh:node :AccessRightRestriction ;
        sh:nodeKind sh:IRI ;
        sh:path dct:accessRights ;
        sh:description "Um conceito não gerenciado pelo DCAT-BR é usado para indicar a observância legal. Se nenhum correspondente for encontrado, informe o mantenedor do vocabulário de observância legal do DCAT-BR."@pt-BR ;
        sh:description "A non DCAT-BR managed concept is used to indicate the access right. If no corresponding can be found inform the maintainer of the DCAT-BR access rights vocabulary."@en ;
        sh:severity sh:Violation
    ], [
        sh:node :ThemeRestriction ;
        sh:nodeKind sh:IRI ;
        sh:path dcat:theme ;
        sh:description "Múltiplos temas podem ser usados, mas pelo menos um conceito de <https://dcat-br.github.io/dcat-br/docs/vocabularies/themes/> deve estar presente."@pt-BR ;
        sh:description "Multiple themes can be used but at least one concept of <https://dcat-br.github.io/dcat-br/docs/vocabularies/themes/> should be present."@en ;
        sh:severity sh:Warning
    ], [
        sh:node :ResourceTypeRestriction ;
        sh:nodeKind sh:IRI ;
        sh:path dct:type ;
        sh:description "Múltiplos tipos podem ser usados, mas é recomendado fornecer pelo menos um conceito de <https://dcat-br.github.io/dcat-br/docs/vocabularies/tipo-recurso/>."@pt-BR ;
        sh:description "Multiple types can be used but it is recommended to also provide at least one concept of <https://dcat-br.github.io/dcat-br/docs/vocabularies/tipo-recurso/> should be present."@en ;
        sh:severity sh:Warning
    ] ;
    sh:targetClass dcat:Dataset .

#-------------------------------------------------------------------------
# Shapes para Distribution com restrições de vocabulários controlados
#-------------------------------------------------------------------------

:Distribution_ShapeCV
    a sh:NodeShape ;
    sh:property [
        sh:node :FormatRestriction ;
        sh:nodeKind sh:IRI ;
        sh:path dct:format ;
        sh:description "Um formato deve usar um conceito do vocabulário DCAT-BR de formatos."@pt-BR ;
        sh:description "A format should use a concept from the DCAT-BR format vocabulary."@en ;
        sh:severity sh:Warning
    ], [
        sh:node :LicenseRestriction ;
        sh:nodeKind sh:IRI ;
        sh:path dct:license ;
        sh:description "Uma licença deve usar um conceito do vocabulário DCAT-BR de licenças (VCR-LU)."@pt-BR ;
        sh:description "A license should use a concept from the DCAT-BR license vocabulary (VCR-LU)."@en ;
        sh:severity sh:Warning
    ], [
        sh:node :AccessRightRestriction ;
        sh:nodeKind sh:IRI ;
        sh:path dct:accessRights ;
        sh:description "A observância legal deve usar um conceito do vocabulário SEI do DCAT-BR."@pt-BR ;
        sh:description "Access rights should use a concept from the DCAT-BR SEI vocabulary."@en ;
        sh:severity sh:Warning
    ] ;
    sh:targetClass dcat:Distribution .

#-------------------------------------------------------------------------
# Shapes para DataService com restrições de vocabulários controlados
#-------------------------------------------------------------------------

:DataService_ShapeCV
    a sh:NodeShape ;
    sh:property [
        sh:node :AccessRightRestriction ;
        sh:nodeKind sh:IRI ;
        sh:path dct:accessRights ;
        sh:description "Um conceito não gerenciado pelo DCAT-BR é usado para indicar a observância legal. Se nenhum correspondente for encontrado, informe o mantenedor do vocabulário de observância legal do DCAT-BR."@pt-BR ;
        sh:description "A non DCAT-BR managed concept is used to indicate the access right. If no corresponding can be found inform the maintainer of the DCAT-BR access rights vocabulary."@en ;
        sh:severity sh:Violation
    ] ;
    sh:targetClass dcat:DataService .

