The library documents itself · Diagramming & graphs
stzKnowledgeGraph
47 own methods · 6 forms written with extensions, listed under their method · Also inherits from stzGraph (290)
also named: stzKnowGraph
the source: base/graph/stzKnowledgeGraph.ring(opens in a new tab) · All classes · The area reference: Diagramming & graphs
Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean
Examples: 3 come from the library's tests; 6 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzKnowledgeGraph("fluency-space"). 38 methods have none yet. Examples run on 2026-10-03 12:54 inside the library at commit 0e72e2e2c.
Method
Explanation, as the source carries it
init
(no comment in the source: the name reads as a sentence) initno extension
IsKnowledgeGraph
(no comment in the source: the name reads as a sentence) is knowledge graphno extension
IsAKnowledgeGraph
(no comment in the source: the name reads as a sentence) is a knowledge graphno extension
AddFact
(no comment in the source: the name reads as a sentence) add factalso written: AddTriplein the section triple interfaceQCSXTZZZIBWU
domain-modeling verbs (INSTANCE-scoped, chainable) -------------------- Build a domain knowledgebase with NO globals: oKB = new stzKnowledgeGraph("restaurant") oKB.Know("margherita", "dish"). KnowRelation("margherita", "contains", "tomato-sauce"). ConstrainRelation("pairs-with", :Symmetric) The natural-world globals (StzKnow/StzKnowRelation) are a SEPARATE feature -- the default shared world behind WhatIs/AreRelated. A scoped domain (a DLM's brain, an app's world) owns its own graph instance. 2 examples runalso written: KnowEntity
oRest = new stzKnowledgeGraph("restaurant")
oRest.Know("margherita", "dish").Know("tiramisu", "dish")
oRest.AddConversationQ("setup").SetGoal(StzGoalQ().RequireEach("dish", "contains"))
? len( oRest.GapsIn("setup") )
#--> 2library testno extension(no comment in the source: the name reads as a sentence) know relation 1 examples runalso written: KnowFactin the section triple interfaceno extension
ConstrainRelation
Record a relation LAW on THIS graph's ontology (:Symmetric, :Unique, :Transitive). Prove() reads it for transitive closure; forging a DLM reads it as the domain's laws.also written: Constrainno extension
Admit
GOVERNED ADMISSION (instance-scoped) --------------------------------- The door a conversation / agent / importer admits facts through: the LAW is checked, the verdict is EXPLAINED, and a refusal is RECORDED as a named contradiction -- never silently resolved (G8). Admission is governed because it comes through THIS door, not because a global flag is set -- so a scoped domain graph governs itself, with no global world. Returns [ :admitted = 1|0, :why = "..." ].no extension
composed example
o1 = new stzKnowledgeGraph("fluency-space")
? @@( o1.Admit("an", "an", "an", [ "an", "a" ]) )
#--> [ [ "admitted", 1 ], [ "why", "admitted: 'an' an 'an'" ] ]composed from the signature, run for this pageCONVERSATIONS IN THIS SPACE (composition) ----------------------------- A knowledge space HOLDS its conversations: an elicitation is an EPISODE that happens INSIDE the space it grows -- never a session that owns a space. So the space is the door for everything that needs knowledge (AskIn / ReplyIn / GapsIn / ConcludeIn hand THIS graph, live, into the session); session-only state is reached through ConversationQ(topic). -- the conversations, as a collection this space OWNS 1 examples run
oRest = new stzKnowledgeGraph("restaurant")
oRest.Know("margherita", "dish").Know("tiramisu", "dish")
oRest.AddConversationQ("setup").SetGoal(StzGoalQ().RequireEach("dish", "contains"))
? len( oRest.GapsIn("setup") )
#--> 2library testQCSXTZZZIBWUAddConversations
(no comment in the source: the name reads as a sentence) add conversationsin the section triple interfaceQCSXTZZZIBWU
RemoveConversation
(no comment in the source: the name reads as a sentence) remove conversationin the section triple interfaceno extension
RemoveAllConversations
(no comment in the source: the name reads as a sentence) remove all conversationsin the section triple interfaceno extension
ConversationQ
(no comment in the source: the name reads as a sentence) conversation qin the section triple interfaceno extension
Conversations
(no comment in the source: the name reads as a sentence) conversationsin the section triple interfaceQCSXTZZZIBWU
NumberOfConversations
(no comment in the source: the name reads as a sentence) number of conversationsin the section triple interfaceno extension
composed example
o1 = new stzKnowledgeGraph("fluency-space")
? o1.NumberOfConversations()
#--> 0composed from the signature, run for this pageHasConversation
(no comment in the source: the name reads as a sentence) has conversationin the section triple interfaceno extension
composed example
o1 = new stzKnowledgeGraph("fluency-space")
? o1.HasConversation("an")
#--> 0composed from the signature, run for this pageOpenConversations
the sessions still working (a goal neither fulfilled nor revoked)no extension
the wise-coding loop, driven BY the space (This goes in live) 1 examples run
oRest = new stzKnowledgeGraph("restaurant")
oRest.Know("margherita", "dish").Know("tiramisu", "dish")
oRest.AddConversationQ("setup").SetGoal(StzGoalQ().RequireEach("dish", "contains"))
? len( oRest.GapsIn("setup") )
#--> 2library testno extensionAskIn
(no comment in the source: the name reads as a sentence) ask inin the section triple interfaceQCSXTZZZIBWU
ReplyIn
(no comment in the source: the name reads as a sentence) reply inin the section triple interfaceno extension
ConcludeIn
(no comment in the source: the name reads as a sentence) conclude inin the section triple interfaceno extension
SetStrictMode
(no comment in the source: the name reads as a sentence) set strict modein the section triple interfaceno extension
EnableStrictMode
(no comment in the source: the name reads as a sentence) enable strict modein the section triple interfaceno extension
DisableStrictMode
(no comment in the source: the name reads as a sentence) disable strict modein the section triple interfaceno extension
IsStrict
(no comment in the source: the name reads as a sentence) is strictin the section triple interfaceno extension
composed example
o1 = new stzKnowledgeGraph("fluency-space")
? o1.IsStrict()
#--> 0composed from the signature, run for this pageContradictions
(no comment in the source: the name reads as a sentence) contradictionsin the section triple interfaceno extension
FactMeta
(no comment in the source: the name reads as a sentence) fact metain the section triple interfaceno extension
RemoveFact
(no comment in the source: the name reads as a sentence) remove factin the section triple interfaceno extension
RemoveTriple
(no comment in the source: the name reads as a sentence) remove triplein the section triple interfaceno extension
Facts
(no comment in the source: the name reads as a sentence) factsalso written: Triplesin the section triple interfaceno extension
query interface 1 examples runno extension
QueryPath
query interfaceno extension
Predicates
entity analysisalso written: PredicatesOfno extension
Relations
entity analysisalso written: RelationsOfno extension
SimilarTo
entity analysisalso written: SimilarEntitiesno extension
DefineClass
ontology supportno extension
DefineProperty
ontology supportno extension
Ontology
ontology supportno extension
ValidateOntology
ontology supportno extension
composed example
o1 = new stzKnowledgeGraph("fluency-space")
? o1.ValidateOntology()
#--> 1composed from the signature, run for this pageRelationHasLaw
Does the ontology declare this LAW for this relation? (Laws land here through DefineProperty(rel, [ law ]) -- the R1 home of :unique / :symmetric / :transitive.)no extension
composed example
o1 = new stzKnowledgeGraph("fluency-space")
? o1.RelationHasLaw("an", "an")
#--> 0composed from the signature, run for this pageProve
Prove([ subject, relation, object ]) -> a STRUCTURED, replayable proof: [ :verdict, :goal, :steps, :narration, :certainty ]. Each step: [ :kind ("fact"|"law"|"chain-link"), :fact, :narration ]. Deterministic over recorded facts + declared laws, so certainty is 1 WHATEVER the verdict (a certain no is still certain, LAW 3).no extension
Explain
knowledge graph explainno extension
ImportKnow
(legacy .stzknow still reads)also written: LoadKnowno extension
ExportToKnow
Every field is escaped (StzKnowEscape): a | or a newline inside a value is data, never a separator. Fact lines keep their 3-field shape.no extension
WriteToKnowFile
(legacy .stzknow still reads)no extension
WriteKnowFile
(legacy .stzknow still reads)no extension
MetaOfFact
The provenance recorded for a fact ([] when none). The match ignores case, as the graph's own nodes do.no extension

