causalontology 2.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +56 -14
- data/conformance.rb +503 -11
- data/lib/causalontology/canonical.rb +14 -4
- data/lib/causalontology/schema.rb +14 -1
- data/lib/causalontology/semantics.rb +161 -16
- data/lib/causalontology/spec/schema/assertion.schema.json +75 -0
- data/lib/causalontology/spec/schema/attitude.schema.json +45 -0
- data/lib/causalontology/spec/schema/bridge.schema.json +46 -0
- data/lib/causalontology/spec/schema/causal_relation_object.schema.json +111 -0
- data/lib/causalontology/spec/schema/conduit.schema.json +56 -0
- data/lib/causalontology/spec/schema/continuant.schema.json +38 -0
- data/lib/causalontology/spec/schema/cross_stratal_seam.schema.json +50 -0
- data/lib/causalontology/spec/schema/enrichment.schema.json +80 -0
- data/lib/causalontology/spec/schema/individual.schema.json +36 -0
- data/lib/causalontology/spec/schema/occurrent.schema.json +42 -0
- data/lib/causalontology/spec/schema/port.schema.json +56 -0
- data/lib/causalontology/spec/schema/predicted_occurrence.schema.json +68 -0
- data/lib/causalontology/spec/schema/prediction_error.schema.json +37 -0
- data/lib/causalontology/spec/schema/quality.schema.json +44 -0
- data/lib/causalontology/spec/schema/realizable.schema.json +38 -0
- data/lib/causalontology/spec/schema/retraction.schema.json +43 -0
- data/lib/causalontology/spec/schema/state.schema.json +89 -0
- data/lib/causalontology/spec/schema/stratum.schema.json +52 -0
- data/lib/causalontology/spec/schema/succession.schema.json +39 -0
- data/lib/causalontology/spec/schema/token.schema.json +96 -0
- data/lib/causalontology/spec/schema/token_causal_claim.schema.json +76 -0
- data/lib/causalontology/store.rb +5 -2
- data/lib/causalontology.rb +17 -1
- metadata +23 -2
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://causalontology.org/schema/stratum.schema.json",
|
|
4
|
+
"title": "Stratum",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"id",
|
|
8
|
+
"type",
|
|
9
|
+
"label",
|
|
10
|
+
"scheme",
|
|
11
|
+
"ordinal"
|
|
12
|
+
],
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"properties": {
|
|
15
|
+
"id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^stratum:[0-9a-f]{64}$"
|
|
18
|
+
},
|
|
19
|
+
"type": {
|
|
20
|
+
"const": "stratum"
|
|
21
|
+
},
|
|
22
|
+
"label": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"minLength": 1,
|
|
25
|
+
"pattern": "^[a-z][a-z0-9_]*$",
|
|
26
|
+
"description": "canonical label, snake_case, English (for example: cellular, macromolecular)"
|
|
27
|
+
},
|
|
28
|
+
"scheme": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"minLength": 1,
|
|
31
|
+
"pattern": "^[a-z][a-z0-9_]*$",
|
|
32
|
+
"description": "the stratification scheme this stratum belongs to; strata are comparable only within a scheme"
|
|
33
|
+
},
|
|
34
|
+
"ordinal": {
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"description": "position within the scheme; STRICTLY LOWER IS FINER-GRAINED; need not be contiguous"
|
|
37
|
+
},
|
|
38
|
+
"unit": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"pattern": "^[a-z][a-z0-9_]*$",
|
|
41
|
+
"description": "the principal unit of analysis at this stratum (for example: cell, synapse, region)"
|
|
42
|
+
},
|
|
43
|
+
"governs": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"pattern": "^[a-z][a-z0-9_]*$"
|
|
48
|
+
},
|
|
49
|
+
"description": "the governing frameworks or bodies of law at this stratum (for example: quantum_mechanics, cell_biology)"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://causalontology.org/schema/succession.schema.json",
|
|
4
|
+
"title": "Succession",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"id",
|
|
8
|
+
"predecessor",
|
|
9
|
+
"successor",
|
|
10
|
+
"timestamp"
|
|
11
|
+
],
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"properties": {
|
|
14
|
+
"id": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^succession:[0-9a-f]{64}$"
|
|
17
|
+
},
|
|
18
|
+
"type": {
|
|
19
|
+
"const": "succession"
|
|
20
|
+
},
|
|
21
|
+
"predecessor": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^ed25519:[0-9a-f]{64}$"
|
|
24
|
+
},
|
|
25
|
+
"successor": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"pattern": "^ed25519:[0-9a-f]{64}$"
|
|
28
|
+
},
|
|
29
|
+
"timestamp": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"format": "date-time"
|
|
32
|
+
},
|
|
33
|
+
"signature": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"pattern": "^[0-9a-f]{128}$",
|
|
36
|
+
"description": "signed by the PREDECESSOR key"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://causalontology.org/schema/token.schema.json",
|
|
4
|
+
"title": "Token Occurrence",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"id",
|
|
8
|
+
"type",
|
|
9
|
+
"instantiates",
|
|
10
|
+
"interval"
|
|
11
|
+
],
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"properties": {
|
|
14
|
+
"id": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^token_occurrence:[0-9a-f]{64}$"
|
|
17
|
+
},
|
|
18
|
+
"type": {
|
|
19
|
+
"const": "token_occurrence"
|
|
20
|
+
},
|
|
21
|
+
"instantiates": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^occurrent:[0-9a-f]{64}$",
|
|
24
|
+
"description": "the occurrent TYPE of which this is an instance; MANDATORY (P1)"
|
|
25
|
+
},
|
|
26
|
+
"interval": {
|
|
27
|
+
"$ref": "#/$defs/interval"
|
|
28
|
+
},
|
|
29
|
+
"participants": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"items": {
|
|
32
|
+
"$ref": "#/$defs/rolefill"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"locus": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"pattern": "^token_individual:[0-9a-f]{64}$",
|
|
38
|
+
"description": "optional: the particular place or bearer at which it occurred"
|
|
39
|
+
},
|
|
40
|
+
"observer": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"pattern": "^ed25519:[0-9a-f]{64}$",
|
|
43
|
+
"description": "optional: the source whose experience this token belongs to"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"$defs": {
|
|
47
|
+
"interval": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"required": [
|
|
50
|
+
"start"
|
|
51
|
+
],
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"properties": {
|
|
54
|
+
"start": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"format": "date-time",
|
|
57
|
+
"description": "RFC 3339, UTC, mandatory Z suffix"
|
|
58
|
+
},
|
|
59
|
+
"end": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"format": "date-time"
|
|
62
|
+
},
|
|
63
|
+
"open": {
|
|
64
|
+
"type": "boolean",
|
|
65
|
+
"description": "true asserts the occurrence had NOT ENDED as of this record"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"rolefill": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"required": [
|
|
72
|
+
"role",
|
|
73
|
+
"filler"
|
|
74
|
+
],
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"properties": {
|
|
77
|
+
"role": {
|
|
78
|
+
"enum": [
|
|
79
|
+
"agent",
|
|
80
|
+
"patient",
|
|
81
|
+
"instrument",
|
|
82
|
+
"recipient",
|
|
83
|
+
"source",
|
|
84
|
+
"destination",
|
|
85
|
+
"medium"
|
|
86
|
+
],
|
|
87
|
+
"description": "CLOSED enumeration; extending it is a MAJOR change"
|
|
88
|
+
},
|
|
89
|
+
"filler": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"pattern": "^token_individual:[0-9a-f]{64}$"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://causalontology.org/schema/token_causal_claim.schema.json",
|
|
4
|
+
"title": "Token Causal Claim",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"id",
|
|
8
|
+
"type",
|
|
9
|
+
"causes",
|
|
10
|
+
"effects"
|
|
11
|
+
],
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"properties": {
|
|
14
|
+
"id": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^token_causal_claim:[0-9a-f]{64}$"
|
|
17
|
+
},
|
|
18
|
+
"type": {
|
|
19
|
+
"const": "token_causal_claim"
|
|
20
|
+
},
|
|
21
|
+
"causes": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"minItems": 1,
|
|
24
|
+
"items": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"pattern": "^token_occurrence:[0-9a-f]{64}$"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"effects": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"minItems": 1,
|
|
32
|
+
"items": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"pattern": "^token_occurrence:[0-9a-f]{64}$"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"covering_law": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"pattern": "^causal_relation_object:[0-9a-f]{64}$",
|
|
40
|
+
"description": "OPTIONAL. The type-level Causal Relation Object this token claim instantiates."
|
|
41
|
+
},
|
|
42
|
+
"actual_delay": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"required": [
|
|
45
|
+
"duration",
|
|
46
|
+
"unit"
|
|
47
|
+
],
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"properties": {
|
|
50
|
+
"duration": {
|
|
51
|
+
"type": "number",
|
|
52
|
+
"minimum": 0
|
|
53
|
+
},
|
|
54
|
+
"unit": {
|
|
55
|
+
"enum": [
|
|
56
|
+
"instant",
|
|
57
|
+
"seconds",
|
|
58
|
+
"minutes",
|
|
59
|
+
"hours",
|
|
60
|
+
"days",
|
|
61
|
+
"weeks",
|
|
62
|
+
"months",
|
|
63
|
+
"years",
|
|
64
|
+
"ticks"
|
|
65
|
+
],
|
|
66
|
+
"description": "3.0.0: 'ticks' is a discrete, dimensionless ORDINAL unit; a tick-unit observed delay compares to a tick-unit covering-law window by integer, and never to a wall-clock window."
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"description": "the delay ACTUALLY OBSERVED on this occasion"
|
|
70
|
+
},
|
|
71
|
+
"counterfactual": {
|
|
72
|
+
"type": "boolean",
|
|
73
|
+
"description": "true asserts the BUT-FOR test for THIS OCCASION ONLY"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
data/lib/causalontology/store.rb
CHANGED
|
@@ -19,9 +19,12 @@ require_relative "signing"
|
|
|
19
19
|
|
|
20
20
|
module Causalontology
|
|
21
21
|
CONTENT_KINDS = Set.new(["occurrent", "causal_relation_object", "continuant",
|
|
22
|
-
"realizable", "stratum", "bridge",
|
|
22
|
+
"realizable", "stratum", "bridge",
|
|
23
|
+
"cross_stratal_seam", "port", "conduit",
|
|
23
24
|
"quality", "token_individual", "token_occurrence",
|
|
24
|
-
"state_assertion", "token_causal_claim"
|
|
25
|
+
"state_assertion", "token_causal_claim",
|
|
26
|
+
"attitude", "predicted_occurrence",
|
|
27
|
+
"prediction_error"]).freeze
|
|
25
28
|
RECORD_KINDS = Set.new(["assertion", "enrichment", "retraction", "succession"]).freeze
|
|
26
29
|
|
|
27
30
|
# An enforcing store refused a write, with the reason as the message.
|
data/lib/causalontology.rb
CHANGED
|
@@ -22,7 +22,7 @@ require_relative "causalontology/semantics"
|
|
|
22
22
|
require_relative "causalontology/store"
|
|
23
23
|
|
|
24
24
|
module Causalontology
|
|
25
|
-
VERSION = "
|
|
25
|
+
VERSION = "4.0.0" # specification 4.0.0 (attitude, predicted_occurrence, prediction_error)
|
|
26
26
|
|
|
27
27
|
# Rule 4's fixed unit-conversion constants, re-exported at the top level.
|
|
28
28
|
UNIT_SECONDS = Semantics::UNIT_SECONDS
|
|
@@ -107,6 +107,16 @@ module Causalontology
|
|
|
107
107
|
Semantics.bridge_wellformed(bridge, occ_map, stratum_map)
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
+
# -- 3.0.0 cross-stratal seam (spec/semantics.md, Rule 22 / Algorithm F) ----
|
|
111
|
+
|
|
112
|
+
def seam_wellformed(seam, occ_map, stratum_map)
|
|
113
|
+
Semantics.seam_wellformed(seam, occ_map, stratum_map)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def seam_home(seam, occ_map, stratum_map)
|
|
117
|
+
Semantics.seam_home(seam, occ_map, stratum_map)
|
|
118
|
+
end
|
|
119
|
+
|
|
110
120
|
def conduit_wellformed(conduit, port_map, cro_map = nil)
|
|
111
121
|
Semantics.conduit_wellformed(conduit, port_map, cro_map)
|
|
112
122
|
end
|
|
@@ -119,6 +129,12 @@ module Causalontology
|
|
|
119
129
|
Semantics.covering_law_mismatch(tcc, token_map, law)
|
|
120
130
|
end
|
|
121
131
|
|
|
132
|
+
# -- 4.0.0 prediction-to-observation pairing (Rule 24) ---------------------
|
|
133
|
+
|
|
134
|
+
def prediction_pairing_mismatch(error, predicted, observed)
|
|
135
|
+
Semantics.prediction_pairing_mismatch(error, predicted, observed)
|
|
136
|
+
end
|
|
137
|
+
|
|
122
138
|
def retrocausal(tcc, token_map)
|
|
123
139
|
Semantics.retrocausal(tcc, token_map)
|
|
124
140
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: causalontology
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- AI University (AIU)
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: 'The Ruby binding of the Causalontology standard - a verb-first noun-hosting
|
|
14
14
|
ontology; a programming-language-neutral standard and shared commons for reified
|
|
@@ -31,6 +31,27 @@ files:
|
|
|
31
31
|
- lib/causalontology/schema.rb
|
|
32
32
|
- lib/causalontology/semantics.rb
|
|
33
33
|
- lib/causalontology/signing.rb
|
|
34
|
+
- lib/causalontology/spec/schema/assertion.schema.json
|
|
35
|
+
- lib/causalontology/spec/schema/attitude.schema.json
|
|
36
|
+
- lib/causalontology/spec/schema/bridge.schema.json
|
|
37
|
+
- lib/causalontology/spec/schema/causal_relation_object.schema.json
|
|
38
|
+
- lib/causalontology/spec/schema/conduit.schema.json
|
|
39
|
+
- lib/causalontology/spec/schema/continuant.schema.json
|
|
40
|
+
- lib/causalontology/spec/schema/cross_stratal_seam.schema.json
|
|
41
|
+
- lib/causalontology/spec/schema/enrichment.schema.json
|
|
42
|
+
- lib/causalontology/spec/schema/individual.schema.json
|
|
43
|
+
- lib/causalontology/spec/schema/occurrent.schema.json
|
|
44
|
+
- lib/causalontology/spec/schema/port.schema.json
|
|
45
|
+
- lib/causalontology/spec/schema/predicted_occurrence.schema.json
|
|
46
|
+
- lib/causalontology/spec/schema/prediction_error.schema.json
|
|
47
|
+
- lib/causalontology/spec/schema/quality.schema.json
|
|
48
|
+
- lib/causalontology/spec/schema/realizable.schema.json
|
|
49
|
+
- lib/causalontology/spec/schema/retraction.schema.json
|
|
50
|
+
- lib/causalontology/spec/schema/state.schema.json
|
|
51
|
+
- lib/causalontology/spec/schema/stratum.schema.json
|
|
52
|
+
- lib/causalontology/spec/schema/succession.schema.json
|
|
53
|
+
- lib/causalontology/spec/schema/token.schema.json
|
|
54
|
+
- lib/causalontology/spec/schema/token_causal_claim.schema.json
|
|
34
55
|
- lib/causalontology/store.rb
|
|
35
56
|
homepage: https://github.com/ai-university-aiu/causalontology
|
|
36
57
|
licenses:
|