glam/data/entity_annotation/modules/integrations/pico/schema/relationships.yaml
kempersc 505c12601a Add test script for PiCo extraction from Arabic waqf documents
- Implemented a new script `test_pico_arabic_waqf.py` to test the GLM annotator's ability to extract person observations from Arabic historical documents.
- The script includes environment variable handling for API token, structured prompts for the GLM API, and validation of extraction results.
- Added comprehensive logging for API responses, extraction results, and validation errors.
- Included a sample Arabic waqf text for testing purposes, following the PiCo ontology pattern.
2025-12-12 17:50:17 +01:00

517 lines
17 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# =============================================================================
# PiCo Integration Module: Family and Social Relationships
# =============================================================================
# Part of: data/entity_annotation/modules/integrations/pico/
# Parent: _index.yaml
#
# Description: Family relationship properties for genealogical data.
# Enables modeling complex family structures from historical records.
#
# Last Updated: 2025-01-13
# =============================================================================
family_relationships:
description: |
Family relationship properties link persons within and across sources.
Rules:
- For PersonObservations: relationships refer to OTHER observations on SAME source
- For PersonReconstructions: relationships refer to other reconstructions
Property characteristics:
- Symmetric: If A hasRelation B, then B hasRelation A (spouses, siblings, cousins)
- Transitive: hasAncestor/hasDescendant chain through generations
- Inverse pairs: parent/children, grandparent/grandchild, etc.
# ---------------------------------------------------------------------------
# Core Family (Schema.org)
# ---------------------------------------------------------------------------
core_relationships:
- property: "sdo:parent"
property_uri: "https://schema.org/parent"
description: "A parent of the person"
inverse: "sdo:children"
subPropertyOf: ["sdo:relatedTo", "pico:hasAncestor"]
note: "Biological or legal parent"
- property: "sdo:children"
property_uri: "https://schema.org/children"
description: "A child of the person"
inverse: "sdo:parent"
subPropertyOf: ["sdo:relatedTo", "pico:hasDescendant"]
- property: "sdo:spouse"
property_uri: "https://schema.org/spouse"
description: "The person's spouse"
symmetric: true
subPropertyOf: "sdo:relatedTo"
- property: "sdo:sibling"
property_uri: "https://schema.org/sibling"
description: "A brother or sister"
symmetric: true
subPropertyOf: "sdo:relatedTo"
# ---------------------------------------------------------------------------
# Transitive Ancestry (PiCo)
# ---------------------------------------------------------------------------
ancestry_relationships:
- property: "pico:hasAncestor"
property_uri: "https://personsincontext.org/model#hasAncestor"
description: "Any ancestor (parent, grandparent, etc.)"
type: "owl:TransitiveProperty"
inverse: "pico:hasDescendant"
note: "Not used directly; parent→parent chains automatically create ancestors"
- property: "pico:hasDescendant"
property_uri: "https://personsincontext.org/model#hasDescendant"
description: "Any descendant (child, grandchild, etc.)"
type: "owl:TransitiveProperty"
inverse: "pico:hasAncestor"
# ---------------------------------------------------------------------------
# Grandparents/Grandchildren
# ---------------------------------------------------------------------------
grandparent_relationships:
- property: "pico:hasGrandparent"
property_uri: "https://personsincontext.org/model#hasGrandparent"
inverse: "pico:hasGrandchild"
- property: "pico:hasGrandchild"
property_uri: "https://personsincontext.org/model#hasGrandchild"
inverse: "pico:hasGrandparent"
- property: "pico:hasGreat-grandparent"
property_uri: "https://personsincontext.org/model#hasGreat-grandparent"
inverse: "pico:hasGreat-grandchild"
- property: "pico:hasGreat-grandchild"
property_uri: "https://personsincontext.org/model#hasGreat-grandchild"
inverse: "pico:hasGreat-grandparent"
# ---------------------------------------------------------------------------
# Aunts/Uncles and Nieces/Nephews
# ---------------------------------------------------------------------------
extended_family:
- property: "pico:hasUncle_Aunt"
property_uri: "https://personsincontext.org/model#hasUncle_Aunt"
description: "An uncle or aunt (sibling of parent)"
inverse: "pico:hasNephew_Niece"
- property: "pico:hasNephew_Niece"
property_uri: "https://personsincontext.org/model#hasNephew_Niece"
description: "A nephew or niece (child of sibling)"
inverse: "pico:hasUncle_Aunt"
- property: "pico:hasCousin"
property_uri: "https://personsincontext.org/model#hasCousin"
description: "A cousin (child of parent's sibling)"
symmetric: true
# ---------------------------------------------------------------------------
# Step-family
# ---------------------------------------------------------------------------
step_relationships:
- property: "pico:hasStepparent"
property_uri: "https://personsincontext.org/model#hasStepparent"
description: "A stepparent (spouse of biological parent)"
inverse: "pico:hasStepchild"
- property: "pico:hasStepchild"
property_uri: "https://personsincontext.org/model#hasStepchild"
inverse: "pico:hasStepparent"
- property: "pico:hasStepsibling"
property_uri: "https://personsincontext.org/model#hasStepsibling"
description: "A stepbrother or stepsister"
symmetric: true
- property: "pico:hasHalf-sibling"
property_uri: "https://personsincontext.org/model#hasHalf-sibling"
description: "A half-brother or half-sister (one shared parent)"
symmetric: true
# ---------------------------------------------------------------------------
# Foster/Godparent
# ---------------------------------------------------------------------------
non_biological_relationships:
- property: "pico:hasFosterParent"
property_uri: "https://personsincontext.org/model#hasFosterParent"
inverse: "pico:hasFosterChild"
- property: "pico:hasFosterChild"
property_uri: "https://personsincontext.org/model#hasFosterChild"
inverse: "pico:hasFosterParent"
- property: "pico:hasGodparent"
property_uri: "https://personsincontext.org/model#hasGodparent"
description: "A godparent (witness at baptism)"
inverse: "pico:hasGodchild"
- property: "pico:hasGodchild"
property_uri: "https://personsincontext.org/model#hasGodchild"
inverse: "pico:hasGodparent"
- property: "pico:hasLegitimizedChild"
property_uri: "https://personsincontext.org/model#hasLegitimizedChild"
description: "A child legitimized by marriage or legal recognition"
inverse: "pico:isLegitimitezedChildOf"
- property: "pico:isLegitimitezedChildOf"
property_uri: "https://personsincontext.org/model#isLegitimitezedChildOf"
inverse: "pico:hasLegitimizedChild"
# ---------------------------------------------------------------------------
# In-Laws
# ---------------------------------------------------------------------------
in_law_relationships:
- property: "pico:hasParent-in-law"
property_uri: "https://personsincontext.org/model#hasParent-in-law"
inverse: "pico:hasChild-in-law"
- property: "pico:hasChild-in-law"
property_uri: "https://personsincontext.org/model#hasChild-in-law"
inverse: "pico:hasParent-in-law"
- property: "pico:hasSibling-in-law"
property_uri: "https://personsincontext.org/model#hasSibling-in-law"
description: "Brother/sister-in-law"
symmetric: true
- property: "pico:hasGrandparent-in-law"
property_uri: "https://personsincontext.org/model#hasGrandparent-in-law"
inverse: "pico:hasGrandchild-in-law"
- property: "pico:hasGrandchild-in-law"
property_uri: "https://personsincontext.org/model#hasGrandchild-in-law"
inverse: "pico:hasGrandparent-in-law"
- property: "pico:hasUncle_Aunt-in-law"
property_uri: "https://personsincontext.org/model#hasUncle_Aunt-in-law"
inverse: "pico:hasNephew_Niece-in-law"
- property: "pico:hasNephew_Niece-in-law"
property_uri: "https://personsincontext.org/model#hasNephew_Niece-in-law"
inverse: "pico:hasUncle_Aunt-in-law"
- property: "pico:hasCousin-in-law"
property_uri: "https://personsincontext.org/model#hasCousin-in-law"
symmetric: true
- property: "pico:hasStepparent-in-law"
property_uri: "https://personsincontext.org/model#hasStepparent-in-law"
inverse: "pico:hasStepchild-in-law"
- property: "pico:hasStepchild-in-law"
property_uri: "https://personsincontext.org/model#hasStepchild-in-law"
inverse: "pico:hasStepparent-in-law"
# ---------------------------------------------------------------------------
# Former Partners
# ---------------------------------------------------------------------------
former_partner_relationships:
- property: "pico:isWidOf"
property_uri: "https://personsincontext.org/model#isWidOf"
description: "Is widow/widower of deceased spouse"
note: "The subject is the surviving partner"
- property: "pico:hasPreviousPartner"
property_uri: "https://personsincontext.org/model#hasPreviousPartner"
description: "A former spouse or partner"
symmetric: true
# -----------------------------------------------------------------------------
# Historical Relationship Indicators by Language
# -----------------------------------------------------------------------------
historical_relationship_patterns:
description: |
Common relationship indicators in historical documents by language.
Use these patterns to identify family relationships in source texts.
dutch:
description: "Dutch relationship indicators"
patterns:
- pattern: "huijsvrou van"
meaning: "wife of"
relationship: "spouse"
- pattern: "zoon van"
meaning: "son of"
relationship: "parent"
- pattern: "dochter van"
meaning: "daughter of"
relationship: "parent"
- pattern: "weduwe van"
meaning: "widow of"
relationship: "widow_of"
- pattern: "weduwnaar van"
meaning: "widower of"
relationship: "widow_of"
- pattern: "peter"
meaning: "godfather"
relationship: "godparent"
- pattern: "meter"
meaning: "godmother"
relationship: "godparent"
- pattern: "getuige"
meaning: "witness"
relationship: "witness"
- pattern: "broeder van"
meaning: "brother of"
relationship: "sibling"
- pattern: "zuster van"
meaning: "sister of"
relationship: "sibling"
latin:
description: "Latin relationship indicators (common in church records)"
patterns:
- pattern: "filius"
meaning: "son"
relationship: "parent"
- pattern: "filia"
meaning: "daughter"
relationship: "parent"
- pattern: "uxor"
meaning: "wife"
relationship: "spouse"
- pattern: "maritus"
meaning: "husband"
relationship: "spouse"
- pattern: "vidua"
meaning: "widow"
relationship: "widow_of"
- pattern: "viduus"
meaning: "widower"
relationship: "widow_of"
- pattern: "quondam"
meaning: "the late"
relationship: "deceased_marker"
- pattern: "patrinus"
meaning: "godfather"
relationship: "godparent"
- pattern: "matrina"
meaning: "godmother"
relationship: "godparent"
- pattern: "testis"
meaning: "witness"
relationship: "witness"
german:
description: "German relationship indicators"
patterns:
- pattern: "Ehefrau von"
meaning: "wife of"
relationship: "spouse"
- pattern: "Ehemann von"
meaning: "husband of"
relationship: "spouse"
- pattern: "Sohn von"
meaning: "son of"
relationship: "parent"
- pattern: "Tochter von"
meaning: "daughter of"
relationship: "parent"
- pattern: "Witwe von"
meaning: "widow of"
relationship: "widow_of"
- pattern: "Witwer von"
meaning: "widower of"
relationship: "widow_of"
- pattern: "Taufpate"
meaning: "godfather"
relationship: "godparent"
- pattern: "Taufpatin"
meaning: "godmother"
relationship: "godparent"
french:
description: "French relationship indicators"
patterns:
- pattern: "fils de"
meaning: "son of"
relationship: "parent"
- pattern: "fille de"
meaning: "daughter of"
relationship: "parent"
- pattern: "épouse de"
meaning: "wife of"
relationship: "spouse"
- pattern: "époux de"
meaning: "husband of"
relationship: "spouse"
- pattern: "veuve de"
meaning: "widow of"
relationship: "widow_of"
- pattern: "veuf de"
meaning: "widower of"
relationship: "widow_of"
- pattern: "feu"
meaning: "the late (m)"
relationship: "deceased_marker"
- pattern: "feue"
meaning: "the late (f)"
relationship: "deceased_marker"
- pattern: "parrain"
meaning: "godfather"
relationship: "godparent"
- pattern: "marraine"
meaning: "godmother"
relationship: "godparent"
arabic:
description: "Arabic relationship indicators"
patterns:
- pattern: "ابن"
transliteration: "ibn"
meaning: "son of"
relationship: "parent"
- pattern: "بن"
transliteration: "bin"
meaning: "son of (shorter form)"
relationship: "parent"
- pattern: "بنت"
transliteration: "bint"
meaning: "daughter of"
relationship: "parent"
- pattern: "زوج"
transliteration: "zawj"
meaning: "husband"
relationship: "spouse"
- pattern: "زوجة"
transliteration: "zawja"
meaning: "wife"
relationship: "spouse"
- pattern: "أرملة"
transliteration: "armala"
meaning: "widow"
relationship: "widow_of"
- pattern: "المرحوم"
transliteration: "al-marhum"
meaning: "the late (m)"
relationship: "deceased_marker"
- pattern: "المرحومة"
transliteration: "al-marhuma"
meaning: "the late (f)"
relationship: "deceased_marker"
- pattern: "آل"
transliteration: "Al"
meaning: "family of"
relationship: "family_marker"
hebrew:
description: "Hebrew relationship indicators"
patterns:
- pattern: "בן"
transliteration: "ben"
meaning: "son of"
relationship: "parent"
- pattern: "בת"
transliteration: "bat"
meaning: "daughter of"
relationship: "parent"
- pattern: "אשת"
transliteration: "eshet"
meaning: "wife of"
relationship: "spouse"
- pattern: "אלמנה"
transliteration: "almana"
meaning: "widow"
relationship: "widow_of"
- pattern: "ז״ל"
transliteration: "z\"l"
meaning: "of blessed memory"
relationship: "deceased_marker"
- pattern: "ע״ה"
transliteration: "a\"h"
meaning: "peace be upon him/her"
relationship: "deceased_marker"
spanish:
description: "Spanish relationship indicators"
patterns:
- pattern: "hijo de"
meaning: "son of"
relationship: "parent"
- pattern: "hija de"
meaning: "daughter of"
relationship: "parent"
- pattern: "esposa de"
meaning: "wife of"
relationship: "spouse"
- pattern: "esposo de"
meaning: "husband of"
relationship: "spouse"
- pattern: "viuda de"
meaning: "widow of"
relationship: "widow_of"
- pattern: "viudo de"
meaning: "widower of"
relationship: "widow_of"
- pattern: "padrino"
meaning: "godfather"
relationship: "godparent"
- pattern: "madrina"
meaning: "godmother"
relationship: "godparent"
- pattern: "hijo legítimo"
meaning: "legitimate son"
relationship: "legitimacy_marker"
- pattern: "hijo natural"
meaning: "illegitimate son"
relationship: "legitimacy_marker"
portuguese:
description: "Portuguese relationship indicators"
patterns:
- pattern: "filho de"
meaning: "son of"
relationship: "parent"
- pattern: "filha de"
meaning: "daughter of"
relationship: "parent"
- pattern: "esposa de"
meaning: "wife of"
relationship: "spouse"
- pattern: "esposo de"
meaning: "husband of"
relationship: "spouse"
- pattern: "viúva de"
meaning: "widow of"
relationship: "widow_of"
- pattern: "viúvo de"
meaning: "widower of"
relationship: "widow_of"
- pattern: "padrinho"
meaning: "godfather"
relationship: "godparent"
- pattern: "madrinha"
meaning: "godmother"
relationship: "godparent"
ottoman_turkish:
description: "Ottoman Turkish relationship indicators"
patterns:
- pattern: "oğlu"
meaning: "son of"
relationship: "parent"
- pattern: "kızı"
meaning: "daughter of"
relationship: "parent"
- pattern: "zevcesi"
meaning: "wife"
relationship: "spouse"
- pattern: "merhum"
meaning: "the late (m)"
relationship: "deceased_marker"
- pattern: "merhume"
meaning: "the late (f)"
relationship: "deceased_marker"