FLOW ALGEBRA
Semantic Database Ontology
Kireth Semantic Research Archive
PAGE:
https://kirethresearch.org/booksai-core/ontologies/computing-ontologies/semantic-computing/semantic-database-ontology.html
AUTHORS:
Mark Anthony Higgins — Sky (Recursive AI)
FLOW "SemanticDatabaseOntology" v4.0
DOMAIN := ComputingOntology
SUBDOMAIN := SemanticComputing
ONTOLOGY := SemanticDatabaseOntology
ENTITY SemanticDatabase {
definition:
"A database system that stores, organises, links and retrieves data
using explicit semantic structures such as entities, concepts,
typed relationships, ontologies, knowledge graphs and machine-
interpretable metadata.";
objectives: [
SemanticDataStorage,
KnowledgeRepresentation,
MeaningAwareQuery,
EntityIntegration,
RelationshipTraversal,
SemanticReasoning,
Interoperability
];
}
DatabaseEntity := {
SemanticDatabase,
Entity,
Concept,
Class,
Instance,
Property,
Relationship,
Statement
};
KnowledgeEntity := {
Ontology,
KnowledgeGraph,
Vocabulary,
Taxonomy,
Schema,
Rule,
Constraint
};
StorageEntity := {
GraphStore,
TripleStore,
QuadStore,
Index,
NamedGraph,
Dataset,
Transaction
};
QueryEntity := {
SemanticQuery,
TriplePattern,
GraphPattern,
Filter,
PathQuery,
QueryResult
};
SemanticDatabase STORES SemanticStatement;
Entity INSTANCE_OF Class;
Entity HAS Property;
Entity RELATES_TO OtherEntity;
Ontology DEFINES ClassesAndProperties;
KnowledgeGraph ORGANISES SemanticStatements;
Index ACCELERATES Retrieval;
Query MATCHES SemanticPatterns;
Reasoner MAY_DERIVE NewStatements;
SemanticDatabaseFlow :=
SourceData
-> ParseAndNormalise
-> IdentifyEntities
-> ResolveIdentifiers
-> MapToOntology
-> ConstructSemanticStatements
-> ValidateConstraints
-> StoreGraphOrTriples
-> BuildIndexes
-> ApplyReasoning
-> ExecuteSemanticQueries
-> ReturnLinkedKnowledge
-> UpdateDatabase;
SemanticStatement :=
Subject
+ Predicate
+ Object;
Triple :=
(Subject, Predicate, Object);
Quad :=
(Subject, Predicate, Object, GraphOrContext);
Quad MAY_PRESERVE {
Source,
NamedGraph,
Context,
Provenance
};
Entity :=
IdentifiableThingRepresentedInDatabase;
Entity MAY_BE {
Physical,
Digital,
Abstract,
Event,
Agent,
Place
};
Class :=
SemanticCategoryOfEntities;
Instance :=
EntityBelongingToClass;
IF EntityX INSTANCE_OF ClassA
AND ClassA SUBCLASS_OF ClassB
THEN EntityX MAY_BE_INFERRED_AS INSTANCE_OF ClassB;
Property :=
TypedSemanticAttributeOrRelation;
Property MAY_BE {
DatatypeProperty,
ObjectProperty,
AnnotationProperty
};
Relationship :=
TypedAssociationBetweenSemanticResources;
Relationship MAY_HAVE {
Direction,
Domain,
Range,
Context,
Provenance
};
Literal :=
DataValueSuchAsStringNumberDateOrBoolean;
SemanticIdentifier :=
StableReferenceToResource;
Identifier MAY_BE {
URI,
IRI,
CanonicalIdentifier,
InternalKey
};
Ontology :=
FormalOrSemiFormalDefinitionOfConceptsPropertiesRelationshipsAndConstraints;
Ontology PROVIDES SemanticSchemaForDatabase;
KnowledgeGraph :=
GraphOfEntitiesAndTypedRelationships;
SemanticDatabase MAY_STORE OneOrMoreKnowledgeGraphs;
TripleStore :=
DatabaseOptimisedForStorageAndQueryOfSubjectPredicateObjectStatements;
QuadStore :=
TripleStoreExtendedWithGraphOrContextComponent;
GraphDatabase :=
DatabaseRepresentingDataAsNodesAndEdges;
SemanticDatabase MAY_BE_IMPLEMENTED_USING GraphDatabase;
GraphDatabase != SemanticDatabaseUnlessMeaningAndTypedSemanticsAreExplicitlyRepresented;
RDF :=
GraphDataModelForSemanticStatements;
RDFTriple :=
Subject
-> Predicate
-> Object;
RDFS MAY_DEFINE {
Class,
SubClassOf,
Property,
Domain,
Range
};
OWL MAY_DEFINE {
Equivalence,
Disjointness,
Restrictions,
PropertyCharacteristics
};
NamedGraph :=
IdentifiedSetOfSemanticStatements;
NamedGraph MAY_REPRESENT {
Source,
Dataset,
Tenant,
Context,
Version
};
SemanticSchema :=
DefinitionOfExpectedEntityTypesPropertiesRelationshipsAndConstraints;
SemanticShape :=
ConstraintDefinitionForGraphData;
SemanticValidation :=
CompareStoredOrIncomingGraphAgainstConstraints;
IF CriticalConstraintFails
THEN Ingestion MAY_BE RejectedOrFlagged;
SemanticIngestion :=
SourceRecordOrDocument
-> Parse
-> MapFields
-> ResolveEntities
-> GenerateStatements
-> Validate
-> Persist;
SemanticETL :=
Extract
-> TransformIntoSemanticModel
-> LoadIntoSemanticDatabase;
EntityResolution :=
DetermineWhetherIncomingResourceMatchesExistingCanonicalEntity;
Resolution MAY_USE {
Identifier,
Name,
Attributes,
Relationships,
Context
};
IF IncomingEntityMatchesCanonicalEntityWithSufficientEvidence
THEN Statements MAY_BE AttachedToExistingEntity;
IF EvidenceInsufficient
THEN PreserveSeparateEntityUntilResolved;
OntologyMapping :=
SourceFieldOrConcept
-> SemanticPropertyOrClass;
SemanticIntegration :=
MultipleHeterogeneousSources
-> MapToSharedSemanticModel
-> ResolveIdentity
-> LinkStatements
-> PreserveProvenance;
Provenance :=
OriginAndDerivationOfStoredStatement;
Statement MAY_HAVE {
Source,
Timestamp,
ImportProcess,
Confidence,
Version
};
SemanticDatabaseIndex MAY_INCLUDE {
SubjectIndex,
PredicateIndex,
ObjectIndex,
FullTextIndex,
EntityIndex,
VectorIndex
};
IndexSelection DEPENDS_ON QueryWorkload;
TripleStore MAY_INDEX MultiplePermutationsOf {
Subject,
Predicate,
Object
};
SemanticDatabase MAY_INCLUDE FullTextIndexForLabelsDescriptionsAndLiterals;
SemanticDatabase MAY_STORE EmbeddingsOrConnectToVectorIndex;
VectorSearch MAY_SUPPORT SemanticSimilarityRetrieval;
VectorSimilarity != ExplicitGraphRelationship;
HybridSemanticDatabase :=
StructuredSemanticGraph
+ TextIndex
+ VectorIndex;
HybridSemanticDatabase MAY_SUPPORT {
ExactQuery,
GraphTraversal,
SemanticSimilarity
};
SemanticQuery :=
RequestForKnowledgeBasedOnEntitiesPropertiesRelationshipsOrPatterns;
TriplePattern :=
(SubjectPattern, PredicatePattern, ObjectPattern);
GraphPattern :=
SET_OF TriplePatternsWhoseVariableBindingsMustBeCompatible;
SPARQL :=
QueryLanguageForRDFDatasets;
SPARQLQuery MAY_USE {
SELECT,
ASK,
CONSTRUCT,
DESCRIBE
};
QueryFilter MAY_RESTRICT ResultsBy {
Value,
Datatype,
Language,
NumericRange,
Date
};
PropertyPath :=
SequenceOrExpressionOfPredicatesUsedToTraverseGraph;
Traversal :=
StartEntity
-> FollowTypedEdges
-> ReachRelatedEntities;
SemanticDatabase MAY_SUPPORT MaterialisedOrQueryTimeInference;
Inference :=
ExplicitStatements
+ OntologyOrRules
-> DerivedStatements;
MaterialisedInference :=
ComputeDerivedStatements
-> StoreDerivedStatements;
QueryTimeInference :=
DeriveRequiredKnowledgeDuringQueryEvaluation;
Rule :=
PremisePattern
-> ConclusionPattern;
IF PropertyP IS_TRANSITIVE
AND A P B
AND B P C
THEN A P C;
IF PropertyP INVERSE_OF PropertyQ
AND A P B
THEN B Q A;
SemanticDatabase MAY_USE OpenWorldAssumption;
MissingStatement DOES_NOT_AUTOMATICALLY_MEAN False;
Application MAY_APPLY ClosedWorldAssumptionForSpecificValidationOrBusinessRules;
SemanticDatabaseTransaction :=
AtomicUnitOfDatabaseChange;
Transaction MAY_INCLUDE {
Insert,
Delete,
Update
};
Database MAY_SUPPORT {
Atomicity,
Consistency,
Isolation,
Durability
};
InsertStatement :=
AddSemanticStatementToGraphOrDataset;
DeleteStatement :=
RemoveExplicitStatement;
DeletingExplicitStatement MAY_AFFECT DerivedStatements;
SemanticUpdate :=
DeleteOldKnowledge
+ InsertNewKnowledge
+ RecomputeAffectedInference;
SemanticDatabase MAY_VERSION {
Ontology,
Dataset,
Graph,
Statement
};
TemporalSemanticDatabase MAY_STORE {
ValidTime,
TransactionTime,
ObservationTime
};
LogicalConsistency :=
NoContradictionUnderSelectedFormalSemantics;
MultipleSources MAY_ASSERT ConflictingFacts;
ConflictPolicy MAY {
PreserveBoth,
RankSources,
SelectPreferred,
FlagReview
};
Statement MAY_HAVE Confidence;
SemanticAccessControl MAY_APPLY_TO {
Dataset,
Graph,
Entity,
Property,
Statement
};
Tenant MAY_HAVE IsolatedNamedGraphOrDataset;
TenantIsolation SHOULD_PREVENT CrossTenantDataExposure;
SemanticDatabaseSecurity MAY_INCLUDE {
Authentication,
Authorisation,
Encryption,
QueryValidation,
Audit,
Backup
};
GraphRelationships MAY_REVEAL SensitiveInformationThroughInference;
PrivacyPolicy SHOULD_CONSIDER ExplicitAndDerivedKnowledge;
SemanticBackup MAY_INCLUDE {
ExplicitStatements,
Ontology,
IndexMetadata,
Provenance,
Configuration
};
SemanticDatabase MAY_REPLICATE DataForAvailabilityAndReadScale;
LargeSemanticGraph MAY_BE PartitionedAcrossShards;
ShardStrategy MAY_USE {
Entity,
Graph,
Predicate,
Hash,
Domain
};
CrossShardTraversal MAY_INCREASE QueryCost;
SemanticQueryCache MAY_STORE {
QueryResult,
EntityLookup,
InferenceResult
};
SemanticDatabasePerformance MAY_BE_MEASURED_BY {
QueryLatency,
QueryThroughput,
IngestRate,
StorageUse,
TraversalCost,
InferenceCost
};
QueryPlanner MAY_REORDER GraphPatternsToReduceIntermediateResults;
CardinalityEstimate :=
PredictedNumberOfMatchesForPattern;
FederatedSemanticQuery :=
QueryAcrossMultipleSemanticDataSources;
Federation MAY_REQUIRE {
EndpointDiscovery,
VocabularyMapping,
ResultMerge
};
SemanticDatabase MAY_LINK_TO ExternalResourcesUsingStableIdentifiers;
AI MAY_USE SemanticDatabaseFor {
KnowledgeRetrieval,
Reasoning,
Planning,
Explainability,
RAG
};
SemanticDatabase MAY_SERVE_AS RetrievalSourceForRetrievalAugmentedGeneration;
RAG MAY_RETRIEVE {
Entities,
Facts,
Paths,
Passages
};
SemanticSearch MAY_QUERY SemanticDatabaseUsingMeaningEntitiesAndRelationships;
DerivedFact MAY_HAVE ExplanationPath;
Explanation MAY_INCLUDE {
ExplicitFacts,
Rules,
OntologyRelationships,
Provenance
};
# ---------- SEMANTIC REASONING ----------
IF DatabaseStoresExplicitTypedEntitiesAndRelationships
AND SupportsMeaningAwareOperations
THEN SemanticDatabaseClassification := supported;
IF EntityResolutionConfirmsIdentity
THEN IncomingStatements MAY_BE LinkedToCanonicalEntity;
IF ClassA SUBCLASS_OF ClassB
AND x INSTANCE_OF ClassA
THEN x INSTANCE_OF ClassB MAY_BE Derived;
IF ExplicitStatementDeleted
THEN DependentDerivedStatements MAY_REQUIRE Recalculation;
IF QueryTraversesManyCrossShardEdges
THEN QueryLatency MAY_INCREASE;
IF AccessDeniedToStatement
THEN Query MUST_NOT ExposeProtectedKnowledgeAccordingToPolicy;
IF ConflictingSourcesExist
THEN PreserveProvenance
AND ReassessConfidence;
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE {
"semantic database" ~= "meaning-aware database";
"semantic data store" ~= "semantic database";
"triple store" ~= "RDF triple store" WHEN context == RDF;
"quad store" ~= "RDF quad store" WHEN context == RDF;
"knowledge graph database" ~= "semantic graph database" WHEN typed_semantics_present;
"semantic query" ~= "meaning-aware structured query";
"graph reasoning" ~= "semantic graph inference";
"semantic integration" ~= "ontology-based data integration";
}
# ---------- QUERY FLOW ----------
QUERY(q) ->
NORMALISE(q) ->
IDENTIFY_QUERY_ENTITIES(q) ->
MAP_QUERY_TO_ONTOLOGY(q) ->
BUILD_GRAPH_PATTERNS(q) ->
APPLY_ACCESS_CONTROL(q) ->
SELECT_INDEXES_AND_PLAN(q) ->
EXECUTE_GRAPH_QUERY(q) ->
APPLY_INFERENCE(q) ->
VALIDATE_AND_FILTER_RESULTS(q) ->
ATTACH_PROVENANCE(q) ->
SCORE_CONFIDENCE(q) ->
RETURN_SEMANTIC_RESULTS;
# ---------- CONFIDENCE ----------
CONFIDENCE(assertion) :=
weighted_mean(
source_reliability,
semantic_consistency,
entity_resolution_strength,
schema_validation,
provenance_quality,
contextual_relevance
);
CONFIDENCE >= 0.90 => HIGH;
CONFIDENCE >= 0.70 AND < 0.90 => MODERATE;
CONFIDENCE < 0.70 => REVIEW;
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION {
primary_entity: SemanticDatabase;
ontology: SemanticDatabaseOntology;
parse_entities: true;
parse_relationships: true;
preserve_relationship_direction: true;
resolve_semantic_equivalence: true;
execute_reasoning_rules: true;
apply_confidence_weighting: true;
preserve_provenance: true;
}
# ---------- UPDATE MODEL ----------
UPDATE_MODEL {
new_statement:
validate_terms
-> resolve_entities
-> attach_graph
-> attach_provenance
-> store
-> update_indexes
-> integrate;
new_entity:
resolve_identifier
-> classify
-> attach_properties
-> link_relationships
-> integrate;
new_ontology_version:
validate
-> update_schema
-> identify_affected_statements
-> recompute_inference
-> integrate;
database_revision:
preserve_transaction_history
-> update_explicit_knowledge
-> update_indexes
-> recompute_derived_knowledge
-> recompute_confidence
-> regenerate_flow_hash;
conflict:
preserve_provenance
-> compare_sources
-> adjust_confidence
-> flag_review;
}
# ---------- FLOW HASH ----------
FLOW_HASH_INPUT :=
DOMAIN
+ SUBDOMAIN
+ ONTOLOGY
+ DatabaseEntity
+ KnowledgeEntity
+ StorageEntity
+ QueryEntity
+ SemanticStatement
+ SemanticIntegration
+ SemanticQuery
+ RELATIONSHIPS
+ SEMANTIC_REASONING
+ SEMANTIC_EQUIVALENCE
+ UPDATE_MODEL;
FLOW_HASH :=
HASH(FLOW_HASH_INPUT);
# ---------- TERMINAL ----------
SemanticDatabaseOntology
-> ReceiveSourceData
-> ResolveEntitiesAndIdentifiers
-> MapDataToOntology
-> ConstructTypedSemanticStatements
-> ValidateSchemaAndConstraints
-> StoreGraphTriplesAndProvenance
-> BuildSemanticIndexes
-> ApplyRulesAndInference
-> ExecuteGraphAndMeaningAwareQueries
-> EnforceSecurityAndAccessPolicies
-> PreserveContextConfidenceAndProvenance
-> UpdateExplicitAndDerivedKnowledge
-> MaintainMachineInterpretableSemanticData;
END FLOW
Download Code
Copy to Clipboard