#!/usr/bin/env python3 """ Update LinkML slot files with proper RiC-O style naming and comprehensive ontology mappings. This script updates slot files to comply with: - Rule 39: Slot Naming Convention (RiC-O Style) - Rule 38: Slot Centralization and Semantic URI Requirements - Rule 42: No Ontology Prefixes in Slot Names - Rule 43: Slot Nouns Must Be Singular Usage: python scripts/update_slot_mappings.py --dry-run # Preview changes python scripts/update_slot_mappings.py # Apply changes """ import os import re import yaml from pathlib import Path from typing import Dict, List, Optional, Tuple from dataclasses import dataclass, field # Slot definitions with proper naming and mappings # Format: old_name -> (new_name, slot_uri, exact_mappings, close_mappings, related_mappings, narrow_mappings, broad_mappings, description) @dataclass class SlotDefinition: """Definition for a slot with all mapping types.""" new_name: str slot_uri: str description: str range_type: str = "string" multivalued: bool = False exact_mappings: List[str] = field(default_factory=list) close_mappings: List[str] = field(default_factory=list) related_mappings: List[str] = field(default_factory=list) narrow_mappings: List[str] = field(default_factory=list) broad_mappings: List[str] = field(default_factory=list) custodian_types: str = '["*"]' custodian_types_rationale: str = "Applicable to all heritage custodian types." custodian_types_primary: str = "M" specificity_score: float = 0.50 specificity_rationale: str = "Moderately specific slot." # Comprehensive slot definitions SLOT_DEFINITIONS: Dict[str, SlotDefinition] = { # ===== A ===== "abbreviation": SlotDefinition( new_name="has_or_had_abbreviation", slot_uri="gleif-base:hasAbbreviation", description="""Short form or acronym of an organization's name. Uses RiC-O style temporal naming because abbreviations can change over time (e.g., rebranding). The slot_uri gleif-base:hasAbbreviation from GLEIF Base ontology indicates an abbreviated form of a legal entity's name.""", multivalued=True, exact_mappings=["gleif-base:hasAbbreviation"], close_mappings=["skos:altLabel", "schema:alternateName"], related_mappings=["dbp:abbreviation", "gn:alternateName"], broad_mappings=["rdfs:label"], ), "about_digital_presence": SlotDefinition( new_name="is_or_was_about_digital_presence", slot_uri="rico:isOrWasSubjectOf", description="""Indicates that this entity is the subject of a digital presence record. Uses RiC-O isOrWasSubjectOf to express that the custodian is what the digital presence describes.""", exact_mappings=["rico:isOrWasSubjectOf"], close_mappings=["dcterms:subject", "schema:about"], related_mappings=["foaf:isPrimaryTopicOf"], ), "about_text": SlotDefinition( new_name="has_or_had_about_text", slot_uri="dcterms:abstract", description="""Descriptive 'about' text for an institution, typically from their website. Uses dcterms:abstract as the primary predicate for summary/descriptive content.""", exact_mappings=["dcterms:abstract"], close_mappings=["dcterms:description", "schema:description", "schema:abstract"], related_mappings=["tooi:onderwerp", "skos:note"], broad_mappings=["rdfs:comment"], ), "academic_affiliation": SlotDefinition( new_name="has_or_had_academic_affiliation", slot_uri="schema:affiliation", description="""Academic institution(s) with which a person or organization is affiliated. Uses schema:affiliation as the primary predicate for organizational relationships.""", multivalued=True, exact_mappings=["schema:affiliation"], close_mappings=["org:memberOf", "rico:isOrWasMemberOf", "pico:hasAffiliation"], related_mappings=["foaf:member", "schema:alumniOf"], broad_mappings=["schema:organization"], ), "academic_programs": SlotDefinition( new_name="has_or_had_academic_program", slot_uri="schema:hasCourse", description="""Academic programs offered by a heritage institution, such as museum studies, archival science, conservation, or library science programs.""", multivalued=True, exact_mappings=["schema:hasCourse"], close_mappings=["schema:educationalProgram"], related_mappings=["dbp:programCost", "schema:courseCode"], broad_mappings=["schema:hasPart"], custodian_types='["E", "R", "M", "L", "A"]', custodian_types_primary="E", specificity_score=0.65, ), "accepts_external_work": SlotDefinition( new_name="accepts_or_accepted_external_work", slot_uri="hc:acceptsOrAcceptedExternalWork", description="""Indicates whether a conservation lab accepts external work from other institutions or private clients. Temporal naming reflects that policies can change.""", range_type="boolean", close_mappings=["gr:eligibleCustomerTypes", "schema:areaServed"], related_mappings=["schema:serviceType", "schema:availableChannel"], custodian_types='["M", "A", "L", "R"]', specificity_score=0.80, ), "accepts_payment_methods": SlotDefinition( new_name="accepts_or_accepted_payment_method", slot_uri="schema:paymentAccepted", description="""Payment methods accepted by the institution for fees, purchases, or donations. From Schema.org: 'Cash, Credit Card, Cryptocurrency, etc.'""", multivalued=True, exact_mappings=["schema:paymentAccepted"], close_mappings=["schema:acceptedPaymentMethod", "gr:acceptedPaymentMethods"], specificity_score=0.40, ), "accepts_visiting_scholars": SlotDefinition( new_name="accepts_or_accepted_visiting_scholar", slot_uri="hc:acceptsOrAcceptedVisitingScholar", description="""Indicates whether the institution accepts visiting scholars or researchers. Temporal naming reflects that policies can change over time.""", range_type="boolean", close_mappings=["schema:amenityFeature"], related_mappings=["schema:hasOfferCatalog"], custodian_types='["R", "A", "L", "M", "E"]', custodian_types_primary="R", specificity_score=0.70, ), "access": SlotDefinition( new_name="has_or_had_access_condition", slot_uri="dcterms:accessRights", description="""General access conditions or restrictions for a resource or institution. Uses dcterms:accessRights from Dublin Core Terms.""", exact_mappings=["dcterms:accessRights"], close_mappings=["rico:hasOrHadAllMembersWithContentType", "schema:conditionsOfAccess"], related_mappings=["premis:hasRightsStatement"], broad_mappings=["dcterms:rights"], ), "access_application_url": SlotDefinition( new_name="has_access_application_url", slot_uri="schema:url", description="""URL where users can apply for access to restricted materials or services. Permanent fact (URL location), not temporal.""", range_type="uri", exact_mappings=["schema:url"], close_mappings=["schema:potentialAction"], related_mappings=["dcterms:accessRights"], narrow_mappings=["schema:applicationContact"], ), "access_control": SlotDefinition( new_name="has_or_had_access_control", slot_uri="premis:hasRightsStatement", description="""Access control mechanisms or policies in place for resources. Uses PREMIS for preservation/access rights context.""", exact_mappings=["premis:hasRightsStatement"], close_mappings=["dcterms:accessRights", "rico:hasOrHadAllMembersWithContentType"], related_mappings=["schema:conditionsOfAccess"], ), "access_description": SlotDefinition( new_name="has_or_had_access_description", slot_uri="rico:scopeAndContent", description="""Textual description of access conditions, requirements, or procedures.""", exact_mappings=["rico:scopeAndContent"], close_mappings=["dcterms:description", "schema:description"], narrow_mappings=["dcterms:accessRights"], ), "access_frequency": SlotDefinition( new_name="has_or_had_access_frequency", slot_uri="dcat:accessFrequency", description="""Frequency with which a resource is accessed or updated. From DCAT vocabulary for dataset descriptions.""", close_mappings=["dcterms:accrualPeriodicity"], related_mappings=["schema:temporalCoverage"], ), "access_interface_url": SlotDefinition( new_name="has_access_interface_url", slot_uri="dcat:accessURL", description="""URL providing access to a resource or interface. From DCAT: 'A URL of the resource that gives access to a distribution.'""", range_type="uri", exact_mappings=["dcat:accessURL"], close_mappings=["schema:url", "dcat:downloadURL"], related_mappings=["schema:WebAPI"], ), "access_level": SlotDefinition( new_name="has_or_had_access_level", slot_uri="dcterms:accessRights", description="""Level of access granted (e.g., public, restricted, confidential). Temporal as access levels can change.""", exact_mappings=["dcterms:accessRights"], close_mappings=["schema:conditionsOfAccess"], related_mappings=["premis:hasRightsStatement"], ), "access_management": SlotDefinition( new_name="has_or_had_access_management", slot_uri="rico:hasOrHadManager", description="""Entity or system responsible for managing access to resources.""", close_mappings=["rico:hasOrHadManager", "prov:wasAttributedTo"], related_mappings=["dcterms:rightsHolder"], ), "access_policy": SlotDefinition( new_name="has_or_had_access_policy", slot_uri="dcterms:accessRights", description="""Formal policy governing access to collections or services.""", exact_mappings=["dcterms:accessRights"], close_mappings=["schema:publishingPrinciples", "rico:hasOrHadRegulation"], related_mappings=["premis:hasRightsStatement"], ), "access_policy_ref": SlotDefinition( new_name="has_access_policy_reference", slot_uri="dcterms:references", description="""Reference (URL or citation) to an access policy document.""", range_type="uri", exact_mappings=["dcterms:references"], close_mappings=["schema:citation", "dcterms:source"], ), "access_restricted": SlotDefinition( new_name="is_or_was_access_restricted", slot_uri="rico:hasOrHadAllMembersWithContentType", description="""Boolean indicating whether access is restricted. Temporal as restrictions can be lifted or imposed over time.""", range_type="boolean", close_mappings=["dcterms:accessRights"], related_mappings=["schema:conditionsOfAccess"], ), "access_restriction": SlotDefinition( new_name="has_or_had_access_restriction", slot_uri="rico:hasOrHadAllMembersWithContentType", description="""Specific access restriction applied to resources.""", exact_mappings=["rico:hasOrHadAllMembersWithContentType"], close_mappings=["dcterms:accessRights", "premis:hasRightsStatement"], ), "access_restrictions": SlotDefinition( new_name="has_or_had_access_restriction", slot_uri="rico:hasOrHadAllMembersWithContentType", description="""Access restrictions applied to resources (singular per Rule 43).""", multivalued=True, exact_mappings=["rico:hasOrHadAllMembersWithContentType"], close_mappings=["dcterms:accessRights", "premis:hasRightsStatement"], ), "access_rights": SlotDefinition( new_name="has_or_had_access_right", slot_uri="dcterms:accessRights", description="""Rights statement regarding access to the resource. From Dublin Core Terms: 'Information about who access the resource or an indication of its security status.'""", exact_mappings=["dcterms:accessRights"], close_mappings=["schema:conditionsOfAccess", "rico:hasOrHadAllMembersWithContentType"], related_mappings=["premis:hasRightsStatement", "edm:rights"], broad_mappings=["dcterms:rights"], ), "access_trigger_events": SlotDefinition( new_name="has_or_had_access_trigger_event", slot_uri="rico:isTriggeredByEvent", description="""Events that trigger changes in access status (e.g., embargo expiry).""", multivalued=True, exact_mappings=["rico:isTriggeredByEvent"], close_mappings=["prov:wasGeneratedBy"], related_mappings=["schema:potentialAction"], ), "accessibility_features": SlotDefinition( new_name="has_or_had_accessibility_feature", slot_uri="schema:accessibilityFeature", description="""Accessibility features provided by the institution or resource. From Schema.org accessibility vocabulary.""", multivalued=True, exact_mappings=["schema:accessibilityFeature"], close_mappings=["schema:accessMode", "schema:accessModeSufficient"], related_mappings=["schema:accessibilityHazard", "schema:accessibilitySummary"], ), "accession_date": SlotDefinition( new_name="has_accession_date", slot_uri="rico:hasAccessionDate", description="""Date when materials were formally accessioned into a collection. Permanent fact - the accession date doesn't change.""", range_type="date", exact_mappings=["rico:hasAccessionDate"], close_mappings=["dcterms:date", "schema:dateCreated"], related_mappings=["prov:generatedAtTime"], narrow_mappings=["dcterms:dateAccepted"], ), "accession_number": SlotDefinition( new_name="has_accession_number", slot_uri="rico:identifier", description="""Unique identifier assigned when materials are accessioned. Permanent identifier - doesn't change once assigned.""", exact_mappings=["rico:identifier"], close_mappings=["dcterms:identifier", "schema:identifier"], narrow_mappings=["rico:hasAccessionNumber"], ), "account_id": SlotDefinition( new_name="has_account_identifier", slot_uri="schema:identifier", description="""Identifier for an account (e.g., social media, platform account).""", exact_mappings=["schema:identifier"], close_mappings=["dcterms:identifier"], related_mappings=["foaf:accountName"], ), "account_name": SlotDefinition( new_name="has_or_had_account_name", slot_uri="foaf:accountName", description="""Name or handle of an account. Temporal as account names can change.""", exact_mappings=["foaf:accountName"], close_mappings=["schema:alternateName"], related_mappings=["foaf:nick"], ), "account_status": SlotDefinition( new_name="has_or_had_account_status", slot_uri="schema:status", description="""Current status of an account (active, suspended, deleted, etc.).""", exact_mappings=["schema:status"], close_mappings=["rico:hasRecordState"], related_mappings=["schema:eventStatus"], ), "accreditation": SlotDefinition( new_name="has_or_had_accreditation", slot_uri="schema:hasCredential", description="""Accreditation status or credential held by the institution. Temporal as accreditations can expire or be revoked.""", exact_mappings=["schema:hasCredential"], close_mappings=["org:classification"], related_mappings=["schema:award", "schema:memberOf"], ), "accreditation_body": SlotDefinition( new_name="has_or_had_accreditation_body", slot_uri="schema:recognizedBy", description="""Organization that granted the accreditation.""", exact_mappings=["schema:recognizedBy"], close_mappings=["prov:wasAttributedTo"], related_mappings=["schema:issuedBy", "dcterms:publisher"], ), "accumulation_date_end": SlotDefinition( new_name="has_accumulation_end_date", slot_uri="rico:hasEndDate", description="""End date of the accumulation period for archival materials. From RiC-O for archival date ranges.""", range_type="date", exact_mappings=["rico:hasEndDate"], close_mappings=["schema:endDate", "dcterms:date"], broad_mappings=["prov:endedAtTime"], ), "accumulation_date_start": SlotDefinition( new_name="has_accumulation_start_date", slot_uri="rico:hasBeginningDate", description="""Start date of the accumulation period for archival materials.""", range_type="date", exact_mappings=["rico:hasBeginningDate"], close_mappings=["schema:startDate", "dcterms:date"], broad_mappings=["prov:startedAtTime"], ), "accuracy_meters": SlotDefinition( new_name="has_accuracy_in_meters", slot_uri="geo:hasGeometry", description="""Accuracy of geographic coordinates in meters.""", range_type="float", close_mappings=["geo:hasGeometry"], related_mappings=["schema:geo", "gn:locationMap"], ), "acquisition_budget": SlotDefinition( new_name="has_or_had_acquisition_budget", slot_uri="schema:price", description="""Budget allocated for acquisitions. Temporal as budgets change annually.""", close_mappings=["schema:price", "schema:priceRange"], related_mappings=["schema:funding"], ), "acquisition_date": SlotDefinition( new_name="has_acquisition_date", slot_uri="schema:dateCreated", description="""Date when an item was acquired. Permanent historical fact.""", range_type="date", exact_mappings=["schema:dateCreated"], close_mappings=["dcterms:date", "prov:generatedAtTime"], narrow_mappings=["rico:hasAccessionDate"], ), "acquisition_history": SlotDefinition( new_name="has_acquisition_history", slot_uri="dcterms:provenance", description="""History of how materials were acquired. Permanent historical record.""", exact_mappings=["dcterms:provenance"], close_mappings=["rico:history", "schema:description"], related_mappings=["prov:wasGeneratedBy"], ), "acquisition_method": SlotDefinition( new_name="has_acquisition_method", slot_uri="rico:hasOrHadActivityType", description="""Method by which materials were acquired (purchase, donation, transfer, etc.).""", exact_mappings=["rico:hasOrHadActivityType"], close_mappings=["schema:acquiredFrom"], related_mappings=["prov:wasGeneratedBy"], ), "acquisition_source": SlotDefinition( new_name="has_acquisition_source", slot_uri="schema:acquiredFrom", description="""Source from which materials were acquired.""", exact_mappings=["schema:acquiredFrom"], close_mappings=["prov:wasAttributedTo", "dcterms:source"], related_mappings=["rico:hasOrHadAgent"], ), "active_since": SlotDefinition( new_name="has_active_since_date", slot_uri="schema:foundingDate", description="""Date from which an entity has been active.""", range_type="date", exact_mappings=["schema:foundingDate"], close_mappings=["rico:hasBeginningDate", "prov:startedAtTime"], broad_mappings=["dcterms:date"], ), "activities_societies": SlotDefinition( new_name="has_or_had_activity_or_society_membership", slot_uri="org:memberOf", description="""Professional activities and society memberships.""", multivalued=True, exact_mappings=["org:memberOf"], close_mappings=["schema:memberOf", "foaf:member"], related_mappings=["rico:isOrWasMemberOf"], ), "activity_description": SlotDefinition( new_name="has_activity_description", slot_uri="schema:description", description="""Description of an activity or event.""", exact_mappings=["schema:description"], close_mappings=["dcterms:description", "rico:scopeAndContent"], ), "activity_id": SlotDefinition( new_name="has_activity_identifier", slot_uri="schema:identifier", description="""Unique identifier for an activity.""", exact_mappings=["schema:identifier"], close_mappings=["dcterms:identifier"], ), "activity_name": SlotDefinition( new_name="has_activity_name", slot_uri="schema:name", description="""Name of an activity.""", exact_mappings=["schema:name"], close_mappings=["rdfs:label", "skos:prefLabel"], ), "activity_timespan": SlotDefinition( new_name="has_activity_timespan", slot_uri="crm:P4_has_time-span", description="""Time span during which an activity occurred.""", exact_mappings=["crm:P4_has_time-span"], close_mappings=["schema:duration", "rico:hasDateRange"], related_mappings=["prov:startedAtTime", "prov:endedAtTime"], ), "activity_type": SlotDefinition( new_name="has_activity_type", slot_uri="rico:hasOrHadActivityType", description="""Type or category of activity.""", exact_mappings=["rico:hasOrHadActivityType"], close_mappings=["schema:additionalType", "dcterms:type"], ), "actual_end": SlotDefinition( new_name="has_actual_end_date", slot_uri="schema:endDate", description="""Actual end date of an activity or event (vs. planned).""", range_type="datetime", exact_mappings=["schema:endDate"], close_mappings=["prov:endedAtTime", "rico:hasEndDate"], ), "actual_return_date": SlotDefinition( new_name="has_actual_return_date", slot_uri="schema:endDate", description="""Actual date of return for loaned items.""", range_type="date", exact_mappings=["schema:endDate"], close_mappings=["rico:hasEndDate"], narrow_mappings=["hc:hasReturnDate"], ), "actual_start": SlotDefinition( new_name="has_actual_start_date", slot_uri="schema:startDate", description="""Actual start date of an activity or event (vs. planned).""", range_type="datetime", exact_mappings=["schema:startDate"], close_mappings=["prov:startedAtTime", "rico:hasBeginningDate"], ), "admin_office_description": SlotDefinition( new_name="has_admin_office_description", slot_uri="schema:description", description="""Description of an administrative office.""", exact_mappings=["schema:description"], close_mappings=["dcterms:description"], ), "admin_office_id": SlotDefinition( new_name="has_admin_office_identifier", slot_uri="schema:identifier", description="""Identifier for an administrative office.""", exact_mappings=["schema:identifier"], close_mappings=["dcterms:identifier"], ), "admin_office_name": SlotDefinition( new_name="has_admin_office_name", slot_uri="schema:name", description="""Name of an administrative office.""", exact_mappings=["schema:name"], close_mappings=["rdfs:label"], ), "admin_staff_count": SlotDefinition( new_name="has_or_had_admin_staff_count", slot_uri="schema:numberOfEmployees", description="""Number of administrative staff. Temporal as staffing changes.""", range_type="integer", exact_mappings=["schema:numberOfEmployees"], close_mappings=["org:headcount"], ), "administration_description": SlotDefinition( new_name="has_administration_description", slot_uri="schema:description", description="""Description of administrative structure or functions.""", exact_mappings=["schema:description"], close_mappings=["dcterms:description", "rico:scopeAndContent"], ), "administration_name": SlotDefinition( new_name="has_administration_name", slot_uri="schema:name", description="""Name of an administrative unit or body.""", exact_mappings=["schema:name"], close_mappings=["rdfs:label", "org:name"], ), "administrative_expenses": SlotDefinition( new_name="has_or_had_administrative_expense", slot_uri="schema:expense", description="""Administrative expenses incurred. Temporal as these change over time.""", multivalued=True, close_mappings=["schema:price"], related_mappings=["schema:funding"], ), "administrative_functions": SlotDefinition( new_name="has_or_had_administrative_function", slot_uri="org:purpose", description="""Administrative functions performed by an organizational unit.""", multivalued=True, exact_mappings=["org:purpose"], close_mappings=["rico:hasOrHadActivityType"], related_mappings=["schema:knowsAbout"], ), "administrative_level": SlotDefinition( new_name="has_administrative_level", slot_uri="schema:isPartOf", description="""Administrative level in a hierarchy (national, regional, local, etc.).""", close_mappings=["schema:isPartOf", "org:subOrganizationOf"], related_mappings=["rico:isOrWasIncludedIn"], ), "admission_fee": SlotDefinition( new_name="has_or_had_admission_fee", slot_uri="schema:offers", description="""Admission fee charged by the institution. Temporal as fees change.""", exact_mappings=["schema:offers"], close_mappings=["schema:price", "schema:priceRange"], related_mappings=["gr:hasPriceSpecification"], ), "adoption_context": SlotDefinition( new_name="has_adoption_context", slot_uri="dcterms:description", description="""Context or circumstances of adoption of a standard, practice, or policy.""", close_mappings=["dcterms:description", "prov:wasGeneratedBy"], ), "affected_by_event": SlotDefinition( new_name="is_or_was_affected_by_event", slot_uri="rico:isOrWasAffectedBy", description="""Events that have affected this entity. From RiC-O for organizational changes.""", multivalued=True, exact_mappings=["rico:isOrWasAffectedBy"], close_mappings=["prov:wasInfluencedBy"], related_mappings=["crm:P12_occurred_in_the_presence_of"], ), "affected_territory": SlotDefinition( new_name="has_or_had_affected_territory", slot_uri="schema:areaServed", description="""Geographic territory affected by an event or policy.""", exact_mappings=["schema:areaServed"], close_mappings=["dcterms:spatial", "gn:locatedIn"], ), "affected_units": SlotDefinition( new_name="has_or_had_affected_unit", slot_uri="rico:isOrWasAffectedBy", description="""Organizational units affected by a change or event.""", multivalued=True, close_mappings=["rico:isOrWasAffectedBy", "org:hasUnit"], ), "affects_organization": SlotDefinition( new_name="affects_or_affected_organization", slot_uri="rico:affects", description="""Organization(s) affected by this event or change.""", multivalued=True, exact_mappings=["rico:affects"], close_mappings=["prov:influenced"], ), "affiliated_universities": SlotDefinition( new_name="has_or_had_affiliated_university", slot_uri="schema:affiliation", description="""Universities with which the institution is affiliated.""", multivalued=True, exact_mappings=["schema:affiliation"], close_mappings=["org:linkedTo", "rico:isOrWasAssociatedWith"], narrow_mappings=["schema:alumniOf"], ), "affiliation": SlotDefinition( new_name="has_or_had_affiliation", slot_uri="schema:affiliation", description="""Organizational affiliation of a person or entity.""", multivalued=True, exact_mappings=["schema:affiliation"], close_mappings=["org:memberOf", "foaf:member"], related_mappings=["pico:hasAffiliation"], ), "age": SlotDefinition( new_name="has_age", slot_uri="schema:age", description="""Age of a person or entity. For persons, typically calculated from birth date.""", range_type="integer", exact_mappings=["schema:age"], related_mappings=["foaf:age"], ), "agenda_description": SlotDefinition( new_name="has_agenda_description", slot_uri="schema:description", description="""Description of an agenda or meeting schedule.""", exact_mappings=["schema:description"], close_mappings=["dcterms:description"], ), "agenda_document_url": SlotDefinition( new_name="has_agenda_document_url", slot_uri="schema:url", description="""URL of an agenda document.""", range_type="uri", exact_mappings=["schema:url"], close_mappings=["dcterms:source"], ), "agenda_id": SlotDefinition( new_name="has_agenda_identifier", slot_uri="schema:identifier", description="""Identifier for an agenda.""", exact_mappings=["schema:identifier"], close_mappings=["dcterms:identifier"], ), "agenda_short_name": SlotDefinition( new_name="has_agenda_short_name", slot_uri="skos:altLabel", description="""Short name or abbreviation for an agenda.""", exact_mappings=["skos:altLabel"], close_mappings=["schema:alternateName"], ), "agenda_title": SlotDefinition( new_name="has_agenda_title", slot_uri="dcterms:title", description="""Title of an agenda.""", exact_mappings=["dcterms:title"], close_mappings=["schema:name", "rdfs:label"], ), "agenda_url": SlotDefinition( new_name="has_agenda_url", slot_uri="schema:url", description="""URL where the agenda can be accessed.""", range_type="uri", exact_mappings=["schema:url"], close_mappings=["foaf:page"], ), "agent_name": SlotDefinition( new_name="has_agent_name", slot_uri="foaf:name", description="""Name of an agent (person, organization, or software).""", exact_mappings=["foaf:name"], close_mappings=["schema:name", "rdfs:label"], broad_mappings=["prov:Agent"], ), "agent_type": SlotDefinition( new_name="has_agent_type", slot_uri="dcterms:type", description="""Type of agent (person, organization, software, etc.).""", exact_mappings=["dcterms:type"], close_mappings=["rdf:type", "schema:additionalType"], ), "aggregated_by": SlotDefinition( new_name="is_or_was_aggregated_by", slot_uri="dcterms:isPartOf", description="""Aggregator or collection that includes this resource.""", multivalued=True, exact_mappings=["dcterms:isPartOf"], close_mappings=["edm:isShownAt", "schema:includedInDataCatalog"], related_mappings=["ore:isAggregatedBy"], ), "aggregates_from": SlotDefinition( new_name="aggregates_or_aggregated_from", slot_uri="dcterms:source", description="""Sources from which this aggregator collects data.""", multivalued=True, exact_mappings=["dcterms:source"], close_mappings=["prov:wasDerivedFrom"], related_mappings=["ore:aggregates"], ), "agreement_signed_date": SlotDefinition( new_name="has_agreement_signed_date", slot_uri="schema:dateCreated", description="""Date when an agreement was signed. Permanent historical fact.""", range_type="date", exact_mappings=["schema:dateCreated"], close_mappings=["dcterms:date", "prov:generatedAtTime"], ), "air_changes_per_hour": SlotDefinition( new_name="has_air_changes_per_hour", slot_uri="hc:hasAirChangesPerHour", description="""Air exchange rate for climate control in storage/exhibition spaces.""", range_type="float", related_mappings=["schema:amenityFeature"], custodian_types='["M", "A", "L"]', specificity_score=0.85, ), "all_data_real": SlotDefinition( new_name="has_all_data_real_flag", slot_uri="hc:hasAllDataRealFlag", description="""Flag indicating whether all data in the record is real (not synthetic/test).""", range_type="boolean", ), "all_links": SlotDefinition( new_name="has_link", slot_uri="schema:url", description="""Collection of all links/URLs associated with an entity.""", multivalued=True, exact_mappings=["schema:url"], close_mappings=["foaf:page", "rdfs:seeAlso"], ), "allocated_by": SlotDefinition( new_name="is_or_was_allocated_by", slot_uri="prov:wasAttributedTo", description="""Entity that performed the allocation.""", exact_mappings=["prov:wasAttributedTo"], close_mappings=["dcterms:creator"], ), "allocates": SlotDefinition( new_name="allocates_or_allocated", slot_uri="prov:generated", description="""Resources or identifiers allocated by this entity.""", multivalued=True, close_mappings=["prov:generated"], ), "allocation_date": SlotDefinition( new_name="has_allocation_date", slot_uri="prov:generatedAtTime", description="""Date when an allocation was made. Permanent historical fact.""", range_type="date", exact_mappings=["prov:generatedAtTime"], close_mappings=["dcterms:date", "schema:dateCreated"], ), "allows_laptops": SlotDefinition( new_name="allows_or_allowed_laptop", slot_uri="schema:amenityFeature", description="""Whether laptops are permitted in reading rooms/study areas.""", range_type="boolean", close_mappings=["schema:amenityFeature"], custodian_types='["A", "L", "R"]', specificity_score=0.75, ), "allows_photography": SlotDefinition( new_name="allows_or_allowed_photography", slot_uri="schema:amenityFeature", description="""Whether photography is permitted. Policies can change.""", range_type="boolean", close_mappings=["schema:amenityFeature"], related_mappings=["dcterms:accessRights"], ), "alpha_2": SlotDefinition( new_name="has_alpha_2_code", slot_uri="lcc-lr:hasTag", description="""ISO 3166-1 alpha-2 country code (2 letters).""", exact_mappings=["lcc-lr:hasTag"], close_mappings=["schema:addressCountry"], related_mappings=["gn:countryCode"], ), "alpha_3": SlotDefinition( new_name="has_alpha_3_code", slot_uri="lcc-lr:hasTag", description="""ISO 3166-1 alpha-3 country code (3 letters).""", exact_mappings=["lcc-lr:hasTag"], close_mappings=["schema:addressCountry"], ), "also_allocation_agency": SlotDefinition( new_name="is_or_was_also_allocation_agency", slot_uri="org:purpose", description="""Indicates entity also serves as an allocation agency (e.g., ISIL).""", range_type="boolean", close_mappings=["org:purpose"], ), "also_identifies_name": SlotDefinition( new_name="also_identifies_name", slot_uri="skos:altLabel", description="""Additional names by which an entity may be identified.""", multivalued=True, exact_mappings=["skos:altLabel"], close_mappings=["schema:alternateName"], ), "alternative_names": SlotDefinition( new_name="has_or_had_alternative_name", slot_uri="skos:altLabel", description="""Alternative names for an entity. Temporal as names can change.""", multivalued=True, exact_mappings=["skos:altLabel"], close_mappings=["schema:alternateName", "foaf:nick"], related_mappings=["rico:hasOrHadName"], broad_mappings=["rdfs:label"], ), "alternative_observed_names": SlotDefinition( new_name="has_or_had_alternative_observed_name", slot_uri="pico:observedName", description="""Alternative names observed in source documents (emic preservation).""", multivalued=True, exact_mappings=["pico:observedName"], close_mappings=["skos:altLabel"], related_mappings=["rico:hasOrHadName"], ), "altitude": SlotDefinition( new_name="has_altitude", slot_uri="geo:alt", description="""Altitude/elevation above sea level. Permanent geographic fact.""", range_type="float", exact_mappings=["geo:alt"], close_mappings=["schema:elevation", "wgs84:alt"], ), "amendment_history": SlotDefinition( new_name="has_amendment_history", slot_uri="prov:wasRevisionOf", description="""History of amendments to a document or policy.""", multivalued=True, exact_mappings=["prov:wasRevisionOf"], close_mappings=["dcterms:replaces"], related_mappings=["schema:version"], ), "animal_species_count": SlotDefinition( new_name="has_or_had_animal_species_count", slot_uri="schema:numberOfItems", description="""Number of animal species in a collection (zoo, natural history museum).""", range_type="integer", close_mappings=["schema:numberOfItems"], custodian_types='["B", "M"]', custodian_types_primary="B", specificity_score=0.85, ), "annex_description": SlotDefinition( new_name="has_annex_description", slot_uri="schema:description", description="""Description of an annex or supplementary document.""", exact_mappings=["schema:description"], close_mappings=["dcterms:description"], ), "annex_id": SlotDefinition( new_name="has_annex_identifier", slot_uri="schema:identifier", description="""Identifier for an annex.""", exact_mappings=["schema:identifier"], close_mappings=["dcterms:identifier"], ), "annex_name": SlotDefinition( new_name="has_annex_name", slot_uri="schema:name", description="""Name of an annex.""", exact_mappings=["schema:name"], close_mappings=["rdfs:label"], ), "annex_reason": SlotDefinition( new_name="has_annex_reason", slot_uri="dcterms:description", description="""Reason for creating an annex.""", close_mappings=["dcterms:description", "skos:note"], ), "annotation_motivation": SlotDefinition( new_name="has_annotation_motivation", slot_uri="oa:motivatedBy", description="""Motivation for creating an annotation (Web Annotation vocabulary).""", exact_mappings=["oa:motivatedBy"], close_mappings=["dcterms:type"], ), "annotation_segments": SlotDefinition( new_name="has_annotation_segment", slot_uri="oa:hasTarget", description="""Segments or portions targeted by an annotation.""", multivalued=True, exact_mappings=["oa:hasTarget"], close_mappings=["oa:hasSelector"], ), "annotation_type": SlotDefinition( new_name="has_annotation_type", slot_uri="dcterms:type", description="""Type or category of annotation.""", exact_mappings=["dcterms:type"], close_mappings=["oa:motivatedBy", "schema:additionalType"], ), "annotations_by": SlotDefinition( new_name="has_annotation_by", slot_uri="oa:annotatedBy", description="""Agent that created the annotation.""", multivalued=True, exact_mappings=["oa:annotatedBy"], close_mappings=["prov:wasAttributedTo", "dcterms:creator"], ), "annual_participants": SlotDefinition( new_name="has_or_had_annual_participant_count", slot_uri="schema:attendeeCount", description="""Number of annual participants or visitors. Temporal metric.""", range_type="integer", close_mappings=["schema:attendeeCount"], related_mappings=["schema:numberOfEmployees"], ), "annual_revenue": SlotDefinition( new_name="has_or_had_annual_revenue", slot_uri="schema:annualRevenue", description="""Annual revenue of the organization. Changes yearly.""", exact_mappings=["schema:annualRevenue"], close_mappings=["schema:funding"], ), "api_available": SlotDefinition( new_name="has_api_available_flag", slot_uri="schema:availableOnDevice", description="""Whether an API is available for data access.""", range_type="boolean", close_mappings=["schema:availableOnDevice"], related_mappings=["dcat:accessService"], ), "api_documentation": SlotDefinition( new_name="has_api_documentation_url", slot_uri="schema:documentation", description="""URL to API documentation.""", range_type="uri", exact_mappings=["schema:documentation"], close_mappings=["dcat:landingPage"], ), "api_endpoint": SlotDefinition( new_name="has_api_endpoint", slot_uri="dcat:endpointURL", description="""URL of the API endpoint.""", range_type="uri", exact_mappings=["dcat:endpointURL"], close_mappings=["schema:url", "hydra:entrypoint"], ), "api_version": SlotDefinition( new_name="has_api_version", slot_uri="schema:version", description="""Version of the API.""", exact_mappings=["schema:version"], close_mappings=["dcat:version", "pav:version"], ), "appellation_language": SlotDefinition( new_name="has_appellation_language", slot_uri="dcterms:language", description="""Language of a name or appellation.""", exact_mappings=["dcterms:language"], close_mappings=["schema:inLanguage"], ), "appellation_type": SlotDefinition( new_name="has_appellation_type", slot_uri="crm:P2_has_type", description="""Type of appellation (official, vernacular, historical, etc.).""", exact_mappings=["crm:P2_has_type"], close_mappings=["dcterms:type"], ), "appellation_value": SlotDefinition( new_name="has_appellation_value", slot_uri="rdfs:label", description="""The actual string value of an appellation.""", exact_mappings=["rdfs:label"], close_mappings=["skos:prefLabel", "schema:name"], ), "appellations": SlotDefinition( new_name="has_or_had_appellation", slot_uri="crm:P1_is_identified_by", description="""Names or appellations by which an entity is known.""", multivalued=True, exact_mappings=["crm:P1_is_identified_by"], close_mappings=["rico:hasOrHadName", "schema:name"], broad_mappings=["rdfs:label"], ), "applicable_countries": SlotDefinition( new_name="has_applicable_country", slot_uri="schema:areaServed", description="""Countries where something is applicable.""", multivalued=True, exact_mappings=["schema:areaServed"], close_mappings=["dcterms:spatial", "schema:eligibleRegion"], ), "application_deadline": SlotDefinition( new_name="has_application_deadline", slot_uri="schema:applicationDeadline", description="""Deadline for applications.""", range_type="date", exact_mappings=["schema:applicationDeadline"], close_mappings=["schema:endDate"], ), "application_opening_date": SlotDefinition( new_name="has_application_opening_date", slot_uri="schema:startDate", description="""Date when applications open.""", range_type="date", exact_mappings=["schema:startDate"], close_mappings=["schema:validFrom"], ), "applies_to_call": SlotDefinition( new_name="applies_to_call", slot_uri="schema:isRelatedTo", description="""Call or announcement that something applies to.""", close_mappings=["schema:isRelatedTo", "dcterms:relation"], ), "appointment_required": SlotDefinition( new_name="has_appointment_required_flag", slot_uri="schema:reservationRequired", description="""Whether an appointment is required for access.""", range_type="boolean", exact_mappings=["schema:reservationRequired"], close_mappings=["schema:publicAccess"], ), "appraisal_notes": SlotDefinition( new_name="has_appraisal_note", slot_uri="rico:scopeAndContent", description="""Notes from archival appraisal process.""", multivalued=True, close_mappings=["rico:scopeAndContent", "skos:note"], custodian_types='["A"]', custodian_types_primary="A", specificity_score=0.90, ), "appraisal_policy": SlotDefinition( new_name="has_or_had_appraisal_policy", slot_uri="rico:hasOrHadRegulation", description="""Policy governing archival appraisal. Can change over time.""", exact_mappings=["rico:hasOrHadRegulation"], close_mappings=["schema:publishingPrinciples"], custodian_types='["A"]', specificity_score=0.90, ), "approval_date": SlotDefinition( new_name="has_approval_date", slot_uri="dcterms:dateAccepted", description="""Date of approval. Permanent historical fact.""", range_type="date", exact_mappings=["dcterms:dateAccepted"], close_mappings=["schema:dateCreated", "prov:generatedAtTime"], ), "approved_by": SlotDefinition( new_name="was_approved_by", slot_uri="prov:wasAttributedTo", description="""Entity that approved something.""", exact_mappings=["prov:wasAttributedTo"], close_mappings=["dcterms:creator", "schema:endorsedBy"], ), "approximate": SlotDefinition( new_name="is_approximate", slot_uri="hc:isApproximate", description="""Whether a value is approximate rather than exact.""", range_type="boolean", related_mappings=["schema:approximateValue"], ), "archdiocese_name": SlotDefinition( new_name="has_archdiocese_name", slot_uri="schema:name", description="""Name of the archdiocese (for religious heritage institutions).""", close_mappings=["schema:name", "rdfs:label"], custodian_types='["H"]', custodian_types_primary="H", specificity_score=0.90, ), "architect": SlotDefinition( new_name="has_or_had_architect", slot_uri="schema:architect", description="""Architect of a building or structure.""", multivalued=True, exact_mappings=["schema:architect"], close_mappings=["dcterms:creator", "crm:P14_carried_out_by"], ), "architectural_style": SlotDefinition( new_name="has_architectural_style", slot_uri="dbp:architecturalStyle", description="""Architectural style of a building.""", multivalued=True, exact_mappings=["dbp:architecturalStyle"], close_mappings=["schema:genre"], ), "archival_reference": SlotDefinition( new_name="has_archival_reference", slot_uri="rico:identifier", description="""Archival reference code or call number.""", exact_mappings=["rico:identifier"], close_mappings=["dcterms:identifier", "schema:identifier"], custodian_types='["A"]', specificity_score=0.85, ), "archival_status": SlotDefinition( new_name="has_or_had_archival_status", slot_uri="rico:hasRecordState", description="""Current archival status (open, closed, processing, etc.).""", exact_mappings=["rico:hasRecordState"], close_mappings=["schema:status"], custodian_types='["A"]', specificity_score=0.85, ), "archive_branches": SlotDefinition( new_name="has_or_had_archive_branch", slot_uri="org:hasUnit", description="""Branch locations of an archive.""", multivalued=True, exact_mappings=["org:hasUnit"], close_mappings=["schema:department", "rico:hasOrHadSubordinate"], custodian_types='["A"]', specificity_score=0.85, ), "archive_department_of": SlotDefinition( new_name="is_or_was_archive_department_of", slot_uri="org:subOrganizationOf", description="""Parent organization of which this archive is a department.""", exact_mappings=["org:subOrganizationOf"], close_mappings=["rico:isOrWasSubordinateTo", "schema:parentOrganization"], custodian_types='["A"]', specificity_score=0.85, ), "archive_description": SlotDefinition( new_name="has_archive_description", slot_uri="rico:scopeAndContent", description="""Description of an archive or archival collection.""", exact_mappings=["rico:scopeAndContent"], close_mappings=["dcterms:description", "schema:description"], custodian_types='["A"]', specificity_score=0.80, ), "archive_memento_uri": SlotDefinition( new_name="has_archive_memento_uri", slot_uri="schema:archivedAt", description="""URI of archived/memento version (Web Archive).""", range_type="uri", exact_mappings=["schema:archivedAt"], close_mappings=["prov:alternateOf"], ), "archive_name": SlotDefinition( new_name="has_archive_name", slot_uri="schema:name", description="""Name of an archive.""", exact_mappings=["schema:name"], close_mappings=["rdfs:label", "rico:name"], custodian_types='["A"]', specificity_score=0.80, ), "archive_path": SlotDefinition( new_name="has_archive_path", slot_uri="schema:contentUrl", description="""File path to archived content.""", range_type="string", close_mappings=["schema:contentUrl"], ), "archive_scope": SlotDefinition( new_name="has_or_had_archive_scope", slot_uri="rico:scopeAndContent", description="""Scope of an archive's collections or mandate.""", exact_mappings=["rico:scopeAndContent"], close_mappings=["dcterms:description"], custodian_types='["A"]', specificity_score=0.85, ), "archive_search_score": SlotDefinition( new_name="has_archive_search_score", slot_uri="hc:hasSearchScore", description="""Search relevance score from archive search.""", range_type="float", ), "archive_series": SlotDefinition( new_name="is_or_was_part_of_archive_series", slot_uri="rico:isOrWasIncludedIn", description="""Archive series containing this item.""", exact_mappings=["rico:isOrWasIncludedIn"], close_mappings=["dcterms:isPartOf"], custodian_types='["A"]', specificity_score=0.85, ), "archive_subtype": SlotDefinition( new_name="has_archive_subtype", slot_uri="dcterms:type", description="""Subtype of archive (national, regional, corporate, etc.).""", exact_mappings=["dcterms:type"], close_mappings=["schema:additionalType"], custodian_types='["A"]', specificity_score=0.85, ), "archived_at": SlotDefinition( new_name="was_archived_at", slot_uri="schema:archivedAt", description="""Location where something was archived.""", exact_mappings=["schema:archivedAt"], close_mappings=["prov:atLocation"], ), "archived_in": SlotDefinition( new_name="is_or_was_archived_in", slot_uri="rico:isOrWasIncludedIn", description="""Archive or repository where materials are held.""", exact_mappings=["rico:isOrWasIncludedIn"], close_mappings=["dcterms:isPartOf", "schema:holdingArchive"], ), "area_hectares": SlotDefinition( new_name="has_area_in_hectares", slot_uri="schema:size", description="""Area in hectares.""", range_type="float", close_mappings=["schema:size"], related_mappings=["geo:hasGeometry"], ), "area_served": SlotDefinition( new_name="has_or_had_area_served", slot_uri="schema:areaServed", description="""Geographic area served by the organization.""", exact_mappings=["schema:areaServed"], close_mappings=["dcterms:spatial", "gn:locatedIn"], ), "arrangement": SlotDefinition( new_name="has_arrangement", slot_uri="rico:hasOrHadArrangement", description="""Arrangement of archival materials.""", exact_mappings=["rico:hasOrHadArrangement"], close_mappings=["dcterms:description"], custodian_types='["A"]', specificity_score=0.90, ), "arrangement_level": SlotDefinition( new_name="has_arrangement_level", slot_uri="rico:hasRecordSetType", description="""Level of arrangement (fonds, series, file, item).""", exact_mappings=["rico:hasRecordSetType"], custodian_types='["A"]', specificity_score=0.90, ), "arrangement_notes": SlotDefinition( new_name="has_arrangement_note", slot_uri="skos:note", description="""Notes about arrangement of materials.""", multivalued=True, exact_mappings=["skos:note"], close_mappings=["rico:scopeAndContent"], custodian_types='["A"]', specificity_score=0.90, ), "arrangement_system": SlotDefinition( new_name="has_or_had_arrangement_system", slot_uri="rico:hasOrHadArrangement", description="""System used for arranging materials.""", exact_mappings=["rico:hasOrHadArrangement"], custodian_types='["A"]', specificity_score=0.90, ), "articles_archival_stage": SlotDefinition( new_name="has_articles_archival_stage", slot_uri="rico:hasRecordState", description="""Archival processing stage for articles.""", close_mappings=["rico:hasRecordState"], ), "articles_document_format": SlotDefinition( new_name="has_articles_document_format", slot_uri="dcterms:format", description="""Format of article documents.""", exact_mappings=["dcterms:format"], close_mappings=["schema:encodingFormat"], ), "articles_document_url": SlotDefinition( new_name="has_articles_document_url", slot_uri="schema:url", description="""URL of article document.""", range_type="uri", exact_mappings=["schema:url"], close_mappings=["schema:contentUrl"], ), "artist_representation": SlotDefinition( new_name="has_or_had_artist_representation", slot_uri="schema:represents", description="""Artists represented by a gallery.""", multivalued=True, close_mappings=["schema:represents"], custodian_types='["G"]', custodian_types_primary="G", specificity_score=0.90, ), "artwork_count": SlotDefinition( new_name="has_or_had_artwork_count", slot_uri="schema:numberOfItems", description="""Number of artworks in collection. Temporal as collections change.""", range_type="integer", close_mappings=["schema:numberOfItems"], custodian_types='["G", "M"]', specificity_score=0.80, ), "aspect_ratio": SlotDefinition( new_name="has_aspect_ratio", slot_uri="schema:videoFrameSize", description="""Aspect ratio of a video or image.""", close_mappings=["schema:videoFrameSize"], related_mappings=["schema:width", "schema:height"], ), "asserted_by": SlotDefinition( new_name="was_asserted_by", slot_uri="prov:wasAttributedTo", description="""Agent that made an assertion.""", exact_mappings=["prov:wasAttributedTo"], close_mappings=["dcterms:creator"], ), "assertion_date": SlotDefinition( new_name="has_assertion_date", slot_uri="prov:generatedAtTime", description="""Date when an assertion was made.""", range_type="datetime", exact_mappings=["prov:generatedAtTime"], close_mappings=["dcterms:date"], ), "assertion_id": SlotDefinition( new_name="has_assertion_identifier", slot_uri="schema:identifier", description="""Identifier for an assertion.""", exact_mappings=["schema:identifier"], close_mappings=["dcterms:identifier"], ), "assertion_rationale": SlotDefinition( new_name="has_assertion_rationale", slot_uri="skos:note", description="""Rationale for an assertion.""", exact_mappings=["skos:note"], close_mappings=["dcterms:description"], ), "assertion_value": SlotDefinition( new_name="has_assertion_value", slot_uri="rdf:value", description="""Value of an assertion.""", exact_mappings=["rdf:value"], ), "assessment_category": SlotDefinition( new_name="has_assessment_category", slot_uri="dcterms:type", description="""Category of assessment.""", exact_mappings=["dcterms:type"], close_mappings=["schema:additionalType"], ), "assessment_date": SlotDefinition( new_name="has_assessment_date", slot_uri="dcterms:date", description="""Date of assessment.""", range_type="date", exact_mappings=["dcterms:date"], ), "assigned_processor": SlotDefinition( new_name="has_or_had_assigned_processor", slot_uri="prov:wasAttributedTo", description="""Person or system assigned to process something.""", close_mappings=["prov:wasAttributedTo", "dcterms:contributor"], ), "associated_auxiliary_platform": SlotDefinition( new_name="has_or_had_associated_auxiliary_platform", slot_uri="schema:isRelatedTo", description="""Associated auxiliary digital platform.""", multivalued=True, close_mappings=["schema:isRelatedTo", "dcterms:relation"], ), "associated_custodian": SlotDefinition( new_name="has_or_had_associated_custodian", slot_uri="rico:isOrWasAssociatedWith", description="""Associated heritage custodian institution.""", multivalued=True, exact_mappings=["rico:isOrWasAssociatedWith"], close_mappings=["schema:affiliation", "org:linkedTo"], ), "associated_digital_platform": SlotDefinition( new_name="has_or_had_associated_digital_platform", slot_uri="schema:isRelatedTo", description="""Associated digital platform.""", multivalued=True, close_mappings=["schema:isRelatedTo", "dcat:accessService"], ), "associated_encompassing_bodies": SlotDefinition( new_name="has_or_had_associated_encompassing_body", slot_uri="org:memberOf", description="""Larger bodies or networks the institution is part of.""", multivalued=True, exact_mappings=["org:memberOf"], close_mappings=["rico:isOrWasMemberOf"], ), "associated_taxa": SlotDefinition( new_name="has_associated_taxon", slot_uri="dwc:associatedTaxa", description="""Associated biological taxa (Darwin Core).""", multivalued=True, exact_mappings=["dwc:associatedTaxa"], custodian_types='["B", "M"]', specificity_score=0.90, ), "auction_house": SlotDefinition( new_name="has_auction_house", slot_uri="schema:seller", description="""Auction house that sold an item.""", close_mappings=["schema:seller"], related_mappings=["dcterms:provenance"], ), "auction_sale_name": SlotDefinition( new_name="has_auction_sale_name", slot_uri="schema:name", description="""Name of an auction sale.""", exact_mappings=["schema:name"], close_mappings=["rdfs:label"], ), "audience_size": SlotDefinition( new_name="has_or_had_audience_size", slot_uri="schema:audienceSize", description="""Size of the target or actual audience. Temporal metric.""", range_type="integer", exact_mappings=["schema:audienceSize"], ), "audience_type": SlotDefinition( new_name="has_audience_type", slot_uri="schema:audienceType", description="""Type of target audience.""", multivalued=True, exact_mappings=["schema:audienceType"], close_mappings=["dcterms:audience"], ), "audio_event_segments": SlotDefinition( new_name="has_audio_event_segment", slot_uri="schema:hasPart", description="""Audio event segments within a recording.""", multivalued=True, close_mappings=["schema:hasPart"], related_mappings=["oa:hasTarget"], ), "audio_quality_score": SlotDefinition( new_name="has_audio_quality_score", slot_uri="schema:ratingValue", description="""Quality score for audio content.""", range_type="float", close_mappings=["schema:ratingValue"], ), "audit_date": SlotDefinition( new_name="has_audit_date", slot_uri="dcterms:date", description="""Date of an audit.""", range_type="date", exact_mappings=["dcterms:date"], ), "audit_opinion": SlotDefinition( new_name="has_audit_opinion", slot_uri="schema:review", description="""Opinion from an audit.""", close_mappings=["schema:review"], ), "audit_status": SlotDefinition( new_name="has_or_had_audit_status", slot_uri="schema:status", description="""Status of an audit. Temporal as audits progress.""", close_mappings=["schema:status"], ), "auditor_name": SlotDefinition( new_name="has_auditor_name", slot_uri="schema:name", description="""Name of the auditor.""", exact_mappings=["schema:name"], close_mappings=["foaf:name"], ), "authentication_required": SlotDefinition( new_name="has_authentication_required_flag", slot_uri="schema:isAccessibleForFree", description="""Whether authentication is required for access.""", range_type="boolean", related_mappings=["schema:isAccessibleForFree"], ), "authority_file_abbreviation": SlotDefinition( new_name="has_authority_file_abbreviation", slot_uri="skos:altLabel", description="""Abbreviation for an authority file (e.g., VIAF, LCSH).""", exact_mappings=["skos:altLabel"], ), "authority_file_name": SlotDefinition( new_name="has_authority_file_name", slot_uri="skos:prefLabel", description="""Name of an authority file.""", exact_mappings=["skos:prefLabel"], close_mappings=["schema:name"], ), "authority_file_url": SlotDefinition( new_name="has_authority_file_url", slot_uri="schema:url", description="""URL of an authority file.""", range_type="uri", exact_mappings=["schema:url"], ), "authors": SlotDefinition( new_name="has_author", slot_uri="dcterms:creator", description="""Authors of a work.""", multivalued=True, exact_mappings=["dcterms:creator"], close_mappings=["schema:author", "schema:creator"], related_mappings=["foaf:maker"], ), "auto_generated": SlotDefinition( new_name="is_auto_generated", slot_uri="prov:wasGeneratedBy", description="""Whether content was automatically generated.""", range_type="boolean", close_mappings=["prov:wasGeneratedBy"], ), "auxiliary_place_id": SlotDefinition( new_name="has_auxiliary_place_identifier", slot_uri="schema:identifier", description="""Identifier for an auxiliary place.""", exact_mappings=["schema:identifier"], ), "auxiliary_place_type": SlotDefinition( new_name="has_auxiliary_place_type", slot_uri="dcterms:type", description="""Type of auxiliary place.""", exact_mappings=["dcterms:type"], ), "auxiliary_places": SlotDefinition( new_name="has_auxiliary_place", slot_uri="schema:containsPlace", description="""Auxiliary places associated with an entity.""", multivalued=True, close_mappings=["schema:containsPlace"], ), "auxiliary_platform_id": SlotDefinition( new_name="has_auxiliary_platform_identifier", slot_uri="schema:identifier", description="""Identifier for an auxiliary digital platform.""", exact_mappings=["schema:identifier"], ), "auxiliary_platform_type": SlotDefinition( new_name="has_auxiliary_platform_type", slot_uri="dcterms:type", description="""Type of auxiliary digital platform.""", exact_mappings=["dcterms:type"], ), "auxiliary_platforms": SlotDefinition( new_name="has_auxiliary_platform", slot_uri="schema:isRelatedTo", description="""Auxiliary digital platforms.""", multivalued=True, close_mappings=["schema:isRelatedTo"], ), "availability_timespan": SlotDefinition( new_name="has_availability_timespan", slot_uri="schema:availabilityStarts", description="""Time span during which something is available.""", close_mappings=["schema:availabilityStarts", "schema:availabilityEnds"], ), "available_caption_languages": SlotDefinition( new_name="has_available_caption_language", slot_uri="schema:subtitleLanguage", description="""Languages in which captions are available.""", multivalued=True, exact_mappings=["schema:subtitleLanguage"], close_mappings=["dcterms:language"], ), "average_entry_duration_seconds": SlotDefinition( new_name="has_average_entry_duration_seconds", slot_uri="schema:duration", description="""Average duration of entries in seconds.""", range_type="float", close_mappings=["schema:duration"], ), "average_scene_duration_seconds": SlotDefinition( new_name="has_average_scene_duration_seconds", slot_uri="schema:duration", description="""Average duration of scenes in seconds.""", range_type="float", close_mappings=["schema:duration"], ), } def generate_prefixes(slot_def: SlotDefinition) -> Dict[str, str]: """Generate prefixes needed for the slot definition.""" prefixes = { "linkml": "https://w3id.org/linkml/", "hc": "https://nde.nl/ontology/hc/", } # Extract prefixes from slot_uri and mappings all_uris = [slot_def.slot_uri] + slot_def.exact_mappings + slot_def.close_mappings + \ slot_def.related_mappings + slot_def.narrow_mappings + slot_def.broad_mappings prefix_map = { "schema:": ("schema", "https://schema.org/"), "dcterms:": ("dcterms", "http://purl.org/dc/terms/"), "skos:": ("skos", "http://www.w3.org/2004/02/skos/core#"), "foaf:": ("foaf", "http://xmlns.com/foaf/0.1/"), "rico:": ("rico", "https://www.ica.org/standards/RiC/ontology#"), "org:": ("org", "http://www.w3.org/ns/org#"), "prov:": ("prov", "http://www.w3.org/ns/prov#"), "crm:": ("crm", "http://www.cidoc-crm.org/cidoc-crm/"), "rdfs:": ("rdfs", "http://www.w3.org/2000/01/rdf-schema#"), "rdf:": ("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"), "geo:": ("geo", "http://www.opengis.net/ont/geosparql#"), "wgs84:": ("wgs84", "http://www.w3.org/2003/01/geo/wgs84_pos#"), "gn:": ("gn", "http://www.geonames.org/ontology#"), "dcat:": ("dcat", "http://www.w3.org/ns/dcat#"), "premis:": ("premis", "http://www.loc.gov/premis/rdf/v3/"), "edm:": ("edm", "http://www.europeana.eu/schemas/edm/"), "ore:": ("ore", "http://www.openarchives.org/ore/terms/"), "oa:": ("oa", "http://www.w3.org/ns/oa#"), "pico:": ("pico", "https://personincontext.org/ontology/"), "gr:": ("gr", "http://purl.org/goodrelations/v1#"), "dbp:": ("dbp", "http://dbpedia.org/property/"), "gleif-base:": ("gleif-base", "https://www.gleif.org/ontology/Base/"), "tooi:": ("tooi", "https://identifier.overheid.nl/tooi/def/ont/"), "pav:": ("pav", "http://purl.org/pav/"), "hydra:": ("hydra", "http://www.w3.org/ns/hydra/core#"), "lcc-lr:": ("lcc-lr", "https://www.omg.org/spec/LCC/Languages/LanguageRepresentation/"), "dwc:": ("dwc", "http://rs.tdwg.org/dwc/terms/"), } for uri in all_uris: for prefix_str, (prefix_name, prefix_uri) in prefix_map.items(): if uri.startswith(prefix_str): prefixes[prefix_name] = prefix_uri break return prefixes def generate_slot_yaml(old_name: str, slot_def: SlotDefinition) -> str: """Generate YAML content for a slot definition.""" prefixes = generate_prefixes(slot_def) # Build YAML manually for proper formatting lines = [ f"id: https://nde.nl/ontology/hc/slot/{slot_def.new_name}", f"name: {slot_def.new_name}_slot", f"title: {slot_def.new_name.replace('_', ' ').title()} Slot", "prefixes:", ] for prefix, uri in sorted(prefixes.items()): lines.append(f" {prefix}: {uri}") lines.extend([ "imports:", "- linkml:types", "default_prefix: hc", "slots:", f" {slot_def.new_name}:", f" description: >-", ]) # Format description desc_lines = slot_def.description.strip().split('\n') for line in desc_lines: lines.append(f" {line.strip()}") lines.append(f" range: {slot_def.range_type}") if slot_def.multivalued: lines.append(" multivalued: true") lines.append(f" slot_uri: {slot_def.slot_uri}") # Add mappings if present if slot_def.exact_mappings: lines.append(" exact_mappings:") for m in slot_def.exact_mappings: lines.append(f" - {m}") if slot_def.close_mappings: lines.append(" close_mappings:") for m in slot_def.close_mappings: lines.append(f" - {m}") if slot_def.related_mappings: lines.append(" related_mappings:") for m in slot_def.related_mappings: lines.append(f" - {m}") if slot_def.narrow_mappings: lines.append(" narrow_mappings:") for m in slot_def.narrow_mappings: lines.append(f" - {m}") if slot_def.broad_mappings: lines.append(" broad_mappings:") for m in slot_def.broad_mappings: lines.append(f" - {m}") # Add annotations lines.append(" annotations:") lines.append(f" custodian_types: '{slot_def.custodian_types}'") lines.append(f" custodian_types_rationale: >-") lines.append(f" {slot_def.custodian_types_rationale}") lines.append(f" custodian_types_primary: {slot_def.custodian_types_primary}") lines.append(f" specificity_score: {slot_def.specificity_score}") lines.append(f" specificity_rationale: >-") lines.append(f" {slot_def.specificity_rationale}") return '\n'.join(lines) + '\n' def update_slot_file(slots_dir: Path, old_name: str, slot_def: SlotDefinition, dry_run: bool = False) -> Tuple[bool, str]: """Update a single slot file.""" old_file = slots_dir / f"{old_name}.yaml" new_file = slots_dir / f"{slot_def.new_name}.yaml" if not old_file.exists(): return False, f"Source file not found: {old_file}" yaml_content = generate_slot_yaml(old_name, slot_def) if dry_run: return True, f"Would update {old_name} -> {slot_def.new_name}" # Write new file with open(new_file, 'w') as f: f.write(yaml_content) # Remove old file if different name if old_file != new_file: old_file.unlink() return True, f"Updated {old_name} -> {slot_def.new_name}" def main(): import argparse parser = argparse.ArgumentParser(description="Update LinkML slot files with RiC-O naming and mappings") parser.add_argument("--dry-run", action="store_true", help="Preview changes without writing files") parser.add_argument("--slots-dir", default="schemas/20251121/linkml/modules/slots", help="Path to slots directory") args = parser.parse_args() slots_dir = Path(args.slots_dir) if not slots_dir.exists(): print(f"Slots directory not found: {slots_dir}") return 1 print(f"Processing {len(SLOT_DEFINITIONS)} slot definitions...") print(f"Slots directory: {slots_dir}") print(f"Dry run: {args.dry_run}") print() success_count = 0 error_count = 0 for old_name, slot_def in sorted(SLOT_DEFINITIONS.items()): success, message = update_slot_file(slots_dir, old_name, slot_def, args.dry_run) if success: print(f"✓ {message}") success_count += 1 else: print(f"✗ {message}") error_count += 1 print() print(f"Processed: {success_count + error_count}") print(f"Success: {success_count}") print(f"Errors: {error_count}") return 0 if error_count == 0 else 1 if __name__ == "__main__": exit(main())