# IMF-M 1.0.0-beta.1 — preliminary SHACL validation profile
# Use asserted instance data plus the ontology's named class hierarchy. No entailment expansion.
# Counts use distinct RDF terms; absence of owl:sameAs is not logical inequality.
# The two optional explicit-completeness shapes are deactivated.
# Core constraints check signatures, typing and cardinalities; SPARQL checks paths and comparisons.
# Referenced RDL terms may be untyped IRIs. No RDL or IMF-I interpretation is attempted.

@prefix dct: <http://purl.org/dc/terms/> .
@prefix imf: <https://ns.imfid.org/imf-m/id/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix shp: <https://ns.imfid.org/imf-m/shapes/main#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<https://ns.imfid.org/imf-m/shapes/main> a owl:Ontology ;
    owl:versionIRI <https://ns.imfid.org/imf-m/1.0.0-beta.1/shapes/main> ;
    owl:versionInfo "1.0.0-beta.1" ;
    owl:priorVersion <https://ns.imfid.org/imf-m/0.3.0/shapes/main> ;
    rdfs:label "IMF-M — asserted-graph validation profile"@en ;
    dct:relation <https://ns.imfid.org/imf-m/1.0.0-beta.1/ontology/main> ;
    dct:license <https://creativecommons.org/licenses/by/4.0/> ;
    rdfs:comment "Preliminary beta SHACL profile. Validate asserted instance data with the named class hierarchy available; do not run OWL/RDFS materialization. Counts use RDF terms. Missing Context or Medium links are addressed by optional completeness shapes. Reference IRIs need not be locally typed. No IMF-I translation, RDL-aware nature/form validation, engineering verification, or elementary-proxy materialization is provided."@en .

shp:AspectNotCategory a sh:NodeShape ;
    sh:not [ sh:class imf:Category ] ;
    sh:targetClass imf:Aspect .

shp:AspectNotInterest a sh:NodeShape ;
    sh:not [ sh:class imf:Interest ] ;
    sh:targetClass imf:Aspect .

shp:AspectNotModality a sh:NodeShape ;
    sh:not [ sh:class imf:Modality ] ;
    sh:targetClass imf:Aspect .

shp:BlockConnections a sh:NodeShape ;
    sh:property [ sh:class imf:Connector ;
            sh:path _:N9a69ad89df6d4b80976e13fbf79350d6 ] ;
    sh:targetClass imf:Block .

shp:BlockNotCharacterization a sh:NodeShape ;
    sh:not [ sh:class imf:Characterization ] ;
    sh:targetClass imf:Block .

shp:CategoryNotInterest a sh:NodeShape ;
    sh:not [ sh:class imf:Interest ] ;
    sh:targetClass imf:Category .

shp:CategoryNotModality a sh:NodeShape ;
    sh:not [ sh:class imf:Modality ] ;
    sh:targetClass imf:Category .

shp:CharacterizationAcyclic a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Characterization structure must be acyclic." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this (imf:hasCharacterization|imf:hasInterface|imf:hasMedium|imf:hasPurpose|imf:hasProperty)+ $this .
}""" ] ;
    sh:targetClass imf:Definition .

shp:ConnectivityConverse a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Every asserted Block–Connector connection must be mediated by an Interface." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this (imf:connectedTo|^imf:connectedTo) ?c .
FILTER NOT EXISTS { $this imf:hasInterface/imf:fulfilledBy ?c . }
}""" ] ;
    sh:targetClass imf:Block .

shp:ConnectorConnections a sh:NodeShape ;
    sh:property [ sh:class imf:Block ;
            sh:path _:N9a69ad89df6d4b80976e13fbf79350d6 ] ;
    sh:targetClass imf:Connector .

shp:ConnectorFulfilledInterfaceMaximum a sh:NodeShape ;
    sh:property [ sh:path [ sh:inversePath imf:fulfilledBy ] ;
            sh:qualifiedMaxCount 2 ;
            sh:qualifiedValueShape [ sh:class imf:Interface ] ] ;
    sh:targetClass imf:Connector .

shp:ConnectorNotInterface a sh:NodeShape ;
    sh:not [ sh:class imf:Interface ] ;
    sh:targetClass imf:Connector .

shp:ConnectorNotMedium a sh:NodeShape ;
    sh:not [ sh:class imf:Medium ] ;
    sh:targetClass imf:Connector .

shp:ConnectorNotProperty a sh:NodeShape ;
    sh:not [ sh:class imf:Property ] ;
    sh:targetClass imf:Connector .

shp:ConnectorNotPurpose a sh:NodeShape ;
    sh:not [ sh:class imf:Purpose ] ;
    sh:targetClass imf:Connector .

shp:ContextMaximum a sh:NodeShape ;
    sh:property [ sh:path imf:hasContextParameter ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedValueShape [ sh:class imf:Interest ] ],
        [ sh:path imf:hasContextParameter ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedValueShape [ sh:in ( imf:aspectFunction imf:aspectProduct imf:aspectArrangement imf:aspectPerformance imf:aspectInstalled imf:aspectLocation ) ] ],
        [ sh:path imf:hasContextParameter ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedValueShape [ sh:in ( imf:modalityActual imf:modalityIntended imf:modalityPattern ) ] ],
        [ sh:path imf:hasContextParameter ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedValueShape [ sh:in ( imf:categoryCapability imf:categoryImplementation imf:categorySpatial ) ] ] ;
    sh:targetClass imf:Characterization,
        imf:Element .

shp:ContextParameterValues a sh:NodeShape ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:or ( [ sh:in ( imf:modalityActual imf:modalityIntended imf:modalityPattern imf:categoryCapability imf:categoryImplementation imf:categorySpatial imf:aspectFunction imf:aspectProduct imf:aspectArrangement imf:aspectPerformance imf:aspectInstalled imf:aspectLocation ) ] [ sh:class imf:Interest ] ) ;
            sh:path imf:hasContextParameter ] ;
    sh:targetSubjectsOf imf:hasContextParameter .

shp:CrossContextDifference a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "crossContextParameterRelation requires different Contexts." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:crossContextParameterRelation ?other .
$this imf:hasContextParameter ?rawModalityA .
FILTER(?rawModalityA IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityA IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityA IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityA)) AS ?ModalityA)
?other imf:hasContextParameter ?rawModalityB .
FILTER(?rawModalityB IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityB IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityB IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityB)) AS ?ModalityB)
$this imf:hasContextParameter ?rawCategoryA .
FILTER(?rawCategoryA IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryA IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryA IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryA IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryA))) AS ?CategoryA)
?other imf:hasContextParameter ?rawCategoryB .
FILTER(?rawCategoryB IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryB IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryB IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryB IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryB))) AS ?CategoryB)
$this imf:hasContextParameter ?InterestA .
?InterestA rdf:type/rdfs:subClassOf* imf:Interest .
?other imf:hasContextParameter ?InterestB .
?InterestB rdf:type/rdfs:subClassOf* imf:Interest .
FILTER((?ModalityA = ?ModalityB) && (?CategoryA = ?CategoryB) && (?InterestA = ?InterestB || EXISTS { ?InterestA (owl:sameAs|^owl:sameAs)+ ?InterestB }))
}""" ] ;
    sh:targetSubjectsOf imf:crossContextParameterRelation .

shp:DecompositionAcyclic a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Decomposition must be acyclic." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this (imf:partOf|^imf:hasPart)+ $this .
}""" ] ;
    sh:targetClass imf:Element .

shp:DefinitionNotDefinitionTerm a sh:NodeShape ;
    sh:not [ sh:class imf:DefinitionTerm ] ;
    sh:targetClass imf:Definition .

shp:DefinitionTermNoOutgoingTerms a sh:NodeShape ;
    sh:property [ sh:maxCount 0 ;
            sh:path [ sh:alternativePath ( imf:action imf:classifier imf:hasCondition imf:hasContextParameter imf:hasQualifier imf:mechanism imf:reference imf:target imf:targetRefinement imf:termRelation imf:uom ) ] ] ;
    sh:targetClass imf:DefinitionTerm .

shp:DirectParentMaximum a sh:NodeShape ;
    sh:property [ sh:class imf:Element ;
            sh:maxCount 1 ;
            sh:path [ sh:alternativePath ( imf:partOf [ sh:inversePath imf:hasPart ] ) ] ] ;
    sh:targetClass imf:Element .

shp:ElementNotInterface a sh:NodeShape ;
    sh:not [ sh:class imf:Interface ] ;
    sh:targetClass imf:Element .

shp:ElementNotMedium a sh:NodeShape ;
    sh:not [ sh:class imf:Medium ] ;
    sh:targetClass imf:Element .

shp:ElementNotProperty a sh:NodeShape ;
    sh:not [ sh:class imf:Property ] ;
    sh:targetClass imf:Element .

shp:ElementNotPurpose a sh:NodeShape ;
    sh:not [ sh:class imf:Purpose ] ;
    sh:targetClass imf:Element .

shp:ElementPartition a sh:NodeShape ;
    sh:targetClass imf:Element ;
    sh:xone ( [ sh:class imf:Block ] [ sh:class imf:Connector ] ) .

shp:ExplicitContextCompleteness_OPTIONAL a sh:NodeShape ;
    sh:deactivated true ;
    sh:or ( [ sh:property [ sh:path imf:hasContextParameter ;
                        sh:qualifiedMinCount 1 ;
                        sh:qualifiedValueShape [ sh:in ( imf:aspectFunction imf:aspectProduct imf:aspectArrangement imf:aspectPerformance imf:aspectInstalled imf:aspectLocation ) ] ] ] [ sh:and ( [ sh:property [ sh:path imf:hasContextParameter ;
                                    sh:qualifiedMinCount 1 ;
                                    sh:qualifiedValueShape [ sh:in ( imf:modalityActual imf:modalityIntended imf:modalityPattern ) ] ] ] [ sh:property [ sh:path imf:hasContextParameter ;
                                    sh:qualifiedMinCount 1 ;
                                    sh:qualifiedValueShape [ sh:in ( imf:categoryCapability imf:categoryImplementation imf:categorySpatial ) ] ] ] ) ] ) ;
    sh:property [ sh:path imf:hasContextParameter ;
            sh:qualifiedMinCount 1 ;
            sh:qualifiedValueShape [ sh:class imf:Interest ] ] ;
    sh:targetClass imf:Element .

shp:ExplicitMediumCompleteness_OPTIONAL a sh:NodeShape ;
    sh:deactivated true ;
    sh:property [ sh:minCount 1 ;
            sh:path imf:hasMedium ] ;
    sh:targetClass imf:Connector,
        imf:Interface .

shp:InterestNotModality a sh:NodeShape ;
    sh:not [ sh:class imf:Modality ] ;
    sh:targetClass imf:Interest .

shp:InterfaceFulfillmentMaximum a sh:NodeShape ;
    sh:property [ sh:class imf:Connector ;
            sh:maxCount 1 ;
            sh:path imf:fulfilledBy ] ;
    sh:targetClass imf:Interface .

shp:InterfaceNotMedium a sh:NodeShape ;
    sh:not [ sh:class imf:Medium ] ;
    sh:targetClass imf:Interface .

shp:InterfaceNotProperty a sh:NodeShape ;
    sh:not [ sh:class imf:Property ] ;
    sh:targetClass imf:Interface .

shp:InterfaceNotPurpose a sh:NodeShape ;
    sh:not [ sh:class imf:Purpose ] ;
    sh:targetClass imf:Interface .

shp:InterfaceOwnerComparability a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Blocks sharing an Interface must be pairwise comparable by decomposition ancestry." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
?b1 imf:hasInterface $this .
?b2 imf:hasInterface $this .
FILTER(?b1 != ?b2)
FILTER NOT EXISTS { ?b1 (owl:sameAs|^owl:sameAs)+ ?b2 }
FILTER NOT EXISTS { ?b1 (imf:partOf|^imf:hasPart)+ ?b2 }
FILTER NOT EXISTS { ?b2 (imf:partOf|^imf:hasPart)+ ?b1 }
}""" ] ;
    sh:targetClass imf:Interface ;
    sh:targetObjectsOf imf:hasInterface .

shp:MechanismMaximum a sh:NodeShape ;
    sh:property [ sh:maxCount 1 ;
            sh:path imf:mechanism ] ;
    sh:targetClass imf:Characterization .

shp:MediumMaximum a sh:NodeShape ;
    sh:property [ sh:class imf:Medium ;
            sh:maxCount 1 ;
            sh:path imf:hasMedium ] ;
    sh:targetClass imf:Connector,
        imf:Interface .

shp:MediumNotProperty a sh:NodeShape ;
    sh:not [ sh:class imf:Property ] ;
    sh:targetClass imf:Medium .

shp:MediumNotPurpose a sh:NodeShape ;
    sh:not [ sh:class imf:Purpose ] ;
    sh:targetClass imf:Medium .

shp:NonElementCharacterizationNoInterest a sh:NodeShape ;
    sh:or ( [ sh:class imf:Element ] [ sh:property [ sh:path imf:hasContextParameter ;
                        sh:qualifiedMaxCount 0 ;
                        sh:qualifiedValueShape [ sh:class imf:Interest ] ] ] ) ;
    sh:targetClass imf:Characterization .

shp:PropertyFields a sh:NodeShape ;
    sh:property [ sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:IRI ;
            sh:path imf:classifier ],
        [ sh:maxCount 1 ;
            sh:nodeKind sh:IRI ;
            sh:path imf:hasQualifier ],
        [ sh:maxCount 1 ;
            sh:nodeKind sh:IRI ;
            sh:path imf:hasCondition ],
        [ sh:maxCount 1 ;
            sh:nodeKind sh:IRIOrLiteral ;
            sh:path imf:value ],
        [ sh:maxCount 1 ;
            sh:nodeKind sh:IRI ;
            sh:path imf:uom ] ;
    sh:targetClass imf:Property .

shp:PropertyNotPurpose a sh:NodeShape ;
    sh:not [ sh:class imf:Purpose ] ;
    sh:targetClass imf:Property .

shp:ProxySameContextDifferentIndividuals a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Proxy-related Elements in the same Context cannot be explicitly different." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this (imf:proxy|imf:modalityProxy|imf:categoryProxy|imf:interestProxy|^imf:proxy|^imf:modalityProxy|^imf:categoryProxy|^imf:interestProxy)+ ?other .
FILTER($this != ?other)
$this imf:hasContextParameter ?rawModalityA .
FILTER(?rawModalityA IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityA IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityA IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityA)) AS ?ModalityA)
?other imf:hasContextParameter ?rawModalityB .
FILTER(?rawModalityB IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityB IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityB IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityB)) AS ?ModalityB)
$this imf:hasContextParameter ?rawCategoryA .
FILTER(?rawCategoryA IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryA IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryA IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryA IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryA))) AS ?CategoryA)
?other imf:hasContextParameter ?rawCategoryB .
FILTER(?rawCategoryB IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryB IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryB IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryB IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryB))) AS ?CategoryB)
$this imf:hasContextParameter ?InterestA .
?InterestA rdf:type/rdfs:subClassOf* imf:Interest .
?other imf:hasContextParameter ?InterestB .
?InterestB rdf:type/rdfs:subClassOf* imf:Interest .
FILTER((?ModalityA = ?ModalityB) && (?CategoryA = ?CategoryB) && (?InterestA = ?InterestB || EXISTS { ?InterestA (owl:sameAs|^owl:sameAs)+ ?InterestB }))
$this (owl:differentFrom|^owl:differentFrom) ?other .
}""" ] ;
    sh:targetClass imf:Element .

shp:ProxySameContextIdentityWarning a sh:NodeShape ;
    sh:severity sh:Warning ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Proxy-related Elements in the same Context denote one Element; reconcile names or make identity explicit." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this (imf:proxy|imf:modalityProxy|imf:categoryProxy|imf:interestProxy|^imf:proxy|^imf:modalityProxy|^imf:categoryProxy|^imf:interestProxy)+ ?other .
FILTER($this != ?other)
$this imf:hasContextParameter ?rawModalityA .
FILTER(?rawModalityA IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityA IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityA IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityA)) AS ?ModalityA)
?other imf:hasContextParameter ?rawModalityB .
FILTER(?rawModalityB IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityB IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityB IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityB)) AS ?ModalityB)
$this imf:hasContextParameter ?rawCategoryA .
FILTER(?rawCategoryA IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryA IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryA IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryA IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryA))) AS ?CategoryA)
?other imf:hasContextParameter ?rawCategoryB .
FILTER(?rawCategoryB IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryB IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryB IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryB IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryB))) AS ?CategoryB)
$this imf:hasContextParameter ?InterestA .
?InterestA rdf:type/rdfs:subClassOf* imf:Interest .
?other imf:hasContextParameter ?InterestB .
?InterestB rdf:type/rdfs:subClassOf* imf:Interest .
FILTER((?ModalityA = ?ModalityB) && (?CategoryA = ?CategoryB) && (?InterestA = ?InterestB || EXISTS { ?InterestA (owl:sameAs|^owl:sameAs)+ ?InterestB }))
FILTER NOT EXISTS { $this (owl:sameAs|^owl:sameAs)+ ?other }
}""" ] ;
    sh:targetClass imf:Element .

shp:PurposeCapability a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "A Purpose may only be interpreted under the Capability Category." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this (imf:hasCharacterization|imf:hasInterface|imf:hasMedium|imf:hasPurpose|imf:hasProperty|imf:sameAspectRelation|imf:interestProxy|^imf:hasCharacterization|^imf:hasInterface|^imf:hasMedium|^imf:hasPurpose|^imf:hasProperty|^imf:sameAspectRelation|^imf:interestProxy|(imf:partOf|imf:hasPart|imf:sameContextParameterRelation|^imf:partOf|^imf:hasPart|^imf:sameContextParameterRelation|(imf:connectedTo|^imf:connectedTo|(imf:hasInterface/imf:fulfilledBy)|(^imf:fulfilledBy/^imf:hasInterface))))* ?other .
?other imf:hasContextParameter ?rawCategoryA .
FILTER(?rawCategoryA IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryA IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryA IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryA IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryA))) AS ?CategoryA)
FILTER(?CategoryA != imf:categoryCapability)
}""" ] ;
    sh:targetClass imf:Purpose .

shp:PurposeFields a sh:NodeShape ;
    sh:property [ sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:IRI ;
            sh:path imf:action ],
        [ sh:maxCount 1 ;
            sh:minCount 1 ;
            sh:nodeKind sh:IRI ;
            sh:path imf:target ],
        [ sh:maxCount 1 ;
            sh:nodeKind sh:IRI ;
            sh:path imf:targetRefinement ] ;
    sh:targetClass imf:Purpose .

shp:PurposeMaximum a sh:NodeShape ;
    sh:property [ sh:path [ sh:alternativePath ( imf:hasCharacterization imf:hasInterface imf:hasMedium imf:hasPurpose imf:hasProperty ) ] ;
            sh:qualifiedMaxCount 1 ;
            sh:qualifiedValueShape [ sh:class imf:Purpose ] ] ;
    sh:targetClass imf:Element .

shp:SameAsWarning a sh:NodeShape ;
    sh:property [ sh:maxCount 0 ;
            sh:message "owl:sameAs asserts identity. Confirm that identity, rather than pragmatic identity, is intended." ;
            sh:path owl:sameAs ;
            sh:severity sh:Warning ] ;
    sh:severity sh:Warning ;
    sh:targetSubjectsOf owl:sameAs .

shp:SameAspectCategory a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Definitions in the same Aspect structure must agree on Category (including named Aspect aliases)." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this (imf:hasCharacterization|imf:hasInterface|imf:hasMedium|imf:hasPurpose|imf:hasProperty|imf:sameAspectRelation|imf:interestProxy|^imf:hasCharacterization|^imf:hasInterface|^imf:hasMedium|^imf:hasPurpose|^imf:hasProperty|^imf:sameAspectRelation|^imf:interestProxy|(imf:partOf|imf:hasPart|imf:sameContextParameterRelation|^imf:partOf|^imf:hasPart|^imf:sameContextParameterRelation|(imf:connectedTo|^imf:connectedTo|(imf:hasInterface/imf:fulfilledBy)|(^imf:fulfilledBy/^imf:hasInterface))))* ?other .
$this imf:hasContextParameter ?rawCategoryA .
FILTER(?rawCategoryA IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryA IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryA IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryA IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryA))) AS ?CategoryA)
?other imf:hasContextParameter ?rawCategoryB .
FILTER(?rawCategoryB IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryB IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryB IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryB IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryB))) AS ?CategoryB)
FILTER(?CategoryA != ?CategoryB)
}""" ] ;
    sh:targetSubjectsOf imf:hasContextParameter .

shp:SameAspectModality a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Definitions in the same Aspect structure must agree on Modality (including named Aspect aliases)." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this (imf:hasCharacterization|imf:hasInterface|imf:hasMedium|imf:hasPurpose|imf:hasProperty|imf:sameAspectRelation|imf:interestProxy|^imf:hasCharacterization|^imf:hasInterface|^imf:hasMedium|^imf:hasPurpose|^imf:hasProperty|^imf:sameAspectRelation|^imf:interestProxy|(imf:partOf|imf:hasPart|imf:sameContextParameterRelation|^imf:partOf|^imf:hasPart|^imf:sameContextParameterRelation|(imf:connectedTo|^imf:connectedTo|(imf:hasInterface/imf:fulfilledBy)|(^imf:fulfilledBy/^imf:hasInterface))))* ?other .
$this imf:hasContextParameter ?rawModalityA .
FILTER(?rawModalityA IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityA IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityA IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityA)) AS ?ModalityA)
?other imf:hasContextParameter ?rawModalityB .
FILTER(?rawModalityB IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityB IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityB IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityB)) AS ?ModalityB)
FILTER(?ModalityA != ?ModalityB)
}""" ] ;
    sh:targetSubjectsOf imf:hasContextParameter .

shp:SameContextInterest a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Context-preserving relations must preserve Interest." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this (imf:partOf|imf:hasPart|imf:sameContextParameterRelation|^imf:partOf|^imf:hasPart|^imf:sameContextParameterRelation|(imf:connectedTo|^imf:connectedTo|(imf:hasInterface/imf:fulfilledBy)|(^imf:fulfilledBy/^imf:hasInterface)))+ ?other .
$this imf:hasContextParameter ?InterestA .
?InterestA rdf:type/rdfs:subClassOf* imf:Interest .
?other imf:hasContextParameter ?InterestB .
?InterestB rdf:type/rdfs:subClassOf* imf:Interest .
FILTER(?InterestA != ?InterestB)
FILTER NOT EXISTS { ?InterestA (owl:sameAs|^owl:sameAs)+ ?InterestB }
}""" ] ;
    sh:targetClass imf:Element .

shp:UniqueInterveningInterface a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "At most one Interface may mediate a particular Block–Connector connection (counts asserted RDF nodes)." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:hasInterface ?i, ?j .
?i imf:fulfilledBy ?c .
?j imf:fulfilledBy ?c .
FILTER(?i != ?j)
}""" ] ;
    sh:targetClass imf:Block .

shp:ValueAnnotation a sh:NodeShape ;
    sh:class imf:Property ;
    sh:property [ sh:maxCount 1 ;
            sh:nodeKind sh:IRIOrLiteral ;
            sh:path imf:value ] ;
    sh:targetSubjectsOf imf:value .

shp:actionSignature a sh:NodeShape ;
    sh:class imf:Purpose ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:not [ sh:class imf:Definition ] ;
            sh:path imf:action ] ;
    sh:targetSubjectsOf imf:action .

shp:categoryProxyCategory a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "categoryProxy must change Category." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:categoryProxy ?other .
$this imf:hasContextParameter ?rawCategoryA .
FILTER(?rawCategoryA IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryA IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryA IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryA IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryA))) AS ?CategoryA)
?other imf:hasContextParameter ?rawCategoryB .
FILTER(?rawCategoryB IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryB IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryB IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryB IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryB))) AS ?CategoryB)
FILTER(?CategoryA = ?CategoryB)
}""" ] ;
    sh:targetSubjectsOf imf:categoryProxy .

shp:categoryProxyInterest a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "categoryProxy must preserve Interest." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:categoryProxy ?other .
$this imf:hasContextParameter ?InterestA .
?InterestA rdf:type/rdfs:subClassOf* imf:Interest .
?other imf:hasContextParameter ?InterestB .
?InterestB rdf:type/rdfs:subClassOf* imf:Interest .
FILTER(!((?InterestA = ?InterestB || EXISTS { ?InterestA (owl:sameAs|^owl:sameAs)+ ?InterestB })))
}""" ] ;
    sh:targetSubjectsOf imf:categoryProxy .

shp:categoryProxyIrreflexive a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Elementary proxy must be irreflexive." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:categoryProxy ?other .
FILTER($this = ?other || EXISTS { $this (owl:sameAs|^owl:sameAs)+ ?other })
}""" ] ;
    sh:targetSubjectsOf imf:categoryProxy .

shp:categoryProxyModality a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "categoryProxy must preserve Modality." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:categoryProxy ?other .
$this imf:hasContextParameter ?rawModalityA .
FILTER(?rawModalityA IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityA IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityA IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityA)) AS ?ModalityA)
?other imf:hasContextParameter ?rawModalityB .
FILTER(?rawModalityB IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityB IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityB IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityB)) AS ?ModalityB)
FILTER(!(?ModalityA = ?ModalityB))
}""" ] ;
    sh:targetSubjectsOf imf:categoryProxy .

shp:categoryProxySignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Element ;
            sh:path imf:categoryProxy ] ;
    sh:targetSubjectsOf imf:categoryProxy .

shp:classifierSignature a sh:NodeShape ;
    sh:class imf:Definition ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:not [ sh:class imf:Definition ] ;
            sh:path imf:classifier ] ;
    sh:targetSubjectsOf imf:classifier .

shp:connectedToSignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Element ;
            sh:path imf:connectedTo ] ;
    sh:targetSubjectsOf imf:connectedTo .

shp:crossContextParameterRelationSignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Element ;
            sh:path imf:crossContextParameterRelation ] ;
    sh:targetSubjectsOf imf:crossContextParameterRelation .

shp:elementRelationSignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Element ;
            sh:path imf:elementRelation ] ;
    sh:targetSubjectsOf imf:elementRelation .

shp:fulfilledBySignature a sh:NodeShape ;
    sh:class imf:Characterization ;
    sh:property [ sh:class imf:Characterization ;
            sh:path imf:fulfilledBy ] ;
    sh:targetSubjectsOf imf:fulfilledBy .

shp:hasCharacterizationSignature a sh:NodeShape ;
    sh:class imf:Definition ;
    sh:property [ sh:class imf:Characterization ;
            sh:not [ sh:class imf:Connector ] ;
            sh:path imf:hasCharacterization ] ;
    sh:targetSubjectsOf imf:hasCharacterization .

shp:hasConditionSignature a sh:NodeShape ;
    sh:class imf:Property ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:not [ sh:class imf:Definition ] ;
            sh:path imf:hasCondition ] ;
    sh:targetSubjectsOf imf:hasCondition .

shp:hasContextParameterSignature a sh:NodeShape ;
    sh:class imf:Definition ;
    sh:targetSubjectsOf imf:hasContextParameter .

shp:hasInterfaceSignature a sh:NodeShape ;
    sh:class imf:Block ;
    sh:property [ sh:class imf:Interface ;
            sh:path imf:hasInterface ] ;
    sh:targetSubjectsOf imf:hasInterface .

shp:hasMediumSignature a sh:NodeShape ;
    sh:or ( [ sh:class imf:Interface ] [ sh:class imf:Connector ] ) ;
    sh:property [ sh:class imf:Medium ;
            sh:path imf:hasMedium ] ;
    sh:targetSubjectsOf imf:hasMedium .

shp:hasPartSignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Element ;
            sh:path imf:hasPart ] ;
    sh:targetSubjectsOf imf:hasPart .

shp:hasPropertySignature a sh:NodeShape ;
    sh:class imf:Definition ;
    sh:property [ sh:class imf:Property ;
            sh:path imf:hasProperty ] ;
    sh:targetSubjectsOf imf:hasProperty .

shp:hasPurposeSignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Purpose ;
            sh:path imf:hasPurpose ] ;
    sh:targetSubjectsOf imf:hasPurpose .

shp:hasQualifierSignature a sh:NodeShape ;
    sh:class imf:Property ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:not [ sh:class imf:Definition ] ;
            sh:path imf:hasQualifier ] ;
    sh:targetSubjectsOf imf:hasQualifier .

shp:interestProxyCategory a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "interestProxy must preserve Category." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:interestProxy ?other .
$this imf:hasContextParameter ?rawCategoryA .
FILTER(?rawCategoryA IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryA IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryA IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryA IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryA))) AS ?CategoryA)
?other imf:hasContextParameter ?rawCategoryB .
FILTER(?rawCategoryB IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryB IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryB IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryB IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryB))) AS ?CategoryB)
FILTER(!(?CategoryA = ?CategoryB))
}""" ] ;
    sh:targetSubjectsOf imf:interestProxy .

shp:interestProxyInterest a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "interestProxy must change Interest." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:interestProxy ?other .
$this imf:hasContextParameter ?InterestA .
?InterestA rdf:type/rdfs:subClassOf* imf:Interest .
?other imf:hasContextParameter ?InterestB .
?InterestB rdf:type/rdfs:subClassOf* imf:Interest .
FILTER((?InterestA = ?InterestB || EXISTS { ?InterestA (owl:sameAs|^owl:sameAs)+ ?InterestB }))
}""" ] ;
    sh:targetSubjectsOf imf:interestProxy .

shp:interestProxyIrreflexive a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Elementary proxy must be irreflexive." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:interestProxy ?other .
FILTER($this = ?other || EXISTS { $this (owl:sameAs|^owl:sameAs)+ ?other })
}""" ] ;
    sh:targetSubjectsOf imf:interestProxy .

shp:interestProxyModality a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "interestProxy must preserve Modality." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:interestProxy ?other .
$this imf:hasContextParameter ?rawModalityA .
FILTER(?rawModalityA IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityA IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityA IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityA)) AS ?ModalityA)
?other imf:hasContextParameter ?rawModalityB .
FILTER(?rawModalityB IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityB IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityB IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityB)) AS ?ModalityB)
FILTER(!(?ModalityA = ?ModalityB))
}""" ] ;
    sh:targetSubjectsOf imf:interestProxy .

shp:interestProxySignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Element ;
            sh:path imf:interestProxy ] ;
    sh:targetSubjectsOf imf:interestProxy .

shp:mechanismSignature a sh:NodeShape ;
    sh:class imf:Characterization ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:not [ sh:class imf:Definition ] ;
            sh:path imf:mechanism ] ;
    sh:targetSubjectsOf imf:mechanism .

shp:modalityProxyCategory a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "modalityProxy must preserve Category." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:modalityProxy ?other .
$this imf:hasContextParameter ?rawCategoryA .
FILTER(?rawCategoryA IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryA IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryA IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryA IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryA))) AS ?CategoryA)
?other imf:hasContextParameter ?rawCategoryB .
FILTER(?rawCategoryB IN (imf:categoryCapability, imf:categoryImplementation, imf:categorySpatial, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawCategoryB IN (imf:aspectFunction, imf:aspectPerformance), imf:categoryCapability, IF(?rawCategoryB IN (imf:aspectProduct, imf:aspectInstalled), imf:categoryImplementation, IF(?rawCategoryB IN (imf:aspectArrangement, imf:aspectLocation), imf:categorySpatial, ?rawCategoryB))) AS ?CategoryB)
FILTER(!(?CategoryA = ?CategoryB))
}""" ] ;
    sh:targetSubjectsOf imf:modalityProxy .

shp:modalityProxyInterest a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "modalityProxy must preserve Interest." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:modalityProxy ?other .
$this imf:hasContextParameter ?InterestA .
?InterestA rdf:type/rdfs:subClassOf* imf:Interest .
?other imf:hasContextParameter ?InterestB .
?InterestB rdf:type/rdfs:subClassOf* imf:Interest .
FILTER(!((?InterestA = ?InterestB || EXISTS { ?InterestA (owl:sameAs|^owl:sameAs)+ ?InterestB })))
}""" ] ;
    sh:targetSubjectsOf imf:modalityProxy .

shp:modalityProxyIrreflexive a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "Elementary proxy must be irreflexive." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:modalityProxy ?other .
FILTER($this = ?other || EXISTS { $this (owl:sameAs|^owl:sameAs)+ ?other })
}""" ] ;
    sh:targetSubjectsOf imf:modalityProxy .

shp:modalityProxyModality a sh:NodeShape ;
    sh:sparql [ a sh:SPARQLConstraint ;
            sh:message "modalityProxy must change Modality." ;
            sh:select """PREFIX imf: <https://ns.imfid.org/imf-m/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT $this WHERE {
$this imf:modalityProxy ?other .
$this imf:hasContextParameter ?rawModalityA .
FILTER(?rawModalityA IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityA IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityA IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityA)) AS ?ModalityA)
?other imf:hasContextParameter ?rawModalityB .
FILTER(?rawModalityB IN (imf:modalityActual, imf:modalityIntended, imf:modalityPattern, imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement, imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation))
BIND(IF(?rawModalityB IN (imf:aspectFunction, imf:aspectProduct, imf:aspectArrangement), imf:modalityIntended, IF(?rawModalityB IN (imf:aspectPerformance, imf:aspectInstalled, imf:aspectLocation), imf:modalityActual, ?rawModalityB)) AS ?ModalityB)
FILTER(?ModalityA = ?ModalityB)
}""" ] ;
    sh:targetSubjectsOf imf:modalityProxy .

shp:modalityProxySignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Element ;
            sh:path imf:modalityProxy ] ;
    sh:targetSubjectsOf imf:modalityProxy .

shp:partOfSignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Element ;
            sh:path imf:partOf ] ;
    sh:targetSubjectsOf imf:partOf .

shp:proxySignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Element ;
            sh:path imf:proxy ] ;
    sh:targetSubjectsOf imf:proxy .

shp:referenceSignature a sh:NodeShape ;
    sh:class imf:Definition ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:not [ sh:class imf:Definition ] ;
            sh:path imf:reference ] ;
    sh:targetSubjectsOf imf:reference .

shp:sameAspectRelationSignature a sh:NodeShape ;
    sh:class imf:Definition ;
    sh:property [ sh:class imf:Definition ;
            sh:path imf:sameAspectRelation ] ;
    sh:targetSubjectsOf imf:sameAspectRelation .

shp:sameContextParameterRelationSignature a sh:NodeShape ;
    sh:class imf:Element ;
    sh:property [ sh:class imf:Element ;
            sh:path imf:sameContextParameterRelation ] ;
    sh:targetSubjectsOf imf:sameContextParameterRelation .

shp:structuringRelationSignature a sh:NodeShape ;
    sh:class imf:Definition ;
    sh:property [ sh:class imf:Definition ;
            sh:path imf:structuringRelation ] ;
    sh:targetSubjectsOf imf:structuringRelation .

shp:targetRefinementSignature a sh:NodeShape ;
    sh:class imf:Purpose ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:not [ sh:class imf:Definition ] ;
            sh:path imf:targetRefinement ] ;
    sh:targetSubjectsOf imf:targetRefinement .

shp:targetSignature a sh:NodeShape ;
    sh:class imf:Purpose ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:not [ sh:class imf:Definition ] ;
            sh:path imf:target ] ;
    sh:targetSubjectsOf imf:target .

shp:termRelationSignature a sh:NodeShape ;
    sh:class imf:Definition ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:not [ sh:class imf:Definition ] ;
            sh:path imf:termRelation ] ;
    sh:targetSubjectsOf imf:termRelation .

shp:uomSignature a sh:NodeShape ;
    sh:class imf:Property ;
    sh:property [ sh:nodeKind sh:IRI ;
            sh:not [ sh:class imf:Definition ] ;
            sh:path imf:uom ] ;
    sh:targetSubjectsOf imf:uom .

_:N1facca34ed24438fa29383a4e6e4c00d sh:inversePath imf:connectedTo .

_:N4ffc3b303fb847cbb76d1ae4b9f517e5 rdf:first _:N1facca34ed24438fa29383a4e6e4c00d ;
    rdf:rest ( ( imf:hasInterface imf:fulfilledBy ) ( [ sh:inversePath imf:fulfilledBy ] [ sh:inversePath imf:hasInterface ] ) ) .

_:Nb6afa41631da45a0ab2b1542ee4957d2 rdf:first imf:connectedTo ;
    rdf:rest _:N4ffc3b303fb847cbb76d1ae4b9f517e5 .

_:N9a69ad89df6d4b80976e13fbf79350d6 sh:alternativePath _:Nb6afa41631da45a0ab2b1542ee4957d2 .

