All Packages Class Hierarchy This Package Previous Next Index
Class SHOE.Relation
java.lang.Object
|
+----SHOE.SHOE_Obj
|
+----SHOE.Declaration
|
+----SHOE.Relation
- public class Relation
- extends Declaration
This class is used to describe and manipulate a SHOE Relation.
-
Relation(SGML_Tag)
- Creates a new relation claim from its SGML Tag representation.
-
Relation(String)
- Creates a new relation claim with using the given prefixed name.
-
addArg(RelArg)
- Adds an argumnent to the relation.
-
addArg(RelArg, boolean)
- Add an argument to the relation.
-
checkFields(SGML_Tag, Vector)
- Given an SGML tag representing a SHOE relation, determines if
it contains the required fields and returns a boolean indicating
if there are any errors.
-
getArg(int)
- Returns an argument of the relation that has the given position
number.
-
getArgCount()
- Returns the number of arguments in the relation.
-
getArgs()
- Returns the set of the relation's arguments as an array.
-
getArgValue(int)
- Returns the value of an argument of the relation that has the
given position number.
-
getBaseName()
- Returns the name of the relation as it appears in its original
ontology.
-
getElmtId()
- Returns the unique id of the ontology object that defines the
structure of this relation.
-
getKey()
- Returns an identifier for the SHOE object.
-
getName()
- Returns the prefixed name of the relation referred to by this claim.
-
getPredicateText()
- Returns a string that formats the relation as a predicate, i.e.,
relname(arg1, arg2).
-
getTextBySubject(OntManager)
- Returns a phrase suitable for describing the claim given that
its subject is already known.
-
printSGML(PrintStream)
- Writes the objects and its components to the given print
stream in SGML format.
-
readSubTags(HTML_Tokenizer)
- Reads and processes the tokens from an HTML_Tokenizer until
the appropriate closing tag is encountered.
-
setArgValue(int, String)
- Sets the value of the argument with the selected position.
-
setName(String)
- Sets the prefixed name of the relation.
-
toString()
- Returns the string representation of the tag.
-
validate(SHOE_Obj, OntManager)
- Validates the relation by resolving its name, filling in default
argument values, and validating the arguments.
Relation
public Relation(String name)
- Creates a new relation claim with using the given prefixed name.
Relation
public Relation(SGML_Tag sgmltag)
- Creates a new relation claim from its SGML Tag representation.
getArg
public RelArg getArg(int pos)
- Returns an argument of the relation that has the given position
number. Since this scans the set arguments looking for one with
the correct number, it is not dependent on the order of the arguments.
If we eventually correct this class to store arguments in sorted
order, then we can make this function more efficient by using direct
indicing.
getArgValue
public String getArgValue(int pos)
- Returns the value of an argument of the relation that has the
given position number.
getArgs
public RelArg[] getArgs()
- Returns the set of the relation's arguments as an array.
getArgCount
public final int getArgCount()
- Returns the number of arguments in the relation.
getBaseName
public String getBaseName()
- Returns the name of the relation as it appears in its original
ontology. If there is no such name, as may be the case if by
error these is no such ontology, returns an empty string. We do
not return null, because we want to allow string comparisions on
the result without doing a test for nulls.
getElmtId
public final Unique_Elt getElmtId()
- Returns the unique id of the ontology object that defines the
structure of this relation.
getKey
public String getKey()
- Returns an identifier for the SHOE object.
- Overrides:
- getKey in class SHOE_Obj
getName
public String getName()
- Returns the prefixed name of the relation referred to by this claim.
getPredicateText
public String getPredicateText()
- Returns a string that formats the relation as a predicate, i.e.,
relname(arg1, arg2).
- Overrides:
- getPredicateText in class Declaration
getTextBySubject
public String getTextBySubject(OntManager ontman)
- Returns a phrase suitable for describing the claim given that
its subject is already known. (i.e., short-para arg2)
- Overrides:
- getTextBySubject in class Declaration
addArg
public void addArg(RelArg arg)
- Adds an argumnent to the relation. Same as addArg(arg, true).
addArg
public void addArg(RelArg arg,
boolean addToContent)
- Add an argument to the relation. The arguments will be stored in
sorted order by their POS fields. BUG: It is possible to get the
arguments out of order with 3-ary or more relations, eg., 3,2,1
becomes 1,3,2. Is there an efficient way to handle this without
searching the list everytime an argument is added?
setArgValue
public void setArgValue(int pos,
String value)
- Sets the value of the argument with the selected position.
setName
public void setName(String name)
- Sets the prefixed name of the relation.
checkFields
public boolean checkFields(SGML_Tag sgmltag,
Vector errStrings)
- Given an SGML tag representing a SHOE relation, determines if
it contains the required fields and returns a boolean indicating
if there are any errors. Specific error messages are appended to
the errStrings vector.
readSubTags
public Vector readSubTags(HTML_Tokenizer intokens)
- Reads and processes the tokens from an HTML_Tokenizer until
the appropriate closing tag is encountered.
- Overrides:
- readSubTags in class SHOE_Obj
validate
public Vector validate(SHOE_Obj parent,
OntManager ontman)
- Validates the relation by resolving its name, filling in default
argument values, and validating the arguments.
printSGML
public void printSGML(PrintStream out)
- Writes the objects and its components to the given print
stream in SGML format.
- Overrides:
- printSGML in class SHOE_Obj
toString
public String toString()
- Returns the string representation of the tag. Any contents
or end tags are not included.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index