################################################################################
# MiKaDo ⇄ HDTO (Heritage Digital Twin Ontology) Alignment Bridge
#
# Bridge file aligning the MiKaDo ontology (`mko:`,
# https://w3id.org/durair/ontology/refoundation#) with the Heritage Digital
# Twin Ontology v1.1 (`hdto:`, ECHOES D7.1, 2026), itself a strict CIDOC CRM
# extension.
#
# Conceptual posture
# ------------------
# MiKaDo and HDTO operate at *complementary granularities of the same
# continuum*. HDTO captures, at the propositional-aggregation level,
# *which proposition set is contributed by which study to which heritage
# entity's digital twin*. MiKaDo captures, at the field-gesture level,
# *which situated act, by which operator, at which timestamp, on which
# 3D-anchored feature, with which on-device derivation, produced each
# proposition*.
#
# Each MiKaDo export bundle is therefore a natural candidate to be ingested
# as an `hdto:HC16 Heritage Proposition Set` added (via `hdto:HP30 added
# content`) to an `hdto:HC2 Heritage Digital Twin` of an `hdto:HC1 Heritage
# Entity` maintained at a quasi.modo institutional node.
#
# Convention
# ----------
# - `rdfs:subClassOf` is used at TBox level when every MiKaDo instance is
#   logically also an HDTO instance.
# - `owl:equivalentClass` / `owl:equivalentProperty` are reserved for cases
#   of full bidirectional equivalence (rare here).
# - `skos:closeMatch` is used at TBox level when alignment is conceptual but
#   not strictly subsumptive (typically because the HDTO target class
#   carries assumptions — institutional declaration, scholarly study —
#   that hold for *some* MiKaDo instances only).
# - `skos:exactMatch` between concepts (predicates) is used for predicate
#   alignments at TBox level when the semantic intent matches but
#   subsumption is not formally appropriate.
#
# Version : 0.1.0 (initial publication, May 2026).
# License : CC-BY 4.0
################################################################################

@prefix mko:     <https://w3id.org/durair/ontology/refoundation#> .
@prefix hdto:    <https://isl.ics.forth.gr/ontology/echoes/HDT/> .
@prefix crm:     <http://www.cidoc-crm.org/cidoc-crm/v7.1.1/> .
@prefix crmdig:  <http://www.ics.forth.gr/isl/CRMdig/> .
@prefix crmsci:  <http://www.ics.forth.gr/isl/CRMsci/> .
@prefix crminf:  <http://www.cidoc-crm.org/extensions/crminf/> .
@prefix prov:    <http://www.w3.org/ns/prov#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix dct:     <http://purl.org/dc/terms/> .
@prefix foaf:    <http://xmlns.com/foaf/0.1/> .
@prefix schema:  <https://schema.org/> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix vann:    <http://purl.org/vocab/vann/> .

@base <https://w3id.org/durair/alignment/mko-hdto> .

################################################################################
# 0. Bridge metadata
################################################################################

<#> a owl:Ontology ;
    dct:title           "MiKaDo ⇄ HDTO Alignment Bridge"@en ;
    dct:description     """Formal alignment between MiKaDo (mko:) and the Heritage Digital Twin Ontology v1.1 (HDTO, ECHOES D7.1). MiKaDo operates at the field-gesture level (Programme → Session → Act → ObservedFeature/DerivedFeature); HDTO operates at the propositional-aggregation level (Project → Study/Maintenance → HC16 Heritage Proposition Set → HC2 Heritage Digital Twin → HC1 Heritage Entity). The bridge enables ingestion of MiKaDo export bundles as Heritage Proposition Sets at HDTO/ECCCH-aligned institutional nodes."""@en ;
    dct:creator         <https://orcid.org/0000-0001-7600-2273> ,
                        <https://orcid.org/0000-0003-3724-4829> ,
                        <https://orcid.org/0009-0001-3313-0587> ;
    dct:publisher       [ a foaf:Organization ;
                          foaf:name "MAP — UPR 2002 CNRS" ;
                          foaf:homepage <https://www.map.cnrs.fr/> ] ;
    dct:rightsHolder    "CNRS" ;
    schema:funder       [ a schema:Organization ;
                          schema:name "European Research Council" ;
                          schema:alternateName "n-Dame_Heritage" ;
                          schema:identifier "101055423" ] ;
    dct:created         "2026-05-05"^^xsd:date ;
    owl:versionInfo     "0.1.0" ;
    owl:versionIRI      <https://w3id.org/durair/alignment/mko-hdto/0.1.0> ;
    vann:preferredNamespacePrefix "mko-hdto" ;
    rdfs:seeAlso        <https://w3id.org/durair/ontology/refoundation> ,
                        <https://isl.ics.forth.gr/ontology/echoes/html/HDT_v1.1.html> ;
    dct:license         <https://creativecommons.org/licenses/by/4.0/> .

<https://orcid.org/0000-0001-7600-2273> a foaf:Person ;
    foaf:name "Livio De Luca" ;
    foaf:mbox <mailto:livio.deluca@map.cnrs.fr> .

<https://orcid.org/0000-0003-3724-4829> a foaf:Person ;
    foaf:name "Anthony Pamart" .

<https://orcid.org/0009-0001-3313-0587> a foaf:Person ;
    foaf:name "Quentin Vogel" .

################################################################################
# 1. Class alignments
################################################################################

# --- Material referent ----------------------------------------------------
# A MiKaDo MaterialEntity reifies the documented referent (site, building,
# façade, object). When this referent is socially recognised as heritage,
# it is logically an HDTO Heritage Entity. We declare a soft alignment
# (skos:closeMatch) at the TBox level — institutional/social attribution
# is a property of the *instance*, not of the class — and rely on instance-
# level multi-typing in the export when applicable.

mko:MaterialEntity
    skos:closeMatch hdto:HC1 ;       # Heritage Entity (when applicable)
    skos:closeMatch hdto:HC3 .       # Tangible Heritage Entity (typical case)

# --- Activity scales ------------------------------------------------------

mko:ObservationProgram
    rdfs:subClassOf hdto:HC13 .      # Project (consortium-level)

# A field session, when its sole role within a MiKaDo project is to feed an
# HDT maintained at an institutional node, is an HC11 Digital Twin
# Maintenance event. We declare a closeMatch — sessions can also exist
# outside any HDT contribution — and let the export engine emit the
# equivalence at instance level when relevant.
mko:InSituObservationSession
    skos:closeMatch hdto:HC11 .      # Digital Twin Maintenance

# --- Bundle as proposition set --------------------------------------------
# Each MiKaDo export bundle (one GraphSnapshot, multi-typed prov:Bundle) is
# a self-contained named graph of formal propositions about a heritage
# entity — i.e. a Heritage Proposition Set in the HDTO sense. This is the
# load-bearing alignment of the bridge: it is what enables ECCCH-aligned
# nodes to ingest MiKaDo graphs natively.

mko:GraphSnapshot
    rdfs:subClassOf hdto:HC16 ,      # Heritage Proposition Set
                    hdto:HC15 .      # Persistent Digital Object (Parthenos)

# --- Observation pivot ----------------------------------------------------
# The MiKaDo ObservedFeature is already multi-typed crmsci:S4_Observation
# (a sub-class of S27 Observation) in the export. A MiKaDo ObservedFeature
# whose linked KnowledgeEntity carries an interpretive statement
# (description, classification, qualified measurement) instantiates the
# HDTO HC17 Observation with Inference pattern — primary observation
# paired with directly related interpretive statement. This composition
# is instance-level and is documented (rather than declared as a
# subsumption at TBox level) because not every MiKaDo ObservedFeature
# carries inference content.

mko:ObservedFeature
    skos:closeMatch crmsci:S4_Observation ;
    skos:closeMatch hdto:HC17 .      # Observation with Inference (when interpreted)

# --- Derived facts --------------------------------------------------------
# A MiKaDo DerivedFeature can stand for a deterministic algorithmic
# inference (e.g. ComparativeReport between two snapshots, statistical
# profile, narrative digest), which fits the CRMinf I5 Inference Making /
# HDTO inference pattern. Other DerivedFeatures (similarity buckets,
# raw geometric / visual descriptor snapshots) are not inferences in the
# CRMinf sense — they are morphological projections. The alignment is
# therefore declared as skos:closeMatch and used at instance level only.

mko:DerivedFeature
    skos:closeMatch crminf:I5 ,      # Inference Making (when applicable)
                    hdto:HC17 .      # Observation with Inference (when applicable)

# --- Provenance triptych --------------------------------------------------

mko:DerivationTrace
    skos:closeMatch crminf:I10 ,     # Provenance Statement
                    hdto:HC18 .      # Provenance Statement

mko:LineageRecord
    skos:closeMatch hdto:HC18 .      # Provenance Statement (lineage facet)

mko:QualityScore
    skos:closeMatch hdto:HC19 .      # Provenance Assessment

# --- Digital media --------------------------------------------------------

mko:DigitalEntity
    rdfs:subClassOf hdto:HC5 .       # Digital Representation (root)

# Sub-class alignments are emitted in the legacy `so:` schema. We restate
# the most common ones here for HDTO consumers.

<https://w3id.org/durair/ontology/situated-observation#PhotogrammetryReconstruction>
    rdfs:subClassOf hdto:HC8 .       # 3D Model

<https://w3id.org/durair/ontology/situated-observation#CaptureFrame>
    rdfs:subClassOf hdto:HC7 .       # Digital Audiovisual Object (oriented frame)

<https://w3id.org/durair/ontology/situated-observation#VoiceRecording>
    rdfs:subClassOf hdto:HC7 .       # Digital Audiovisual Object (audio)

################################################################################
# 2. Property alignments
################################################################################

# Production of a Heritage Proposition Set by a Maintenance activity.
# A MiKaDo ObservationProgram (HC13 Project) producing a MiKaDo
# GraphSnapshot (HC16 Heritage Proposition Set) via mko:produces is
# semantically equivalent to the HDTO maintenance pattern HP30
# added content (Maintenance → Proposition Set).

mko:produces
    skos:closeMatch hdto:HP30 .      # added content

# Composition of a session into its programme corresponds to the HDTO
# HC11 Digital Twin Maintenance being carried out under an HC13 Project.

mko:partOf
    skos:closeMatch hdto:HP20 .      # was carried out under

# Heritage entity ↔ programme composition.
# When a MiKaDo ObservationProgram documents a MaterialEntity that is
# also socially recognised as a Heritage Entity, the corresponding HDTO
# pattern is HC11 Digital Twin Maintenance HP18 has documented
# HC1 Heritage Entity.

# (No direct mko: equivalent — the pattern is reconstructed at the
# instance level by the export engine when an HDTO consumer subscribes
# to a quasi.modo node.)

# Provenance: every mko: predicate aligned to PROV-O is also reachable
# from CRMinf provenance constructs that HDTO inherits (HC18 provenance
# statement, HC19 provenance assessment).

mko:derivedFrom
    skos:closeMatch crminf:I10 .     # Provenance Statement (origin link)

################################################################################
# 3. Notes on instance-level emission
################################################################################
# At export time, a future HDTO export profile may
# emit additional types on each MiKaDo node when the HDTO context applies:
#
# - mko:MaterialEntity instances multi-typed `[..., hdto:HC1, hdto:HC3]`
#   when the project documents a recognised heritage entity (controlled
#   by a project-level boolean `isHeritageReferent`).
# - mko:GraphSnapshot instances multi-typed `[..., hdto:HC16, hdto:HC15]`
#   systematically (every export *is* a proposition set).
# - mko:ObservationProgram instances multi-typed `[..., hdto:HC13]`.
# - mko:InSituObservationSession instances multi-typed `[..., hdto:HC11]`
#   when a controlled flag `contributesToHDT` is set.
# - mko:DerivedFeature instances of `featureKind ∈ {comparison-report,
#   statistical-profile, narrative-digest}` multi-typed `[..., crminf:I5,
#   hdto:HC17]`.
#
# This emission profile is documented in `docs/mikado.md`
# (section "Alignment with HDTO") and will be implemented as an opt-in
# in a future Swift export step.
################################################################################
