public interface Ontology
Modifier and Type | Field and Description |
---|---|
static CasaLispOperator |
ONT__ASSERT |
static CasaLispOperator |
ONT__DESCRIBE |
static CasaLispOperator |
ONT__GET |
static CasaLispOperator |
ONT__GET_RESIDENT |
static CasaLispOperator |
ONT__IMPORT |
static CasaLispOperator |
ONT__INDIVIDUAL |
static CasaLispOperator |
ONT__IS_INDIVIDUAL |
static CasaLispOperator |
ONT__IS_OBJECT |
static CasaLispOperator |
ONT__IS_TYPE |
static CasaLispOperator |
ONT__RELATED_TO |
static CasaLispOperator |
ONT__RELATION
Lisp operator: (DEFTBOXREL name {keys {rel}}*)
|
static CasaLispOperator |
ONT__SET_DEFAULT |
static CasaLispOperator |
ONT__TYPE |
static CasaLispOperator |
ONTOLOGY |
Modifier and Type | Method and Description |
---|---|
int |
add(String description)
Equivalent to
add(new TypeHierarchy(description)) . |
void |
addIndividual(String name,
String... parents) |
void |
addIndividual(String name,
String parent) |
void |
addSuperOntologies(Ontology... parentOntologies) |
void |
addSuperOntologies(String... parentOntologies) |
void |
addType(String name,
String... parents)
Adds name to the hierarchy with super-type links to each of the
nodes in parents.
|
void |
addType(String name,
String parent)
Equivalent to
add(name,new String[]{parent}) . |
void |
declMaplet(String relationName,
String domainName,
String rangeName) |
void |
declRelation(String name,
String basedOn,
Set<Relation.Property> properties,
Constraint domConstraint,
Constraint ranConstraint,
Object... otherParams) |
String |
describe(String name)
Print to the return String the complete path (in persistent form) from the
root node to the node named name.
|
String |
describeIndividual(String type) |
String |
describeRelation(String relation) |
String |
describeType(String type) |
Status |
extendWith(String spec)
Add the persistent Ontology data in spec to this
Ontology.
|
String |
getDefaultFileExtension() |
String |
getName() |
boolean |
instanceOf(String child,
String parent) |
Set<String> |
isa(String child)
Finals all ancestors of child.
|
boolean |
isa(String child,
String parent)
Determines if parent is an ancestor of child.
|
Set<String> |
isAncestor(String child) |
Set<String> |
isChild(String parent) |
boolean |
isCompatable(Ontology other)
Determines if other is a compatible description (see
#describe(TypeNode) )
to this TypeHierarchy. |
void |
isCompatableThrow(Ontology other)
Determines if other is a compatible description (see
#describe(TypeNode) )
to this TypeHierarchy. |
Set<String> |
isDescendant(String parent) |
boolean |
isIndividual(String name)
Returns true if the agent "knows" about the token string in the parameter and it's an individual.
|
boolean |
isObject(String name)
Returns true if the agent "knows" about the token string in the parameter: it's either a type or an individual.
|
Set<String> |
isParent(String child)
Finals all parents (direct ancestors) of child.
|
boolean |
isRelation(String name)
Returns true if the agent "knows" about the token string in the parameter and it's an relation.
|
boolean |
isType(String name)
Returns true if the agent "knows" about the token string in the parameter and it's a type.
|
Set<String> |
relatedTo(String relation,
String domain) |
boolean |
relatedTo(String relation,
String domain,
String range)
Determines if an element is related to another element by the relation.
|
String |
toString()
Create a string containing the persistent representation of this object.
|
static final CasaLispOperator ONTOLOGY
static final CasaLispOperator ONT__IS_OBJECT
static final CasaLispOperator ONT__IS_TYPE
static final CasaLispOperator ONT__IS_INDIVIDUAL
static final CasaLispOperator ONT__GET_RESIDENT
static final CasaLispOperator ONT__SET_DEFAULT
static final CasaLispOperator ONT__GET
static final CasaLispOperator ONT__DESCRIBE
static final CasaLispOperator ONT__RELATED_TO
static final CasaLispOperator ONT__ASSERT
static final CasaLispOperator ONT__INDIVIDUAL
static final CasaLispOperator ONT__TYPE
static final CasaLispOperator ONT__IMPORT
static final CasaLispOperator ONT__RELATION
The function's lambda list is: (RELATION-NAME &KEY BASE INVERSE REFLEXIVE SYMMETRIC TRANSITIVE ASSIGNABLE) Function documentation: Define a relation in the agent's casa ontology. Lambda List: RELATION-NAME &KEY BASE INVERSE REFLEXIVE SYMMETRIC TRANSITIVE ASSIGNABLE RELATION-NAME The name of the relation. :BASE The relation on which this is based. :INVERSE This relation is to be an inverse relation (x->y => y->x) of the base relation. :REFLEXIVE This relation is a reflexive (x->x) version of the base relation. :SYMMETRIC This relation is a symmetric (x->y => y->x) version of the base relation. :TRANSITIVE This relation is a transitive (x->y & y->z => x->y) version of the base relation. :ASSIGNABLE This relation is assignable (that is one can use it as first argument in a (declMaplet ...) operator
String getDefaultFileExtension()
void addType(String name, String... parents) throws ParentNodeNotFoundException, DuplicateNodeException, IllegalOperationException
name
- the name of new typeparents
- the super-types of name. Each member of parents
must already exist in the hierarchy.ParentNodeNotFoundException
- if any of the members of parents
isn't in the hierarchy.IllegalOperationException
DuplicateNode
- if name already exists in the hierarchyDuplicateNodeException
void addType(String name, String parent) throws ParentNodeNotFoundException, DuplicateNodeException, IllegalOperationException
add(name,new String[]{parent})
. Use for types
that only have a single super-type.name
- the name of new typeparent
- the super-type of name.ParentNodeNotFoundException
- if parent
isn't in the hierarchy.IllegalOperationException
DuplicateNode
- if name already exists in the hierarchyDuplicateNodeException
int add(String description) throws DuplicateNodeException, IncompatableTypeHierarchiesException, ParentNodeNotFoundException, ParseException
add(new TypeHierarchy(description))
.description
- DuplicateNode
IncompatableTypeHierarchiesException
ParentNodeNotFoundException
ParseException
DuplicateNodeException
boolean relatedTo(String relation, String domain, String range) throws UnsupportedOperationException, IllegalOperationException
domain
has a role of
type range
.domain
- the thing that is a the "source" of the relationrange
- the thing that is the "destination" of the relationdomain
is related to range
UnsupportedOperationException
IllegalOperationException
boolean isa(String child, String parent) throws IllegalOperationException
child
- the name if a node in the TypeHierarchyparent
- the name of a node in the TypeHierarchyIllegalOperationException
Set<String> isa(String child) throws IllegalOperationException
child
- the name if a node in the TypeHierarchyIllegalOperationException
Set<String> isParent(String child) throws IllegalOperationException
child
- the name if a node in the TypeHierarchyIllegalOperationException
String toString()
boolean isObject(String name) throws IllegalOperationException
name
- the name of a node in the TypeHiearchyIllegalOperationException
- if the qualified syntax explicitly specifies a dictionary that is not the owner.boolean isType(String name) throws IllegalOperationException
name
- the name of a node in the TypeHiearchyIllegalOperationException
- if the qualified syntax explicitly specifies a dictionary that is not the owner.boolean isIndividual(String name) throws IllegalOperationException
name
- the name of a node in the TypeHiearchyIllegalOperationException
- if the qualified syntax explicitly specifies a dictionary that is not the owner.boolean isRelation(String name) throws IllegalOperationException
name
- the name of the relationIllegalOperationException
- if the qualified syntax explicitly specifies a dictionary that is not the owner.String describe(String name) throws IllegalOperationException
name
- the name of a node in the TypeHiearchyIllegalOperationException
- TODOboolean isCompatable(Ontology other)
#describe(TypeNode)
)
to this TypeHierarchy.
Node A is compatible with node B iff all nodes in A that have matched names
in B are exactly the same as the corresponding node in B (that is, they have
the same name, and each of the parents [recursively] are exactly the same).
forall i:Node | i member B . exists j:Node | j member A . i.name = j.nameother
- the TypeHierarchy ot compare to this one for compatabilityvoid isCompatableThrow(Ontology other) throws IncompatableTypeHierarchiesException
#describe(TypeNode)
)
to this TypeHierarchy.
Node A is compatible with node B iff all nodes in A that have matched names
in B are exactly the same as the corresponding node in B (that is, they have
the same name, and each of the parents [recursively] are exactly the same).
forall i:Node | i member B . exists j:Node | j member A . i.name = j.nameother
- the TypeHierarchy ot compare to this one for compatabilityIncompatableTypeHierarchiesException
- iff other is incompatableStatus extendWith(String spec)
spec
- A String containing the persistent for of an
Ontologyvoid addSuperOntologies(Ontology... parentOntologies) throws IllegalOperationException
IllegalOperationException
void addSuperOntologies(String... parentOntologies) throws IllegalOperationException
IllegalOperationException
String getName()
void addIndividual(String name, String parent) throws ParentNodeNotFoundException, DuplicateNodeException, IllegalOperationException
void addIndividual(String name, String... parents) throws ParentNodeNotFoundException, DuplicateNodeException, IllegalOperationException
boolean instanceOf(String child, String parent) throws IllegalOperationException
IllegalOperationException
String describeRelation(String relation) throws IllegalOperationException
IllegalOperationException
String describeType(String type) throws IllegalOperationException
IllegalOperationException
String describeIndividual(String type) throws IllegalOperationException
IllegalOperationException
void declMaplet(String relationName, String domainName, String rangeName) throws IllegalOperationException
IllegalOperationException
void declRelation(String name, String basedOn, Set<Relation.Property> properties, Constraint domConstraint, Constraint ranConstraint, Object... otherParams) throws IllegalOperationException
IllegalOperationException
Set<String> relatedTo(String relation, String domain) throws UnsupportedOperationException, IllegalOperationException
Set<String> isAncestor(String child) throws IllegalOperationException
IllegalOperationException
Set<String> isChild(String parent) throws IllegalOperationException
IllegalOperationException
Set<String> isDescendant(String parent) throws IllegalOperationException
IllegalOperationException