# bia-extension.ttl — ส่วนขยาย BIA เหนือ RiC-O 1.1 (นิยามเนมสเปซ biax: และ bia-rst: ให้เป็นทางการ)
# term เหล่านี้ "ถูกใช้" ใน output/*.ttl แต่ไม่มีใน ontology ทางการของ ICA → นิยามไว้ที่นี่
# เพื่อให้ (ก) validator authoritative ตรวจได้ (ข) reasoner รู้ว่ามันสัมพันธ์กับ RiC-O อย่างไร
#
# เลียนแบบ pattern จาก RiC-O 1.1:
#   - subtype เหตุการณ์  → owl:Class ; rdfs:subClassOf rico:Event
#   - record set type ย่อย → owl:NamedIndividual, skos:Concept, rico:RecordSetType (เหมือน ric-rst:Series)

@prefix rico:    <https://www.ica.org/standards/RiC/ontology#> .
@prefix ric-rst: <https://www.ica.org/standards/RiC/vocabularies/recordSetTypes#> .
@prefix biax:    <https://id.bia.or.th/ns#> .
@prefix bia-rst: <https://id.bia.or.th/vocab/recordSetTypes#> .
@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 xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix dcterms: <http://purl.org/dc/terms/> .

<https://id.bia.or.th/ns> a owl:Ontology ;
    rdfs:label "BIA extension to RiC-O 1.1"@en ;
    rdfs:comment "ส่วนขยายหอจดหมายเหตุพุทธทาส: subtype เหตุการณ์ชีวิต + property provenance + record set type ย่อย"@th ;
    dcterms:publisher "Buddhadasa Indapanno Archives (BIA)"@en ,
        "หอจดหมายเหตุพุทธทาส อินทปัญโญ"@th ;
    dcterms:rightsHolder "Buddhadasa Indapanno Archives (BIA)"@en ;
    dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
    owl:versionInfo "1.0.0" ;
    dcterms:identifier "https://doi.org/10.5281/zenodo.22114132" ;
    rdfs:seeAlso <https://doi.org/10.5281/zenodo.22114132> ;
    owl:imports <https://www.ica.org/standards/RiC/ontology> .

# ── biax: subtype เหตุการณ์สำคัญในชีวิต (subclass ของ rico:Event) ──
biax:BirthEvent a owl:Class ; rdfs:subClassOf rico:Event ;
    rdfs:label "การเกิด"@th , "Birth event"@en ;
    rdfs:comment "เหตุการณ์กำเนิด"@th , "Birth of a person."@en .
biax:OrdinationEvent a owl:Class ; rdfs:subClassOf rico:Event ;
    rdfs:label "การบวช"@th , "Ordination event"@en ;
    rdfs:comment "การบรรพชา/อุปสมบท"@th , "Ordination as a novice or bhikkhu."@en .
biax:TitleConferralEvent a owl:Class ; rdfs:subClassOf rico:Event ;
    rdfs:label "การได้รับสมณศักดิ์"@th , "Title conferral event"@en ;
    rdfs:comment "การได้รับพระราชทานสมณศักดิ์/ตราตั้ง"@th , "Conferral of a royal monastic title (samanasak) or certificate of appointment. Each conferral changes the monk's formal appellation."@en .
biax:DeathEvent a owl:Class ; rdfs:subClassOf rico:Event ;
    rdfs:label "การมรณภาพ"@th , "Death event"@en ;
    rdfs:comment "เหตุการณ์มรณภาพ"@th , "Death of a person."@en .
biax:CremationEvent a owl:Class ; rdfs:subClassOf rico:Event ;
    rdfs:label "การพระราชทานเพลิงศพ"@th , "Cremation event"@en ;
    rdfs:comment "พิธีพระราชทานเพลิงศพ"@th , "Royally sponsored cremation ceremony."@en .

# ── biax: property provenance (ติดกับ fact ที่สกัด — เกาะ rico:Event/rico:Date) ──
biax:confidence a owl:DatatypeProperty ;
    rdfs:label "confidence"@en , "ค่าความมั่นใจ"@th ;
    rdfs:comment "ค่าความมั่นใจของ fact ที่สกัดอัตโนมัติ ช่วง 0–1"@th , "Confidence score of an automatically extracted fact, 0-1."@en ;
    rdfs:range xsd:decimal .
biax:needsReview a owl:DatatypeProperty ;
    rdfs:label "needs review"@en , "ต้องตรวจทาน"@th ;
    rdfs:comment "true = fact นี้ยังรอผู้เชี่ยวชาญตรวจ"@th , "true = this fact still awaits expert review."@en ;
    rdfs:range xsd:boolean .

# ── bia-rst: record set type ย่อยของ BIA (ขยาย controlled vocab ric-rst:) ──
bia-rst:SubSeries a owl:NamedIndividual , skos:Concept , rico:RecordSetType ;
    rdfs:label "ชุดย่อย"@th , "Sub-series"@en ;
    skos:broader ric-rst:Series ;
    rdfs:comment "ระดับชุดเอกสารย่อยใต้ Series"@th , "Aggregation level below Series."@en .
bia-rst:SubFile a owl:NamedIndividual , skos:Concept , rico:RecordSetType ;
    rdfs:label "แฟ้มย่อย"@th , "Sub-file"@en ;
    skos:broader ric-rst:File ;
    rdfs:comment "ระดับแฟ้มเอกสารย่อยใต้ File"@th , "Aggregation level below File."@en .

# ── biax: วัตถุจดหมายเหตุ (หมวด BIA-OB) — เพิ่ม 05/08/2569 ──────────────────────
# เหตุผลที่ต้องมีคลาสของตัวเอง: วัตถุ **ไม่ใช่** rico:RecordResource (ไม่ได้บันทึกข้อมูล)
# แต่เป็น rico:Thing → property ที่ domain = Thing (identifier / generalDescription / name)
# ใช้ได้ถูกต้อง · ส่วน rico:title ใช้ไม่ได้ (domain = Instantiation/RecordResource/Rule)
# จึงใช้ rdfs:label เป็นชื่อวัตถุ · ดู docs/archival-objects.md
biax:ArchivalObject a owl:Class ; rdfs:subClassOf rico:Thing ;
    rdfs:label "วัตถุจดหมายเหตุ"@th , "Archival object"@en ;
    rdfs:comment "สิ่งของทางกายภาพในคลัง BIA (หมวด BIA-OB) เช่น ของใช้ส่วนตัว เครื่องเขียน ของถวาย — ไม่ใช่เอกสาร/บันทึก จึงไม่จัดเป็น rico:RecordResource"@th , "Physical object in the BIA holdings (series BIA-OB): personal effects, writing tools, offerings. Not a record, hence not a rico:RecordResource."@en .

# ── หมวดวัตถุ (ระดับการจัดเรียงของหมวด BIA-OB) — เพิ่ม 25/08/2569 ────────────────
# เหตุที่ต้องมีคลาสของตัวเอง ไม่ใช้ rico:RecordSet:
#   RecordSet ⊑ RecordResource = "ทรัพยากรที่บรรจุ *บันทึก*" · หมวดของเราบรรจุ **วัตถุ**
#   ซึ่งไม่ใช่บันทึก (เหตุผลเดียวกับที่ biax:ArchivalObject ไม่ใช่ rico:Record)
# ⚠️ ตรวจแล้ว 25/08/2569: `rico:isOrWasIncludedIn` มี **domain = Record ∪ RecordSet**
#    จึงใช้กับวัตถุไม่ได้ — เส้นที่ถูกคือ `rico:isOrWasPartOf` (domain=Thing range=Thing)
#    ซึ่ง ICA ประกาศ owl:inverseOf กับ rico:hasOrHadPart ไว้แล้ว (reasoner ได้ทางกลับฟรี)
# ที่มา: กราฟเดิมเก็บหมวดเป็น **สตริง** biax:seriesName 1,022 ที่ ไม่มีโหนดหมวดเลย
#    → คำถาม "หมวดเครื่องเขียนมีอะไรบ้าง" เดินด้วยศัพท์มาตรฐานไม่ได้
#    (คง biax:seriesName/seriesCode ไว้ด้วย — sparql_templates.py ใช้อยู่)
biax:ArchivalObjectSet a owl:Class ; rdfs:subClassOf rico:Thing ;
    rdfs:label "หมวดวัตถุจดหมายเหตุ"@th , "Archival object set"@en ;
    rdfs:comment "กลุ่มการจัดเรียงของวัตถุในคลัง BIA (หมวด BIA-OB.1–7) — ไม่ใช่ rico:RecordSet เพราะสมาชิกเป็นวัตถุ ไม่ใช่บันทึก · สมาชิกผูกด้วย rico:isOrWasPartOf"@th , "Arrangement grouping of archival objects (series BIA-OB.1-7). Not a rico:RecordSet because its members are objects, not records; members attach via rico:isOrWasPartOf."@en .

# ความสัมพันธ์ของวัตถุ
biax:objectEvidenceOf a owl:ObjectProperty ;
    rdfs:label "วัตถุพยานของเหตุการณ์"@th , "is object evidence of"@en ;
    rdfs:comment "วัตถุชิ้นนี้เป็นพยานวัตถุของเหตุการณ์ — ใช้แทน rico:isOrWasSubjectOf ที่ range บังคับเป็น RecordResource"@th , "This object is physical evidence of the event. Used instead of rico:isOrWasSubjectOf, whose domain is restricted to RecordResource."@en ;
    rdfs:domain biax:ArchivalObject ; rdfs:range rico:Event .
biax:inscriptionMentions a owl:ObjectProperty ;
    rdfs:label "จารึกบนวัตถุกล่าวถึง"@th , "inscription mentions"@en ;
    rdfs:comment "ข้อความที่ปรากฏบนตัววัตถุ (จารึก/ตรา/ลายมือ) กล่าวถึงบุคคล สถานที่ องค์กร หรือชื่ออื่นของบุคคล"@th , "The text on the object (inscription, stamp, handwriting) mentions a person, place, organisation, or an alternate name of a person."@en ;
    rdfs:domain biax:ArchivalObject ; rdfs:range rico:Thing .
# ⛔ เลิกใช้ 05/08/2569 พร้อม image* ข้างล่าง — ติดธง owl:deprecated 25/08/2569
#    เหตุที่ติดธงแทนการลบ: ไฟล์ TTL เก่าที่ commit ไว้ยังอ้างอยู่ ถ้าลบจะไม่ผ่าน
#    rico_conformance (term ผี) · และไฟล์ ontology ที่เผยแพร่ให้นักวิชาการต้องบอก
#    ให้ชัดว่าศัพท์ตัวไหนไม่ใช้แล้ว ไม่ใช่ปล่อยให้เขาหาที่ใช้ไม่เจอ
biax:thumbnail a owl:ObjectProperty ;
    rdfs:label "ภาพย่อ"@th , "thumbnail"@en ;
    owl:deprecated true ;
    rdfs:comment "เลิกใช้ 05/08/2569 — ขอภาพสดจาก /api/artifact-images/{ref} ด้วยรหัสวัตถุใน rico:identifier แทน"@th , "Deprecated 2026-08-05 - fetch images live from the API using the object identifier instead."@en ;
    rdfs:domain biax:ArchivalObject .

# คุณสมบัติทางกายภาพ/ทะเบียนของวัตถุ (ทั้งหมด domain = biax:ArchivalObject)
biax:inscription a owl:DatatypeProperty ;
    rdfs:label "ข้อความบนวัตถุ"@th , "inscription"@en ;
    rdfs:comment "ข้อความจารึก/เขียน/ประทับบนตัววัตถุ คัดคำต่อคำ — เป็นหลักฐานของทุกลิงก์ที่ผูกจากวัตถุ"@th , "Verbatim transcription of text inscribed, written or stamped on the object - the evidence behind every link asserted from the object."@en ;
    rdfs:domain biax:ArchivalObject ; rdfs:range xsd:string .
biax:registryTitle a owl:DatatypeProperty ;
    rdfs:label "ชื่อตามทะเบียน"@th , "registry title"@en ;
    rdfs:comment "ชื่อดั้งเดิมในทะเบียนวัตถุ (มักซ้ำกันหลายชิ้น เช่น 'แฟ้มใส่เอกสาร') เก็บไว้เทียบกับชื่อที่ขยายให้อ่านรู้เรื่อง"@th , "Original title from the object registry (often shared by many items); kept alongside the expanded human-readable title."@en ;
    rdfs:domain biax:ArchivalObject ; rdfs:range xsd:string .
biax:seriesCode a owl:DatatypeProperty ;
    rdfs:label "รหัสหมวดย่อย"@th , "series code"@en ; rdfs:domain biax:ArchivalObject ; rdfs:range xsd:string .
biax:seriesName a owl:DatatypeProperty ;
    rdfs:label "ชื่อหมวดย่อย"@th , "series name"@en ; rdfs:domain biax:ArchivalObject ; rdfs:range xsd:string .
biax:materials a owl:DatatypeProperty ;
    rdfs:label "วัสดุและเทคนิค"@th , "materials and technique"@en ; rdfs:domain biax:ArchivalObject ; rdfs:range xsd:string .
biax:dimensions a owl:DatatypeProperty ;
    rdfs:label "ขนาด"@th , "dimensions"@en ; rdfs:domain biax:ArchivalObject ; rdfs:range xsd:string .
biax:color a owl:DatatypeProperty ;
    rdfs:label "สี"@th , "colour"@en ; rdfs:domain biax:ArchivalObject ; rdfs:range xsd:string .
biax:sourceObject a owl:DatatypeProperty ;
    rdfs:label "แหล่งที่มาของวัตถุ"@th , "source of object"@en ;
    rdfs:comment "สถานที่ที่วัตถุถูกเก็บมาก่อนเข้าคลัง (เช่น 'สวนโมกข์ไชยา')"@th , "Place the object was kept before entering the archive (e.g. Suan Mokkh, Chaiya)."@en ;
    rdfs:domain biax:ArchivalObject ; rdfs:range xsd:string .
biax:receivedYearBE a owl:DatatypeProperty ;
    rdfs:label "ปีที่รับเข้าคลัง (พ.ศ.)"@th , "year received (BE)"@en ;
    rdfs:comment "⚠️ เป็นปีที่หอจดหมายเหตุรับมอบ **ไม่ใช่ปีของวัตถุ** (ทะเบียนไม่ระบุปีของวัตถุ 99.7%)"@th , "Year (Buddhist Era) the archive RECEIVED the object - not the year of the object itself, which the registry omits for 99.7 percent of items."@en ;
    rdfs:domain biax:ArchivalObject ; rdfs:range xsd:gYear .
biax:relatedDocumentLegacyRef a owl:DatatypeProperty ;
    rdfs:label "รหัสเอกสารเกี่ยวเนื่อง (รหัสเดิม)"@th , "related document (legacy ref)"@en ;
    rdfs:comment "รหัสเดิมของเอกสารลายลักษณ์ที่ทะเบียนวัตถุอ้างถึง — ยังไม่ resolve เป็นโหนดในกราฟ"@th , "Legacy reference code of a related manuscript cited by the object registry - not yet resolved to a graph node."@en ;
    rdfs:domain biax:ArchivalObject ; rdfs:range xsd:string .
biax:linkConfidence a owl:DatatypeProperty ;
    rdfs:label "ความมั่นใจของการผูก"@th , "link confidence"@en ;
    rdfs:comment "confirmed = ข้อความบนวัตถุระบุตรงตัว · plausible = สอดคล้องหลักฐานอื่นแต่ยังไม่ยืนยัน"@th , "confirmed = named explicitly by the text on the object; plausible = consistent with other evidence but unverified."@en ;
    rdfs:domain biax:ArchivalObject ; rdfs:range xsd:string .
# ⛔ property รูป ๓ ตัวนี้ **เลิกใช้ 05/08/2569** — builder ไม่เขียนลงกราฟอีก
#    (URL ของคลังมี ?t=… เปลี่ยนเมื่ออัปโหลดใหม่ → เก็บไว้ = ลิงก์เน่าเงียบ)
#    หน้าเว็บขอภาพสดจาก /api/artifact-images/{ref} ด้วยรหัสวัตถุใน rico:identifier
#    ประกาศคงไว้เพื่อให้ไฟล์เก่าที่ยังอ้างอยู่ผ่าน rico_conformance
biax:imageThumb a owl:ObjectProperty ;
    owl:deprecated true ;
    rdfs:label "ภาพย่อ (thumbnail ~6 KB)"@th , "thumbnail image"@en ;
    rdfs:comment "เลิกใช้ 05/08/2569 — ขอภาพสดจาก API ด้วยรหัสวัตถุแทน"@th , "Deprecated 2026-08-05 - fetch images live from the API instead."@en ;
    rdfs:domain biax:ArchivalObject .
biax:imageFull a owl:ObjectProperty ;
    owl:deprecated true ;
    rdfs:comment "เลิกใช้ 05/08/2569 — ขอภาพสดจาก API ด้วยรหัสวัตถุแทน"@th , "Deprecated 2026-08-05 - fetch images live from the API instead."@en ;
    rdfs:label "ภาพขนาดดู (preview)"@th , "preview image"@en ;
    rdfs:domain biax:ArchivalObject .
biax:imageCount a owl:DatatypeProperty ;
    owl:deprecated true ;
    rdfs:comment "เลิกใช้ 05/08/2569 — จำนวนภาพขอสดจาก API แทน"@th , "Deprecated 2026-08-05 - image count is served live by the API instead."@en ;
    rdfs:label "จำนวนภาพในคลัง"@th , "image count"@en ;
    rdfs:domain biax:ArchivalObject ; rdfs:range xsd:integer .
