knowledge: conflict taxonomy at merge (phase 1, RESEARCH-derived-answers Part 1)
The four-case classifier conflated conjunction, paraphrase and polisèmia
into "contradiction" — the live KG after one Pedro run held 20 conflict
pairs, ZERO real ones. The taxonomy (deterministic, cost-ordered):
co-asserted same quote_id — one trusted sentence asserts both values
(the platform sentence split into 5 "called for" facts)
paraphrase tails resolve to the same node — the same fact in two
surfaces: MERGE (same_as alias, append-only; the canonical
edge's corroboration goes up, no conflict row)
alternatives entity-ish values, different tails — co-true readings of a
multi-valued relation (THE three presidencies). New table
+ alternatives_of(src, rel): the ambiguity substrate,
detected at INGEST, deterministically — the audit no
longer needs to re-derive it at judge time
temporal both dated — unchanged
contradiction the residue: functional values (dates/quantities —
_looks_functional: numbers with at most unit/month words;
pure entity words are readings, not data)
Files: store.py (_classify 4->7 cases, migrations for alternatives +
same_as, alternatives_of), tests taxonomy.py (6/6: the 20-pair inventory
as fixtures), store.py test updated to the new law (different quotes for
the contradiction pair — same-quote is co-asserted by law).
Known scope notes: same_as is recorded but not yet consumed by the
probe/render (phase 4); the three-presidencies-in-one-sentence shape
stays conjunction (the live readings came from different quotes).
This commit is contained in:
@@ -73,11 +73,16 @@ def test_store_four_cases(tmp="/tmp/floop_kg_test.sqlite"):
|
||||
assert a and b
|
||||
conflicts = ks.db.execute("SELECT COUNT(*) FROM conflicts").fetchone()[0]
|
||||
assert conflicts == 0, "dated different values are a time series, not a conflict"
|
||||
# contradiction: same rel, undated different values -> exposed conflict
|
||||
c1 = ks.add_edge("Seine", "length_km", "777", q1)
|
||||
c2 = ks.add_edge("Seine", "length_km", "776", q1)
|
||||
# contradiction: same rel, undated different FUNCTIONAL values -> exposed conflict
|
||||
# (phase 1 taxonomy: entity-ish pairs are alternatives; numeric/date
|
||||
# values on a functional relation keep the contradiction. Different
|
||||
# quotes — same-quote pairs are co-asserted conjunction, by law.)
|
||||
qc1 = ks.add_quote(doc, "The Seine is 777 kilometres long.", "url", "d")
|
||||
qc2 = ks.add_quote(doc, "One source lists the Seine at 776 kilometres.", "url", "d")
|
||||
c1 = ks.add_edge("Seine", "length_km", "777", qc1)
|
||||
c2 = ks.add_edge("Seine", "length_km", "776", qc2)
|
||||
conflicts = ks.db.execute("SELECT COUNT(*) FROM conflicts").fetchone()[0]
|
||||
assert conflicts == 1, "undated different values must be exposed as conflict"
|
||||
assert conflicts == 1, "undated different functional values must be exposed as conflict"
|
||||
# probe: seeds find edges with quotes
|
||||
rows = ks.probe(["Loire", "loire"])
|
||||
assert any(r.rel == "longest_river_of" and r.dst == "France" for r in rows)
|
||||
|
||||
Reference in New Issue
Block a user