Contains a collection of Things linked by Relationships to implement Common Sense and general knowledge.
More...
|
| UKS () |
| Creates a new reference to the UKS and initializes it if it is the first reference.
|
virtual Thing | AddThing (string label, Thing parent) |
| This is a primitive method needed only to create ROOT Things which have no parents.
|
virtual void | DeleteThing (Thing t) |
| This is a primitive method to Delete a Thing...the Thing must not have any children.
|
Thing | Labeled (string label) |
| Uses a hash table to return the Thing with the given label or null if it does not exist.
|
bool | ThingInTree (Thing t1, Thing t2) |
Relationship | GetRelationship (Thing source, Thing relType, Thing target) |
Relationship | GetRelationship (Relationship r) |
List< Thing > | ThingListFromObject (object o, string parentLabel="unknownObject") |
void | DeleteAllChildren (Thing t) |
| Recursively removes all the descendants of a Thing. If these descendants have no other parents, they will be deleted as well.
|
Thing | GetOrAddThing (string label, object parent=null, Thing source=null) |
| Creates a new Thing in the UKS OR returns an existing Thing, based on the label.
|
void | CreateInitialStructure () |
void | SetupNumbers () |
bool | SaveUKStoXMLFile (string filenameIn="") |
| Saves the UKS content to an XML file.
|
bool | LoadUKSfromXMLFile (string filenameIn="", bool merge=false) |
| Loads UKS content from a prvsiously-saved XML file.
|
List< Thing > | GetAllAttributes (Thing t) |
| Gets all relationships to a group of Things including inherited relationships.
|
List< Relationship > | GetAllRelationships (List< Thing > sources, bool reverse) |
IList< Relationship > | FilterResults (List< Relationship > result, List< Thing > ancestors) |
| Filters a list of Relationships returning only those with at least one component which has an ancestor in the list of Ancestors.
|
float | HasSequence (Thing pattern, Thing candidate, out int bestOffset, bool circularSearch=false, Thing relType=null) |
| This determines how well two Things match in terms of the order of their ordered attributes.
|
List< Thing > | FindThingsWithAttributes (List< Thing > attributes) |
| Returns a list of Things which have ALL the given attributes (IS Relationships)
|
List< Relationship > | WhyNot () |
| Returns a list of Relationships which were false in the previous query.
|
List< Relationship > | Why () |
| Returns a list of Relationships which were true in the previous query.
|
Thing | GetNextClosestMatch (ref float confidence) |
| Given that you have performed a search with SearchForClosestMatch, this returns the next-best result given the previous best.
|
Thing | SearchForClosestMatch (Thing target, Thing root, ref float confidence) |
| Search for the Thing which most closely resembles the target Thing based on the attributes of the target.
|
Relationship | AddStatement (object oSource, object oRelationshipType, object oTarget, object oSourceProperties=null, object oTypeProperties=null, object oTargetProperties=null) |
| Creates a Relationship.
Parameters may be Things or strings. If strings, they represent Thing labels and if the Things with those labels do not exist, they will be created.
If the RelationshipType has an inverse, the inverse will be used and the Relationship will be reversed so that Fido IsA Dog become Dog HasChild Fido.
If Attributes are given, they apply to the applicable source, type, or target parameter. Example "Fido","IsA","Dog",null,null,"Big" creates or locates an existing Thing which is a child of Dog and has the attribute IS Big (perhaps labeled Dog.Big). Then Fido is made a child of that Thing.
|
Relationship | CreateTheRelationship (object oSource, object oRelationshipType, object oTarget, object oSourceProperties=null, object oTypeProperties=null, object oTargetProperties=null) |
Relationship | CreateTheRelationship (ref Thing source, ref Thing relType, ref Thing target, ref List< Thing > sourceProperties, List< Thing > typeProperties, ref List< Thing > targetProperties) |
Thing | SubclassExists (Thing t, List< Thing > thingAttributes, ref Thing bestMatch, ref List< Thing > missingAttributes) |
Thing | CreateInstanceOf (Thing t) |
void | ExportTextFile (string root, string path, int maxDepth=12) |
| Export a neighborhood starting from root to the bracketed txt file format. Emits facts as [S,R,O] (or [S,R,O,N] when R is a numeric specialization like "has.4"). Optionally emits simple clause pairs if Relationship exposes a Clauses collection.
|
void | ImportTextFile (string filePath) |
| Text file format format: A line is one or more bracketed statements [S,R,O] or [S,R,O,N] (N weight), optionally chained by RELTYPE connector tokens between them. Examples: [Dog,has.4,leg] [Fido,plays,outside] IF [weather,is,sunny] [A,rel,B] WITH [C,rel,D] BECAUSE [E,rel,F] Comments (# or //) allowed outside quotes/brackets.
|
bool | ParseOneLine (int lineNo, string raw) |
Contains a collection of Things linked by Relationships to implement Common Sense and general knowledge.