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) |
|
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.
|
|
List< Thing > | GetAllAttributes (Thing t) |
| Gets all relationships to a gropu of Things includeing 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.
|
|
List< Thing > | HasSequence (List< Thing > targetAttributes) |
| Returns a list of Things which have all the target attributes as Relationships.
|
|
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 Relatioships which were true in the previous query.
|
|
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 lables 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 (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) |
|
Contains a collection of Things linked by Relationships to implement Common Sense and general knowledge.
Relationship UKS.UKS.AddStatement |
( |
object | oSource, |
|
|
object | oRelationshipType, |
|
|
object | oTarget, |
|
|
object | oSourceProperties = null, |
|
|
object | oTypeProperties = null, |
|
|
object | oTargetProperties = null ) |
|
inline |
Creates a Relationship.
Parameters may be Things or strings. If strings, they represent Thing labels and if the Things with those lables 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.
- Parameters
-
oSource | string or Thing |
oRelationshipType | string or Thing |
oTarget | string or Thing (or null) |
oSourceAttributess | String containing one or more Thing labels separated by spaces, list of strings with individusl Thing Labels, Thing, OR List of Things |
oTypeAttributes | Same |
oTargetAttributess | Same |
- Returns
- The primary relationship which was created (others may be created for given attributes