@prefix : <https://ontology.inferal.com/modules/ontology-migration/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix earl: <http://www.w3.org/ns/earl#> .
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
@prefix mod: <https://w3id.org/mod#> .
@prefix ord: <https://ontology.inferal.com/modules/ordering/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pubacc: <https://ontology.inferal.com/modules/publication-access/> .
@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 vann: <http://purl.org/vocab/vann/> .

:
    a owl:Ontology, pubacc:PublicationManagedOntology ;
    dcterms:accessRights pubacc:PublicAccess ;
    owl:imports ord: ;
    dcterms:title "Ontology Data Migration" ;
    dcterms:description "Describes executable migration sets that carry RDF data between ontology versions or ontology families, select source and target validation gates, identify additive transformation and staged retraction cases, relate corresponding reverse migrations, and pair source and target query-evaluation tests without claiming semantic completeness." ;
    dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
    dcterms:source <https://www.w3.org/TR/shacl-af/> ;
    dcterms:references
        <https://incatools.github.io/kgcl/>,
        <https://mapping-commons.github.io/sssom/spec-model/>,
        <https://ontology.inferal.com/modules/artifact-evolution/>,
        ord:,
        <https://www.w3.org/2001/sw/DataAccess/tests/README.html>,
        <https://www.w3.org/TR/EARL10-Schema/>,
        <https://www.w3.org/TR/sparql11-query/>,
        <https://www.w3.org/TR/sparql11-update/>,
        <https://www.w3.org/TR/shacl12-rules/> ;
    vann:preferredNamespacePrefix "om" ;
    vann:preferredNamespaceUri "https://ontology.inferal.com/modules/ontology-migration/" ;
    mod:status "draft" ;
    rdfs:label "Ontology Data Migration" ;
    rdfs:comment "This module identifies the source and target ontologies of a migration set, the SHACL shapes graphs that gate execution, the assembled shapes graph whose rules a processor executes, its explicitly associated SHACL-AF transformation cases, corresponding reverse migrations, optional paired query-evaluation tests, and the named SHACL-AF rules that plan exact post-validation source-triple retractions. SHACL-AF supplies transformation rule semantics, W3C test manifests supply test structure, EARL supplies outcome evidence, and the Ordering Ontology supplies semantic rule dependencies. This vocabulary adds only the migration-specific relations those models do not provide." ;
    owl:versionInfo "0.1.0" .

:OntologyMigrationSet
    a rdfs:Class ;
    rdfs:label "ontology migration set" ;
    rdfs:comment "A directional executable mapping resource that associates one source ontology, one target ontology, source and target validation gates, and one or more additive SHACL-AF transformation cases. Its cases may identify named post-validation SHACL-AF rules whose constructed triples form an exact source-retraction plan. It may be related to a corresponding reverse migration and to verification cases, but it is not an edit history, an equivalence or completeness claim, or authorization to delete data." ;
    rdfs:isDefinedBy : .

:sourceOntology
    a rdf:Property ;
    rdfs:label "source ontology" ;
    rdfs:comment "Identifies the ontology whose terms and instance patterns are accepted as input by an ontology migration set. A publisher should use a release-specific ontology IRI when reproducible execution depends on a particular release; this property does not identify the source data graph." ;
    rdfs:domain :OntologyMigrationSet ;
    rdfs:range owl:Ontology ;
    rdfs:isDefinedBy : .

:targetOntology
    a rdf:Property ;
    rdfs:label "target ontology" ;
    rdfs:comment "Identifies the ontology whose terms and instance patterns are constructed by an ontology migration set. A publisher should use a release-specific ontology IRI when reproducible execution depends on a particular release; this property does not identify the target data graph." ;
    rdfs:domain :OntologyMigrationSet ;
    rdfs:range owl:Ontology ;
    rdfs:isDefinedBy : .

:hasCase
    a rdf:Property ;
    rdfs:label "has case" ;
    rdfs:comment "Associates an ontology migration set with a SHACL node shape that acts as one explicitly selected additive transformation case. It is the inverse of case of in the OWL addendum." ;
    rdfs:domain :OntologyMigrationSet ;
    rdfs:range <http://www.w3.org/ns/shacl#NodeShape> ;
    rdfs:isDefinedBy : .

:caseOf
    a rdf:Property ;
    rdfs:label "case of" ;
    rdfs:comment "Associates a SHACL node shape used as an additive transformation case with an ontology migration set to which it belongs. A case may belong to more than one set, and publishers may assert this direction without editing the migration-set resource; it is the inverse of has case in the OWL addendum." ;
    rdfs:domain <http://www.w3.org/ns/shacl#NodeShape> ;
    rdfs:range :OntologyMigrationSet ;
    rdfs:isDefinedBy : .

:sourceShapesGraph
    a rdf:Property ;
    rdfs:label "source shapes graph" ;
    rdfs:comment "Identifies the concrete SHACL shapes graph used to validate source data before any additive migration rule executes. The graph expresses the assumptions required by this migration and need not be the source ontology's canonical shapes graph; it does not identify the source data graph." ;
    rdfs:domain :OntologyMigrationSet ;
    rdfs:range rdfs:Resource ;
    rdfs:isDefinedBy : .

:targetShapesGraph
    a rdf:Property ;
    rdfs:label "target shapes graph" ;
    rdfs:comment "Identifies the concrete SHACL shapes graph used to validate the final target consumer view after additive migration and before any retraction plan is constructed. The graph expresses the target-conformance contract for this migration and need not be the target ontology's canonical shapes graph; it does not identify the target data graph." ;
    rdfs:domain :OntologyMigrationSet ;
    rdfs:range rdfs:Resource ;
    rdfs:isDefinedBy : .

:executionShapesGraph
    a rdf:Property ;
    rdfs:label "execution shapes graph" ;
    rdfs:comment "Identifies the concrete assembled SHACL shapes graph whose rules a processor executes for this migration set. The graph reaches every transformation case of the set and declares SHACL rules entailment on itself; it is distinct from the source and target validation gates and does not identify the source or target data graph." ;
    rdfs:domain :OntologyMigrationSet ;
    rdfs:range rdfs:Resource ;
    rdfs:isDefinedBy : .

:reverseMigration
    a rdf:Property ;
    rdfs:label "reverse migration" ;
    rdfs:comment "Relates a migration set to a corresponding migration whose source and target ontology endpoints are swapped. The relation supports reverse discovery but does not claim symmetry, logical inverse behavior, losslessness, round-trip identity, or equal coverage." ;
    rdfs:domain :OntologyMigrationSet ;
    rdfs:range :OntologyMigrationSet ;
    rdfs:isDefinedBy : .

:hasRetractionRule
    a rdf:Property ;
    rdfs:label "has retraction rule" ;
    rdfs:comment "Associates a migration case node shape with a named SHACL SPARQL Rule evaluated only after all additive transformation rules complete and the final target consumer view conforms. The rule constructs source triples eligible for later, separately authorized retraction; this phase relation is deliberately distinct from sh:rule and does not itself execute the rule, delete data, or authorize deletion. It is the inverse of retraction rule of in the OWL addendum." ;
    rdfs:domain sh:NodeShape ;
    rdfs:range sh:SPARQLRule ;
    rdfs:isDefinedBy : .

:retractionRuleOf
    a rdf:Property ;
    rdfs:label "retraction rule of" ;
    rdfs:comment "Associates a named SHACL SPARQL Rule with a migration case node shape for which it constructs a post-validation source-retraction plan. A rule may serve more than one case, and publishers may assert this direction without editing the case resource; it is the inverse of has retraction rule in the OWL addendum." ;
    rdfs:domain sh:SPARQLRule ;
    rdfs:range sh:NodeShape ;
    rdfs:isDefinedBy : .

:MigrationVerificationCase
    a rdfs:Class ;
    rdfs:subClassOf earl:TestCase ;
    rdfs:label "migration verification case" ;
    rdfs:comment "An atomic test criterion that pairs one source-side and one target-side W3C query-evaluation test for a migration set. The paired tests use a common expected result so differently expressed source and target observations can be compared without asserting that the migration is complete outside the tested fixture and criterion." ;
    rdfs:isDefinedBy : .

:verificationOf
    a rdf:Property ;
    rdfs:label "verification of" ;
    rdfs:comment "Identifies the ontology migration set evaluated by a migration verification case. Test execution outcomes are recorded separately as EARL assertions and do not become intrinsic properties of the migration set." ;
    rdfs:domain :MigrationVerificationCase ;
    rdfs:range :OntologyMigrationSet ;
    rdfs:isDefinedBy : .

:sourceTest
    a rdf:Property ;
    rdfs:label "source test" ;
    rdfs:comment "Identifies the W3C query-evaluation test that observes the declared source fixture before migration. Its query and data are supplied by the test manifest, and its expected result is shared with the paired target test." ;
    rdfs:domain :MigrationVerificationCase ;
    rdfs:range mf:QueryEvaluationTest ;
    rdfs:isDefinedBy : .

:targetTest
    a rdf:Property ;
    rdfs:label "target test" ;
    rdfs:comment "Identifies the W3C query-evaluation test that observes the target fixture produced by executing the migration over the paired source fixture. Its expected result is shared with the source test, allowing each ontology to use its own observation query." ;
    rdfs:domain :MigrationVerificationCase ;
    rdfs:range mf:QueryEvaluationTest ;
    rdfs:isDefinedBy : .
