Adds co_occurs_with, temporally_precedes, possibly_caused_by and asserted_by to the relation vocabulary with Causal and Hypothetical predicates. Entities mentioned together now co-occur rather than being 'related'; association hypotheses record possibly_caused_by and their basis (temporal association only); caused_by is reserved for explicit operator statements and nothing automatic writes it. Documented in docs/graph.md and checked end to end.
18 lines
501 B
Go
18 lines
501 B
Go
package concepts
|
|
|
|
import "testing"
|
|
|
|
func TestRelationSemantics(t *testing.T) {
|
|
for _, r := range []Relation{CoOccursWith, PossiblyCausedBy, TemporallyPrecedes, AssertedBy, CausedBy} {
|
|
if !r.Valid() {
|
|
t.Fatalf("%s should be valid", r)
|
|
}
|
|
}
|
|
if !CausedBy.Causal() || PossiblyCausedBy.Causal() || CoOccursWith.Causal() {
|
|
t.Fatal("only caused_by asserts a cause")
|
|
}
|
|
if !PossiblyCausedBy.Hypothetical() || CausedBy.Hypothetical() {
|
|
t.Fatal("possibly_caused_by is the hypothetical form")
|
|
}
|
|
}
|