glam/schemas/20251121/linkml/modules/classes/TemplateSpecificityScore.yaml
2026-02-04 00:24:46 +01:00

47 lines
No EOL
3 KiB
YAML

id: https://nde.nl/ontology/hc/class/TemplateSpecificityScore
name: TemplateSpecificityScore
title: Template Specificity Score
prefixes:
linkml: https://w3id.org/linkml/
hc: https://nde.nl/ontology/hc/
schema: http://schema.org/
default_prefix: hc
imports:
- linkml:types
# - ../slots/20260202_matang/has_score
- ../slots/20260202_matang/has_type
classes:
TemplateSpecificityScore:
class_uri: schema:Rating
description: "A single template specificity score associating a template type with a numeric value.\n\n**Purpose** (Rule 37):\nEnables context-aware RAG retrieval by assigning relevance scores\n(0.0-1.0) to schema classes for different conversation templates.\n\n**Design Pattern**:\nReplaces the previous `TemplateSpecificityScores` class which had\n10 separate score slots (one per template). The new pattern uses:\n- `has_type` \u2192 `TemplateSpecificityType` (which template)\n- `has_score` \u2192 float (the relevance score)\n\n**Benefits**:\n- Extensible: Adding new templates doesn't require new slots\n- Consistent: Follows RiC-O naming conventions (Rule 39)\n- Reusable: Uses generic slots per Rule 38 (slot centralization)\n\n**Score Semantics** (LOWER = more broadly relevant):\n| Score Range | Meaning | Examples |\n|-------------|---------|----------|\n| 0.00-0.20 | Universal | HeritageCustodian, Location |\n| 0.20-0.40 | Broadly useful | Collection, Identifier |\n| 0.40-0.60\
\ | Moderately specific | ChangeEvent, PersonProfile |\n| 0.60-0.80 | Fairly specific | Archive, Museum, Library |\n| 0.80-1.00 | Highly specific | LinkedInConnectionExtraction |\n\n**Migration Notes**:\n- Old: `template_specificity` slot with `TemplateSpecificityScores` class\n- New: `has_score` slot with `TemplateSpecificityScore` class (multivalued)\n- Old class archived: TemplateSpecificityScores \u2192 archive/\n"
slots:
- has_type
- has_score
slot_usage:
has_type:
range: TemplateSpecificityType
required: true
has_score:
range: float
required: true
minimum_value: 0.0
maximum_value: 1.0
annotations:
specificity_score: 0.15
specificity_rationale: 'Low specificity (meta-class) - TemplateSpecificityScore is part of the
RAG scoring infrastructure. Broadly relevant for understanding schema
organization but not for domain content queries.
'
migration_source: template_specificity
migration_date: '2026-01-17'
replaces_class: TemplateSpecificityScores
rule_compliance: Rules 37, 38, 39, 53, 56 (specificity, slot centralization, RiC-O naming, full migration, semantic consistency)
custodian_types: "['*']"
examples:
- value: "archive_relevance:\n has_type: ArchiveSearchTemplate\n has_score: 0.85\n"
- value: "museum_relevance:\n has_type: MuseumSearchTemplate\n has_score: 0.20\n"
- value: "# Multiple scores for a single class\nscores:\n - has_type: ArchiveSearchTemplate\n has_score: 0.95\n - has_type: LibrarySearchTemplate\n has_score: 0.30\n - has_type: GeneralHeritageTemplate\n has_score: 0.45\n"