FLOW ALGEBRA
Ontology: Search Metadata Ontology
Domain: Metadata Ontologies > Semantic Search Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/semantic-search-metadata/search-metadata-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "SearchMetadataOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: SemanticSearchMetadata
subject: SearchMetadata
purpose:
- represent metadata describing search queries, indexes, retrieval processes, rankings, and results
- preserve query identity, text, intent, context, filters, retrieval method, relevance, confidence, and provenance
- support lexical, semantic, vector, structured, and hybrid search
- distinguish relevance, similarity, confidence, ranking, and factual correctness
- enable machine-readable reasoning over search processes
# ---------- CORE ENTITIES ----------
entity SearchMetadata:
type: MetadataEntity
describes: [SearchQuery, SearchProcess, SearchIndex, SearchResultSet]
may_include:
- query_identifier
- query_text
- query_language
- query_type
- intent
- entities
- concepts
- context
- filters
- sorting
- temporal_constraint
- spatial_constraint
- search_index
- retrieval_method
- ranking_method
- relevance
- similarity
- confidence
- result_count
- latency
- timestamp
- provenance
entity SearchQuery:
type: InformationRequest
entity SearchProcess:
type: RetrievalProcess
consumes: SearchQuery
produces: SearchResultSet
entity SearchIndex:
type: RetrievalIndex
entity SearchResult:
type: RetrievalResult
# ---------- RELATIONSHIPS ----------
relationships:
SearchMetadata -> DESCRIBES -> SearchQuery
SearchQuery -> MAY_HAVE_INTENT -> SearchIntent
SearchQuery -> MAY_REFERENCE -> Entity
SearchQuery -> MAY_REFERENCE -> Concept
SearchQuery -> MAY_HAVE_CONTEXT -> SearchContext
SearchQuery -> MAY_HAVE_FILTER -> SearchFilter
SearchProcess -> USES -> SearchIndex
SearchProcess -> USES_METHOD -> RetrievalMethod
SearchProcess -> USES_RANKING -> RankingMethod
SearchProcess -> RETURNS -> SearchResultSet
SearchResultSet -> CONTAINS -> SearchResult
SearchResult -> REFERENCES -> SearchableResource
SearchResult -> HAS_RANK -> Rank
SearchResult -> MAY_HAVE_RELEVANCE -> RelevanceScore
SearchResult -> MAY_HAVE_SIMILARITY -> SimilarityScore
SearchResult -> MAY_HAVE_CONFIDENCE -> SearchConfidence
SearchMetadata -> MAY_REFERENCE -> SearchProvenance
# ---------- QUERY ----------
entity QueryIdentifier:
type: Identifier
identifies: SearchQuery
rule query_identity:
SearchQuery SHOULD have QueryIdentifier
where reproducibility, session tracking, or auditing is required
rule repeated_query:
identical query text MAY represent distinct executions
under different time, context, index, or configuration
rule query_text:
original query text SHOULD be preserved
rule normalised_query:
normalised query != original query
and SHOULD remain traceable to source query
rule language:
query language SHOULD be preserved or inferred with confidence
where interpretation depends on it
query_types:
- keyword
- natural_language
- question
- entity_lookup
- navigational
- structured
- semantic
- vector
- hybrid
rule query_type:
QueryType describes retrieval interpretation
and != SearchIntent
# ---------- SEARCH INTENT ----------
entity SearchIntent:
type: SemanticMetadata
may_be:
- informational
- navigational
- transactional
- comparative
- local
- research
- question_answering
- entity_lookup
rule intent:
SearchIntent MAY be inferred
and SHOULD preserve confidence
rule intent_text:
inferred intent != literal query text
# ---------- CONTEXT ----------
entity SearchContext:
type: ContextMetadata
may_include:
- conversation_context
- user_context
- task_context
- domain_context
- temporal_context
- spatial_context
rule context:
SearchContext MAY influence interpretation and ranking
but MUST NOT alter source facts
# ---------- FILTERS / SORT ----------
entity SearchFilter:
type: QueryConstraint
may_include: [field, operator, value, datatype]
filter_operators:
- equals
- not_equals
- greater_than
- less_than
- greater_or_equal
- less_or_equal
- contains
- in
- range
- exists
rule filter:
filtering eligibility != ranking relevance
entity SearchSort:
type: OrderingMetadata
may_include: [field, direction, priority]
rule sort:
explicit sort MAY override relevance ordering
# ---------- INDEXES ----------
search_index_types:
- LexicalIndex
- SemanticIndex
- VectorIndex
- GraphIndex
- StructuredIndex
rule index:
SearchIndex SHOULD preserve index identifier, version, or update time
where reproducibility matters
# ---------- RETRIEVAL ----------
entity LexicalSearch:
subtype_of: SearchProcess
may_include:
- tokenisation
- stemming
- lemmatisation
- term_frequency
- inverse_document_frequency
- field_weights
rule lexical:
lexical match != semantic equivalence
entity SemanticSearch:
subtype_of: SearchProcess
may_include:
- entities
- concepts
- ontology
- semantic_annotations
- embeddings
rule semantic:
semantic retrieval SHOULD preserve interpretation method
entity VectorSearch:
subtype_of: SearchProcess
may_include:
- query_embedding
- vector_index
- embedding_model
- model_version
- distance_metric
- nearest_neighbour_method
rule vector:
query and indexed vectors MUST be compatible
for direct similarity comparison
rule vector_similarity:
vector similarity != factual correctness
entity HybridSearch:
subtype_of: SearchProcess
combines:
- lexical_score
- semantic_score
- vector_score_optional
- structured_score_optional
rule hybrid:
HybridSearch SHOULD preserve component scores
and combination method
retrieval_methods:
- exact_match
- boolean
- full_text
- BM25
- semantic_graph
- vector_nearest_neighbour
- hybrid
- filtered_search
entity RetrievalMethod:
type: SearchMethod
# ---------- QUERY EXPANSION ----------
entity QueryExpansion:
type: SearchProcess
may_include:
- original_term
- expanded_term
- expansion_type
- source
- confidence
expansion_types:
- synonym
- alias
- spelling_variant
- broader_concept
- narrower_concept
- related_concept
- entity_alias
rule expansion:
expanded term SHOULD preserve semantic relationship
to original term
rule expansion_drift:
unsupported semantic broadening SHOULD NOT be silently applied
# ---------- RELEVANCE / SIMILARITY ----------
entity RelevanceScore:
type: SearchScore
may_include: [value, scoring_method, normalisation, scope]
rule relevance:
RelevanceScore expresses retrieval relevance
NOT factual truth
rule relevance_comparison:
scores from incompatible methods SHOULD NOT be directly compared
entity SimilarityScore:
type: SearchScore
may_include: [value, metric, representation_space]
rule similarity:
similarity != semantic equivalence
rule similarity_metric:
similarity score MUST preserve metric semantics
# ---------- RANKING ----------
entity Rank:
type: OrdinalMetadata
range: positive_integer
entity RankingMethod:
type: SearchMethod
may_include:
- algorithm
- features
- weights
- model
- model_version
rule rank:
Rank SHOULD preserve ordering convention
rule ranking:
high rank != factual correctness
entity SearchReranking:
type: SearchProcess
may_include:
- candidate_set
- reranker
- reranker_version
- features
- output_scores
- final_order
rule reranking:
reranking SHOULD preserve original candidate provenance
and prior scores where auditability matters
# ---------- RESULT SET ----------
entity SearchResultSet:
type: RetrievalResultCollection
may_include:
- result_count
- returned_count
- total_estimate
- results
- pagination
- continuation_token
rule result_count:
returned_count != total_result_count
rule estimated_total:
estimated total MUST remain distinguishable from exact total
entity SearchResult:
type: RetrievalResult
may_include:
- resource_identifier
- title
- URL
- snippet
- rank
- relevance
- similarity
- matched_fields
- matched_entities
- matched_concepts
- provenance
rule result:
SearchResult SHOULD reference source SearchableResource
rule snippet:
SearchSnippet != full source content
rule generated_snippet:
generated snippet SHOULD remain distinguishable
from verbatim extracted snippet
# ---------- PAGINATION ----------
entity SearchPagination:
type: RetrievalMetadata
may_include: [page, page_size, offset, cursor, continuation_token]
rule pagination:
pagination state SHOULD preserve retrieval ordering context
# ---------- TEMPORAL / SPATIAL ----------
entity SearchTemporalConstraint:
type: TemporalMetadata
may_include: [start_time, end_time, reference_time, date_field]
rule recency:
recency != relevance
unless ranking explicitly incorporates recency
entity SearchSpatialConstraint:
type: SpatialMetadata
may_include: [location, radius, bounding_area, coordinate_reference]
rule spatial:
spatial search SHOULD preserve coordinate and distance semantics
# ---------- CONFIDENCE ----------
entity SearchConfidence:
type: EpistemicMetadata
range: [0.0, 1.0]
rule confidence_bounds:
REQUIRE 0.0 <= confidence <= 1.0
rule confidence_scope:
confidence SHOULD identify whether it qualifies:
- intent
- entity_resolution
- concept_mapping
- query_expansion
- result_interpretation
rule confidence_relevance:
SearchConfidence != RelevanceScore
# ---------- PERFORMANCE ----------
entity SearchPerformanceMetadata:
type: PerformanceMetadata
may_include:
- latency
- candidate_count
- index_lookup_time
- reranking_time
rule performance:
performance measurements SHOULD preserve search configuration
where comparison depends on it
# ---------- EXPLANATION ----------
entity SearchExplanationMetadata:
type: SearchMetadata
may_include:
- matched_terms
- matched_fields
- matched_entities
- matched_concepts
- score_components
- filters_applied
- ranking_method
rule explanation:
explanation SHOULD expose meaningful retrieval evidence
without requiring hidden internal chain-of-thought
# ---------- PROVENANCE ----------
entity SearchProvenance:
type: ProvenanceMetadata
may_include:
- query
- query_transformations
- index
- index_version
- retrieval_method
- ranking_method
- reranker
- timestamp
- source_resources
rule provenance:
SearchMetadata SHOULD preserve retrieval configuration and history
# ---------- VALIDATION ----------
validation:
require:
- identifiable_query_or_search_process
validate_if_present:
- query_identifier
- query_text
- language
- intent
- context
- filters
- index
- retrieval_method
- relevance
- similarity
- ranking
- confidence
- provenance
reject:
- confidence_outside_valid_range
- incompatible_vector_spaces_compared_without transformation
- relevance_presented_as factual_confidence
- similarity_presented_as semantic_equivalence_without evidence
- rank_presented_as truth
- inferred_intent_presented_as original_query
- generated_snippet_presented_as verbatim_source
- estimated_total_presented_as exact_count
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"search metadata" ~= "metadata about search and retrieval"
"search query metadata" ~= "metadata describing a search query"
"search result metadata" ~= "metadata describing retrieval results"
"search ranking metadata" ~= "metadata describing result ordering"
"query expansion" ~= "search-term expansion" WHEN semantic relationship is preserved
"hybrid search" ~= "combined lexical and semantic retrieval"
PRESERVE distinctions:
query_text != inferred_intent
query_type != search_intent
filter != ranking
lexical_match != semantic_equivalence
vector_similarity != factual_correctness
relevance != confidence
rank != truth
recency != relevance
returned_count != total_count
estimated_total != exact_total
snippet != source_resource
explanation_metadata != hidden_chain_of_thought
# ---------- CONFIDENCE MODEL ----------
CONFIDENCE:
explicit_search_metadata:
score: 1.00
explicit_query_and_configuration:
score: 1.00
stable_resource_identifier:
score: 0.99
compatible_vector_retrieval:
score: dependent_on_metric
inferred_query_intent:
score: <= 0.85
inferred_entity_resolution:
score: <= 0.90
lexical_only_semantic_inference:
score: <= 0.70
ambiguous_search_interpretation:
score: <= 0.60
action: preserve alternatives
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_query_creation:
- assign QueryIdentifier
- preserve original query text
- record language
- initialise context
- initialise provenance
on_query_interpretation:
- preserve original query
- resolve entities and concepts
- infer intent with confidence
- record expansions and transformations
- update provenance
on_search_execution:
- record index and version
- record retrieval method
- apply filters and constraints
- retrieve candidates
- calculate scores
- rank results
- update provenance
on_reranking:
- preserve initial result ordering
- record reranker and version
- preserve component scores
- create final ranking
- update provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- search_entities
- relationships
- query_rules
- filter_rules
- retrieval_rules
- ranking_rules
- result_rules
- validation
- semantic_equivalence
- confidence_model
- update_model
canonicalisation:
- normalise_query_metadata
- preserve_original_query_text
- preserve_identifiers
- preserve_result_order
- preserve_score_method_context
- preserve_rule_order
output:
deterministic_semantic_hash
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
interpret_as:
- semantic search metadata ontology
- query and retrieval lifecycle model
- ranking and result metadata structure
- lexical, semantic, vector, and hybrid search model
operations:
- identify search queries
- preserve original query text
- resolve language and query type
- infer search intent
- apply context, filters, and sorting
- resolve search indexes
- execute lexical, semantic, vector, or hybrid retrieval
- expand queries
- calculate relevance and similarity
- rank and rerank candidates
- paginate result sets
- expose explanation metadata
- trace provenance
- preserve uncertainty
constraints:
- do_not_equate_query_text_with inferred_intent
- do_not_equate_filtering_with ranking
- do_not_equate_similarity_with semantic_equivalence
- do_not_equate_relevance_with factual_confidence
- do_not_equate_rank_with truth
- do_not_require_or_expose_hidden_chain_of_thought
- preserve_query_transformations_indexes_scores_rankings_and_provenance
# ---------- QUERY MODEL ----------
query:
input:
- query_text
- query_type
- language
- intent
- context
- filter
- sort
- temporal_constraint
- spatial_constraint
- retrieval_method
resolve:
1. create or identify SearchQuery
2. preserve original query text
3. resolve language and query type
4. infer SearchIntent where applicable
5. apply context, filters, sorting, and constraints
6. select SearchIndex and RetrievalMethod
7. retrieve candidate resources
8. calculate relevance, similarity, and ranking
9. rerank and construct SearchResultSet
10. return explanation metadata, provenance, and confidence
output:
- search_query
- interpreted_query
- intent
- filters
- retrieval_method
- result_set
- ranks
- relevance
- similarity
- confidence
- explanation_metadata
- provenance
# ---------- INFERENCE ----------
inference:
IF query text exactly matches indexed identifier
THEN exact-match retrieval MAY receive strong candidate priority
IF query intent is inferred
THEN preserve inference confidence
AND retain original query unchanged
IF vector query and index share compatible embedding space
THEN similarity MAY be calculated
according_to declared metric
IF lexical and semantic scores are combined
THEN preserve component scores
AND apply declared hybrid ranking rule
IF search interpretation remains ambiguous
THEN preserve alternative interpretations
AND reduce confidence
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: SearchMetadata
query_identity: machine_interpretable
original_query: preserved
query_interpretation: explicit
intent_and_context: confidence_qualified
filters_and_sorting: explicit
retrieval_methods: traceable
indexes: version_aware
relevance_similarity_confidence: distinguishable
rankings: ordered_and_traceable
result_sets: paginatable
explanation_metadata: available
provenance: preserved
uncertainty: explicit
semantic_retrieval: enabled
end flow
Download Code
Copy to Clipboard