public abstract class BasedRelation extends ConcreteRelation
Relation.Property
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
assignable |
(package private) ConcreteRelation |
base |
(package private) Constraint |
domConstraint |
(package private) Constraint |
ranConstraint |
name, visible
Constructor and Description |
---|
BasedRelation(String name,
Ontology ontology,
ConcreteRelation base,
boolean assignable,
Constraint domainConstraint,
Constraint rangeConstraint) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Type domain,
Type range)
Puts the domain/range pair into the relation.
|
protected String |
getBaseName() |
ConcreteRelation |
getUses() |
boolean |
isAssignable()
Some relations are based on other relations, and only base relations can have
maplets declared as members.
|
boolean |
isBasedOn(Relation other) |
boolean |
remove(Type subject,
Type object)
Removes domain/range pair from the relation.
|
boolean |
setVisible(boolean set)
Some relations are not declared, but are created in some implementations in the process of creating other relations.
|
String |
toString() |
String |
toStringComment(Ontology relativeToOntology)
A comment string appropriate for the relation (not inclding the prefix ";").
|
compareTo, getName, getOntology, getRelativeName, hasProperty, isMark, isVisible, relatedTo, relatedTo, relatedTo, relatedTo, relatedToX, setMark, setName, toStringOptions
ConcreteRelation base
boolean assignable
Constraint domConstraint
Constraint ranConstraint
public BasedRelation(String name, Ontology ontology, ConcreteRelation base, boolean assignable, Constraint domainConstraint, Constraint rangeConstraint) throws IllegalOperationException
name
- base
- assignable
- IllegalOperationException
public boolean isBasedOn(Relation other)
isBasedOn
in class ConcreteRelation
public boolean add(Type domain, Type range) throws IllegalOperationException
Relation
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 relationIllegalOperationException
public boolean remove(Type subject, Type object) throws IllegalOperationException
Relation
domain
has a role of
type range
.subject
- the thing that is a the "source" of the relationobject
- the thing that is the "destination" of the relationIllegalOperationException
protected String getBaseName()
public boolean isAssignable()
Relation
public boolean setVisible(boolean set)
Relation
OntologyEntity.toString()
). Use setVisible() to set the visibility attribute as read by Relation.isVisible()
.setVisible
in interface Relation
setVisible
in class ConcreteRelation
set
- public String toString()
toString
in interface OntologyEntity
toString
in class Object
public ConcreteRelation getUses()
getUses
in class ConcreteRelation
base
.ConcreteRelation.getUses()
ConcreteRelation.getUses()
public String toStringComment(Ontology relativeToOntology)
ConcreteRelation
name(class-name), name(class-name)...describing the base and ordered decorators for this relation.
toStringComment
in class ConcreteRelation
relativeToOntology
- TODO