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.


Constructor Index

 o Relation(SGML_Tag)
Creates a new relation claim from its SGML Tag representation.
 o Relation(String)
Creates a new relation claim with using the given prefixed name.

Method Index

 o addArg(RelArg)
Adds an argumnent to the relation.
 o addArg(RelArg, boolean)
Add an argument to the relation.
 o 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.
 o getArg(int)
Returns an argument of the relation that has the given position number.
 o getArgCount()
Returns the number of arguments in the relation.
 o getArgs()
Returns the set of the relation's arguments as an array.
 o getArgValue(int)
Returns the value of an argument of the relation that has the given position number.
 o getBaseName()
Returns the name of the relation as it appears in its original ontology.
 o getElmtId()
Returns the unique id of the ontology object that defines the structure of this relation.
 o getKey()
Returns an identifier for the SHOE object.
 o getName()
Returns the prefixed name of the relation referred to by this claim.
 o getPredicateText()
Returns a string that formats the relation as a predicate, i.e., relname(arg1, arg2).
 o getTextBySubject(OntManager)
Returns a phrase suitable for describing the claim given that its subject is already known.
 o printSGML(PrintStream)
Writes the objects and its components to the given print stream in SGML format.
 o readSubTags(HTML_Tokenizer)
Reads and processes the tokens from an HTML_Tokenizer until the appropriate closing tag is encountered.
 o setArgValue(int, String)
Sets the value of the argument with the selected position.
 o setName(String)
Sets the prefixed name of the relation.
 o toString()
Returns the string representation of the tag.
 o validate(SHOE_Obj, OntManager)
Validates the relation by resolving its name, filling in default argument values, and validating the arguments.

Constructors

 o Relation
 public Relation(String name)
Creates a new relation claim with using the given prefixed name.

 o Relation
 public Relation(SGML_Tag sgmltag)
Creates a new relation claim from its SGML Tag representation.

Methods

 o 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.

 o getArgValue
 public String getArgValue(int pos)
Returns the value of an argument of the relation that has the given position number.

 o getArgs
 public RelArg[] getArgs()
Returns the set of the relation's arguments as an array.

 o getArgCount
 public final int getArgCount()
Returns the number of arguments in the relation.

 o 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.

 o getElmtId
 public final Unique_Elt getElmtId()
Returns the unique id of the ontology object that defines the structure of this relation.

 o getKey
 public String getKey()
Returns an identifier for the SHOE object.

Overrides:
getKey in class SHOE_Obj
 o getName
 public String getName()
Returns the prefixed name of the relation referred to by this claim.

 o getPredicateText
 public String getPredicateText()
Returns a string that formats the relation as a predicate, i.e., relname(arg1, arg2).

Overrides:
getPredicateText in class Declaration
 o 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
 o addArg
 public void addArg(RelArg arg)
Adds an argumnent to the relation. Same as addArg(arg, true).

 o 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?

 o setArgValue
 public void setArgValue(int pos,
                         String value)
Sets the value of the argument with the selected position.

 o setName
 public void setName(String name)
Sets the prefixed name of the relation.

 o 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.

 o 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
 o 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.

 o 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
 o 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