From 47ff3cef65209c99de8bdbb6ec2238753c6facca Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Tue, 14 May 2024 11:27:19 +0000 Subject: [PATCH] build based on d0257d6 --- dev/.documenter-siteinfo.json | 2 +- dev/api/BitemporalPostgres.DDL/index.html | 2 +- dev/api/BitemporalPostgres/index.html | 10 +++++----- dev/api/theory/index.html | 2 +- dev/index.html | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index bfb6c87..4e13d9e 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-14T09:55:44","documenter_version":"1.4.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-14T11:27:15","documenter_version":"1.4.1"}} \ No newline at end of file diff --git a/dev/api/BitemporalPostgres.DDL/index.html b/dev/api/BitemporalPostgres.DDL/index.html index cf05e97..cc2cb4f 100644 --- a/dev/api/BitemporalPostgres.DDL/index.html +++ b/dev/api/BitemporalPostgres.DDL/index.html @@ -1,2 +1,2 @@ -DDL · BitemporalPostgres

BitemporalPostgres.DDL.jl

BitemporalPostgres.DDL.create_versions_triggerMethod

createversionstrigger() propagate skalars refvalidfrom and refinvalidfrom to range ref_valid skalars are needed enable foreign key constraints, which in POSTGRES cannot be declared onto bounds of intervals directly.

source
BitemporalPostgres.DDL.downMethod

down() callback from SearchLight.Migrations.down tearing down the Database Schema for bitemproal Transactions including test dummy tables

source
BitemporalPostgres.DDL.upMethod

up() callback from SearchLight.Migrations.up creating the Database Schema for bitemporal Transactions including test dummy tables

source
+DDL · BitemporalPostgres

BitemporalPostgres.DDL.jl

BitemporalPostgres.DDL.create_versions_triggerMethod

createversionstrigger() propagate skalars refvalidfrom and refinvalidfrom to range ref_valid skalars are needed enable foreign key constraints, which in POSTGRES cannot be declared onto bounds of intervals directly.

source
BitemporalPostgres.DDL.downMethod

down() callback from SearchLight.Migrations.down tearing down the Database Schema for bitemproal Transactions including test dummy tables

source
BitemporalPostgres.DDL.upMethod

up() callback from SearchLight.Migrations.up creating the Database Schema for bitemporal Transactions including test dummy tables

source
diff --git a/dev/api/BitemporalPostgres/index.html b/dev/api/BitemporalPostgres/index.html index 64741cb..8ad4865 100644 --- a/dev/api/BitemporalPostgres/index.html +++ b/dev/api/BitemporalPostgres/index.html @@ -1,11 +1,11 @@ -BitemporalPostgres · BitemporalPostgres

BitemporalPostgres.jl

BitemporalPostgres.ComponentType

Component

an abstract component of a bitemporal entity i.e. a contract, a reference to a partner a component's history of states is represented by its revisions

source
BitemporalPostgres.ValidityIntervalType

ValidityInterval

a 2-dimensional interval of validity of a version with respect to the state

  • of the data base storage and
  • of the world

See the theory page for background

source
BitemporalPostgres.WorkflowType

Workflow Holds application based transaction data.

  • current version
  • world validFrom date
  • db validfrom date
  • is_committed means: bitemporal transaction is
    • pending: 0
    • committed: 1
    • rolled back: 2
source
BitemporalPostgres.commit_workflow!Method

commitworkflow!(w::Workflow) commits the bitemporal transaction identified by refversion begun with the creation of w

  • sets w's version's validityInterval to is_committed
  • ends all overlapping intervals to tsdbinvalidfrom w.tsdbvalidfrom
  • creates a new interval for the non_overlapping part of a partially interval if any
source
BitemporalPostgres.create_entity!Method

create_entity!(w::Workflow)

  • opens a bitemporal transaction identified by ref_version
  • persists a history, version, validityInterval and a Workflow
  • requires: w.tsw_validfrom is a valid date
source
BitemporalPostgres.delete_component!Method

delete_component!(c::T, w::Workflow) where {T<:Component}

  • deletes a component if it was created for the current version or
  • mark its latest component revision as invalid
source
BitemporalPostgres.delete_component!Method

delete_component!(r::T, w::Workflow) where {T<:ComponentRevision}

  • deletes a component if it was created for the current version or
  • mark its latest component revision as invalid
source
BitemporalPostgres.findcomponentrevisionMethod

findcomponentrevision(t::Type{T},refcomponent::DbId,refversion::DbId,)::Vector{T} where {T<:ComponentRevision} retrieves the version_id of a bitemporal history asof tsdb as per tsw

source
BitemporalPostgres.findversionFunction

findversion(refhistory::DbId, tsdb::ZonedDateTime, tsw::ZonedDateTime, committed::Integer=1)::DbId retrieves the versionid of a bitemporal history asof tsdb as per tsw

source
BitemporalPostgres.get_revisionMethod

get_revision(ctype::Type{CT}, rtype::Type{RT}, hid::DbId, vid::DbId) where {CT<:Component,RT<:ComponentRevision}

retrieves the revision of the unique component of type CT in history hid as of version vid 
-the revision must exist
source
BitemporalPostgres.get_revisionMethod

get_revision(rtype::Type{RT}, cid::DbId, vid::DbId) where {RT<:ComponentRevision}

retrieves the revision of component cid as of version vid 
-the revision must exist
source
BitemporalPostgres.get_revisionIfAnyMethod

function get_revisionIfAny( ctype::Type{CT}, rtype::Type{RT}, hid::DbId, vid::DbId, )::Vector{RT} where {CT<:Component,RT<:ComponentRevision} retrieves the revision of the unique component of type CT in history hid if one exists as of version vid

An optional (unique) component may have a revision for a version later as vid. In such cases a component w/o valid revision is itself valid, just to be ignored for the current version.
source
BitemporalPostgres.get_revisionIfAnyMethod

function get_revisionIfAny(rtype::Type{RT}, hid::DbId, vid::DbId, )::Vector{RT} where {RT<:ComponentRevision} retrieves the revision of component cid if one exists as of version vid

An optional component may have a revision for a version later as vid. In such cases a component w/o valid revision is itself valid, just to be ignored for the current version.
source
BitemporalPostgres.get_typeof_componentMethod

gettypeofcomponent(component::T)::Type{R} where {T<:ComponentRevision,R<:Component} returns the actual subtype of Component that fits the actual type of ComponentRevision

source
BitemporalPostgres.get_typeof_revisionMethod

gettypeofrevision(component::T)::Type{R} where {T<:Component,R<:ComponentRevision} returns the actual subtype of ComponentRevision that fits the actual type of Component

source
BitemporalPostgres.mkforestMethod

mkforest(hid::DbId)::Vector{Node}

builds a forest of version nodes where
+BitemporalPostgres · BitemporalPostgres

BitemporalPostgres.jl

BitemporalPostgres.ComponentType

Component

an abstract component of a bitemporal entity i.e. a contract, a reference to a partner a component's history of states is represented by its revisions

source
BitemporalPostgres.ValidityIntervalType

ValidityInterval

a 2-dimensional interval of validity of a version with respect to the state

  • of the data base storage and
  • of the world

See the theory page for background

source
BitemporalPostgres.WorkflowType

Workflow Holds application based transaction data.

  • current version
  • world validFrom date
  • db validfrom date
  • is_committed means: bitemporal transaction is
    • pending: 0
    • committed: 1
    • rolled back: 2
source
BitemporalPostgres.commit_workflow!Method

commitworkflow!(w::Workflow) commits the bitemporal transaction identified by refversion begun with the creation of w

  • sets w's version's validityInterval to is_committed
  • ends all overlapping intervals to tsdbinvalidfrom w.tsdbvalidfrom
  • creates a new interval for the non_overlapping part of a partially interval if any
source
BitemporalPostgres.create_entity!Method

create_entity!(w::Workflow)

  • opens a bitemporal transaction identified by ref_version
  • persists a history, version, validityInterval and a Workflow
  • requires: w.tsw_validfrom is a valid date
source
BitemporalPostgres.delete_component!Method

delete_component!(c::T, w::Workflow) where {T<:Component}

  • deletes a component if it was created for the current version or
  • mark its latest component revision as invalid
source
BitemporalPostgres.delete_component!Method

delete_component!(r::T, w::Workflow) where {T<:ComponentRevision}

  • deletes a component if it was created for the current version or
  • mark its latest component revision as invalid
source
BitemporalPostgres.findcomponentrevisionMethod

findcomponentrevision(t::Type{T},refcomponent::DbId,refversion::DbId,)::Vector{T} where {T<:ComponentRevision} retrieves the version_id of a bitemporal history asof tsdb as per tsw

source
BitemporalPostgres.findversionFunction

findversion(refhistory::DbId, tsdb::ZonedDateTime, tsw::ZonedDateTime, committed::Integer=1)::DbId retrieves the versionid of a bitemporal history asof tsdb as per tsw

source
BitemporalPostgres.get_revisionMethod

get_revision(ctype::Type{CT}, rtype::Type{RT}, hid::DbId, vid::DbId) where {CT<:Component,RT<:ComponentRevision}

retrieves the revision of the unique component of type CT in history hid as of version vid 
+the revision must exist
source
BitemporalPostgres.get_revisionMethod

get_revision(rtype::Type{RT}, cid::DbId, vid::DbId) where {RT<:ComponentRevision}

retrieves the revision of component cid as of version vid 
+the revision must exist
source
BitemporalPostgres.get_revisionIfAnyMethod

function get_revisionIfAny( ctype::Type{CT}, rtype::Type{RT}, hid::DbId, vid::DbId, )::Vector{RT} where {CT<:Component,RT<:ComponentRevision} retrieves the revision of the unique component of type CT in history hid if one exists as of version vid

An optional (unique) component may have a revision for a version later as vid. In such cases a component w/o valid revision is itself valid, just to be ignored for the current version.
source
BitemporalPostgres.get_revisionIfAnyMethod

function get_revisionIfAny(rtype::Type{RT}, hid::DbId, vid::DbId, )::Vector{RT} where {RT<:ComponentRevision} retrieves the revision of component cid if one exists as of version vid

An optional component may have a revision for a version later as vid. In such cases a component w/o valid revision is itself valid, just to be ignored for the current version.
source
BitemporalPostgres.get_typeof_componentMethod

gettypeofcomponent(component::T)::Type{R} where {T<:ComponentRevision,R<:Component} returns the actual subtype of Component that fits the actual type of ComponentRevision

source
BitemporalPostgres.get_typeof_revisionMethod

gettypeofrevision(component::T)::Type{R} where {T<:Component,R<:ComponentRevision} returns the actual subtype of ComponentRevision that fits the actual type of Component

source
BitemporalPostgres.mkforestMethod

mkforest(hid::DbId)::Vector{Node}

builds a forest of version nodes where
 * eventual child node vectors denote mutations which have been retrospectively corrected by their predecessor
 
 
-see: Theory: Textual representation of mutation histories
source
BitemporalPostgres.mktreeMethod

function mktree(version::Integer, vidsDict::Dict{Integer,Integer}, treeDict::Dict{Integer,Vector{Integer}})::BitemporalPostgres.Node

builds a tree of versipon nodes with child node vectors denoting
+see: Theory: Textual representation of mutation histories
source
BitemporalPostgres.mktreeMethod

function mktree(version::Integer, vidsDict::Dict{Integer,Integer}, treeDict::Dict{Integer,Vector{Integer}})::BitemporalPostgres.Node

builds a tree of versipon nodes with child node vectors denoting
 mutations which have been retrospectively corrected by their parent = predecessor
 
-see: Theory: Textual representation of mutation histories
source
BitemporalPostgres.update_entity!Method

update_entity!(w::Workflow)

  • opens a bitemporal transaction identified by ref_version
  • persists a version, a validityInterval and a Workflow
  • For retrospective transactions
    • preliminarily invalidates all insertions and mutations from shadowed versions
    • preliminarily revives all revisions invalidated by shadowed versions
  • requires:
    • w.tsw_validfrom is a valid date
    • w.ref_history is a valid history id
    • w.refversion is a valid version of w.refhistory
source
+see: Theory: Textual representation of mutation histories
source
BitemporalPostgres.update_entity!Method

update_entity!(w::Workflow)

  • opens a bitemporal transaction identified by ref_version
  • persists a version, a validityInterval and a Workflow
  • For retrospective transactions
    • preliminarily invalidates all insertions and mutations from shadowed versions
    • preliminarily revives all revisions invalidated by shadowed versions
  • requires:
    • w.tsw_validfrom is a valid date
    • w.ref_history is a valid history id
    • w.refversion is a valid version of w.refhistory
source
diff --git a/dev/api/theory/index.html b/dev/api/theory/index.html index 0d682a3..02b1bfd 100644 --- a/dev/api/theory/index.html +++ b/dev/api/theory/index.html @@ -51,4 +51,4 @@ JOIN PART_REVISION r ON r.ref_PART = p.id AND r.validity_range @> v.id WHERE h.id = :history_id and p.id = :part_id AND i.tsr_world @> TIMESTAMPTZ:ts_world and i.tsr_db @> TIMESTAMPTZ :ts_db

POSTGRES also provides uniqueness constraints for GIST-indices, so that we can guarantee for every history, that its versions validity_intervals are unique, that is non overlapping. Inserting an overlapping interval fails constraint violation exception.

ADD CONSTRAINT bitemp EXCLUDE USING GIST (ref_version WITH =, is_committed WITH =, tsrworld WITH &&, tsrdb WITH &&)`
-

A first sketch of a bitemporal UML model for insurance contracts

UML Model

Please compare: https://hdombrovskaya.wordpress.com/2019/07/14/lets-go-bitemporal/ https://www.postgresql.eu/events/pgdayparis2019/sessions/session/2291/slides/171/pgdayparis2019msedivy_bitemporality.pdf

+

A first sketch of a bitemporal UML model for insurance contracts

UML Model

Please compare: https://hdombrovskaya.wordpress.com/2019/07/14/lets-go-bitemporal/ https://www.postgresql.eu/events/pgdayparis2019/sessions/session/2291/slides/171/pgdayparis2019msedivy_bitemporality.pdf

diff --git a/dev/index.html b/dev/index.html index 7cafe4a..37565a6 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · BitemporalPostgres

BitemporalPostgres.jl

BitemporalPostgres provides an API for application based bitemporal transactions. These are "long" transactions, with persistent transaction data that is, so they serve as basis of workflow management.

For theory behind this, see the theory page.

Index

+Home · BitemporalPostgres

BitemporalPostgres.jl

BitemporalPostgres provides an API for application based bitemporal transactions. These are "long" transactions, with persistent transaction data that is, so they serve as basis of workflow management.

For theory behind this, see the theory page.

Index