public class DocGen
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
DocGen.DisplayFilter |
class |
DocGen.PresentationNameComparator |
Modifier and Type | Field and Description |
---|---|
protected java.util.TreeMap |
alphaList
A TreeMap of TreeMaps of ArrayLists where the keys are
uppercase single characters (of term formats or headwords) and
the values are TreeMaps with a key of the term formats or
headwords and ArrayList values of the actual term names.
|
protected java.util.Set |
codedIdentifiers
A Set of Strings.
|
protected static java.lang.String |
DEFAULT_KEY |
protected java.lang.String |
defaultImageFile
The default image file (such as an organization's logo) to be
used in HTML generation
|
protected java.lang.String |
defaultImageFileMarkup
The default image file (such as an organization's logo) to be
used in HTML generation, wrapped in any necessary additional
markup required for proper display.
|
protected java.lang.String |
defaultNamespace
The default namespace associated with this DocGen object
|
protected java.lang.String |
defaultPredicateNamespace
The default namespace for predicates in the ontology associated
with this DocGen object
|
protected DocGen.DisplayFilter |
displayFilter
The DisplayFilter which, if present, determines if a given
SUO-KIF object may be displayed or output by this DocGen
object.
|
protected static java.util.Hashtable |
DOC_GEN_INSTANCES |
protected int |
docGenControlBits
A int value representing the bit values that control the file
generation process.
|
protected java.lang.String |
docGenKey
A default key to identify this particular DocGen object
|
protected static java.util.List<java.lang.String> |
F_CONTROL_TOKENS |
protected static java.lang.String |
F_SI
This String token denotes Sigma's "simple" HTML layout, and is
used as a flag in the HTML generation code to switch between
full and simple modes.
|
protected java.lang.String |
footerText
The document footer text to be used for HTML generation
|
protected static java.lang.String |
INDEX_FILE_NAME
The default base plus file suffix name for the main index file
for a set of HTML output files.
|
protected java.util.Set |
inhibitDisplayRelations
A set of the predicates that should not be displayed to the user.
|
protected static java.util.Map |
isInstanceOfCache
Supports memoization for isInstanceOf(kb, c1, c2).
|
protected KB |
kb
The KB associated with this DocGen object.
|
protected java.lang.String |
lineSeparator |
protected int |
localCounter |
protected java.util.ArrayList<java.lang.String> |
namespacePrefixes
A List of currently known namespace prefixes.
|
protected java.util.ArrayList<java.lang.String> |
namespaces
A List of currently known namespaces.
|
protected java.lang.String |
ontology
The ontology associated with this DocGen object, and for
which the DocGen object is used to generate files.
|
protected java.lang.String |
outputDirectoryPath
The canonical pathname of the current directory in which
output files will be (are being) saved.
|
protected java.io.File |
outputParentDir
The parent directory for target subdirectories of HTML, XSD,
and other types of files generated by this DocGen object.
|
protected java.util.HashMap |
relationsByKB
A Map in which each key is a KB name and the corresponding
value is a List of the Predicates defined in the KB.
|
protected boolean |
simplified
If true, a termFormat value obtained for term will be displayed
rather than the term name itself.
|
protected static java.lang.String |
SP2 |
protected java.util.Map |
stringReplacementMap
A Map containing String replacement pairs.
|
protected java.lang.String |
styleSheet
The style sheet (CSS filename) to be referenced in HTML generation
|
protected java.lang.String |
titleText
The document title text to be used for HTML generation
|
protected java.lang.String |
tocHeader
The header to be used for the the table of contents (or index
list) section during HTML generation.
|
Modifier | Constructor and Description |
---|---|
protected |
DocGen()
To obtain an instance of DocGen, use the static factory method
getInstance().
|
Modifier and Type | Method and Description |
---|---|
int |
addDocGenControlBits(int val)
Adds val via bitwise OR to the int value that represents the
bit values used to control the document generation process for
this DocGen instance.
|
int |
addDocGenControlBits(java.lang.String token)
Adds via bitwise OR the bit value corresponding to token to the
int value that represents the bit values used to control the
document generation process for this DocGen instance.
|
void |
clearAlphaList()
Clears the alphaList for this DocGen object.
|
void |
clearDocGenControlBits()
Sets to 0 the int value that represents the bit values used to
guide aspects of the document generation process for this
DocGen instance.
|
protected void |
convertRowStringsToLists(java.util.List rows,
char delimiter)
Converts a List of char-delimited Strings to a List of Lists
(i.e., an array) representing a spreadsheet.
|
protected int |
countDelimiters(java.lang.String line,
char delimiter)
Counts the number of field delimiters in line and returns the
count, ignoring delimiters that are inside Strings.
|
java.lang.String |
createAllStatements(KB kb,
java.lang.String kbHref,
java.lang.String term,
int limit)
Create an HTML page that lists information about a particular term,
with a limit on how many statements of each type should be
displayed.
|
protected java.util.TreeMap |
createAlphaList(KB kb) |
protected java.lang.String |
createBelongsToClass(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String language)
Returns a String containing HTML markup for the Belongs to Class
section of an HTML page displaying the partial
definition of term in kb.
|
protected java.lang.String |
createBelongsToClass(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String language,
java.util.Set<java.lang.String> parents)
Returns a String containing HTML markup for the Belongs to Class
section of an HTML page displaying the partial
definition of term in kb.
|
protected java.lang.String |
createChildren(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String language)
Returns a String containing HTML markup for the Children field
of an HTML page displaying the definition of term in kb.
|
protected java.lang.String |
createComments(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String language)
Returns a String containing the HTML markup for the Comment
field in a page displaying the definition of term in kb.
|
protected java.lang.String |
createCompositeComponentLine(KB kb,
java.lang.String kbHref,
java.lang.String term,
int indent,
java.lang.String language)
Returns a String containing HTML markup for a single table row
in the Composite Component section of an HTML page displaying
the partial definition of term in kb.
|
java.lang.String |
createCompositePage(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.util.TreeMap alphaList,
int limit,
java.lang.String language,
java.lang.String formatToken)
Create an HTML page that lists information about a particular
composite term, which is a representation of an XML
structure.
|
protected java.util.ArrayList |
createCompositeRecurse(KB kb,
java.lang.String term,
boolean isAttribute,
int indent)
Recursively computes and then returns a List that constitutes
the graph containing those XML elements and attributes
syntactically subordinate to term in kb.
|
protected java.lang.String |
createContainingCompositeComponentLine(KB kb,
java.lang.String kbHref,
java.lang.String containingComp,
java.lang.String instance,
int indent,
java.lang.String language)
Returns a String containing HTML markup for a row displaying a
contained component in an HTML page displaying the partial
definition of instance in kb.
|
protected java.lang.String |
createDisplayNames(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String formatToken)
Returns a String containing HTML markup for the Display Labels
field of an HTML page displaying statements about term in kb.
|
protected java.lang.String |
createDocs(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String language)
Returns a String consisting of HTML markup for a documentation
String for term obtained from kb and indexed by language.
|
protected java.lang.String |
createFormula(KB kb,
java.lang.String kbHref,
java.lang.String indentSeq,
int level,
java.lang.String previousTerm,
java.lang.String currentTerm,
java.lang.String context)
Returns a String containing HTML markup for a SUO-KIF Formula.
|
protected java.lang.String |
createHasSameComponents(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String language)
Returns a String containing HTML markup for the Has Same
Components As field of an HTML page displaying the definition
of term in kb.
|
protected java.lang.String |
createInstances(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String language,
java.util.List excluded)
Returns a String containing HTML markup for the Instances
section of an HTML page displaying the definition of term in
kb.
|
java.lang.String |
createPage(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.util.TreeMap alphaList,
int limit,
java.lang.String language,
java.lang.String formatToken)
Create an HTML page that lists information about a particular term,
with a limit on how many statements of each type should be
displayed.
|
protected java.lang.String |
createParents(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String language,
java.util.Set parentsSet)
Returns a String containing HTML markup for the Parents field
of an HTML page displaying the definition of term in kb.
|
protected java.lang.String |
createRelations(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String language,
java.lang.String formatToken)
Returns a String containing HTML markup for the Relations
section of an HTML page displaying the definition of term in
kb.
|
protected java.lang.String |
createSynonyms(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String formatToken)
Returns a String containing HTML markup for the synonym field
of an HTML page displaying the definition of term in kb.
|
protected java.lang.String |
createUsingSameComponents(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String language)
Returns a String containing HTML markup for the Composites
Using Same Components field of an HTML page displaying the
definition of term in kb.
|
static boolean |
emptyString(java.lang.String s) |
protected java.util.ArrayList |
findContainingComposites(KB kb,
java.lang.String term)
Returns an ArrayList holding the composite entities (Elements)
that contain term, or returns an empty ArrayList.
|
protected java.lang.String |
formatCompositeHierarchy(KB kb,
java.lang.String kbHref,
java.util.List hier,
java.lang.String language)
Returns a String containing HTML markup for a hierarchy or tree
display of terms that denote nested composite components.
|
protected java.lang.String |
formatContainingComposites(KB kb,
java.lang.String kbHref,
java.util.ArrayList containing,
java.lang.String composite,
java.lang.String language)
Given the SUO-KIF statements:
(hasXmlElement PartyDescriptor LocalInstance_2_459)
(datatype LocalInstance_2_459 PartyId)
(documentation LocalInstance_2_459
PartyDescriptor "A Composite containing details...")
show PartyDescriptor as one of the "containing
composites" of PartyId, and show the documentation for
the instance node next to the parent composite.
|
java.lang.String |
generateDynamicTOCHeader(java.lang.String kbHref)
Generate an alphabetic HTML list that points to the
individual index pages (which collect all terms starting
with a particular letter.
|
void |
generateHTML(KB kb,
java.lang.String language,
boolean simplified,
java.lang.String formatToken)
Generate simplified HTML pages for all terms.
|
java.lang.String |
generateHtmlDocStart(java.lang.String title)
Returns a String of HTML markup for the start of a document,
using title as the document title String.
|
protected java.lang.String |
generateHtmlFooter(java.lang.String footerText)
Returns a String of HTML markup encoding the footer section of
an HTML document, and using footerText as the text to be
displayed at the bottom of the page.
|
protected java.util.TreeMap |
generateHTMLPages(KB kb,
java.util.TreeMap alphaList,
java.lang.String language,
java.lang.String formatToken) |
void |
generateSingleHTML(KB kb,
java.lang.String language,
boolean simplified) |
void |
generateSingleHTML(KB kb,
java.lang.String dir,
java.util.TreeMap alphaList,
java.lang.String language,
boolean simplified)
Generate a single HTML page showing all terms.
|
protected java.lang.String |
generateTocHeader(KB kb,
java.util.TreeMap alphaList,
java.lang.String allname)
Generate an alphabetic HTML list that points to the
individual index pages (which collect all terms or term
formats) starting with a particular letter.
|
protected java.lang.String |
generateTOCPage(KB kb,
java.lang.String firstLetter,
java.util.TreeMap alphaList,
java.lang.String language)
Generate an HTML page that lists term name and its
documentation
|
java.util.ArrayList<java.lang.String> |
getAllNamespaceDelimiters()
Returns an ArrayList of namespace delimiter Strings gathered
from all loaded KBs, obtained by collecting statements formed
with the predicate docGenNamespaceDelimiter.
|
java.util.TreeMap |
getAlphaList(KB kb) |
protected static java.util.List<java.lang.String> |
getClientOntologyNames()
Returns a List of the names of all client ontologies currently
represented in any loaded KB.
|
protected java.lang.String |
getClosestXmlDataType(KB kb,
java.lang.String term) |
protected java.util.Set |
getCodedIdentifiers(KB kb)
Collects and returns the Set containing all known coded
identifiers in kb, including ISO code values stated to be such.
|
protected java.util.ArrayList |
getContainingComposites(KB kb,
java.lang.String term)
Travels up the HasXmlElement and HasXmlAttribute relation
hierarchies to collect all parents, and returns them in an
ArrayList.
|
protected java.lang.String |
getContextualDocumentation(KB kb,
java.lang.String term,
java.util.List contexts)
Returns the first documentation String obtained for term in kb,
using the List of namespaces or other contextualizing terms in
contexts.
|
static int |
getControlBitValue(java.lang.String token) |
static java.util.List<java.lang.String> |
getControlTokens() |
protected java.util.ArrayList |
getDatatypeTerms(KB kb,
java.lang.String term,
int targetArgnum) |
java.lang.String |
getDefaultImageFile()
Returns the base filename plus filename suffix form of the logo
image file to be referenced during HTML document generation,
else returns an empty String if no value has been set.
|
java.lang.String |
getDefaultImageFileMarkup()
Returns the base filename plus filename suffix form of the logo
image file, wrapped in any additional markup required for the
intended rendering of the image.
|
java.lang.String |
getDefaultNamespace()
Returns the String denoting the default namespace
associated with this DocGen object.
|
java.lang.String |
getDefaultPredicateNamespace()
Returns the String denoting the default namespace for
predicates in the ontology associated with this DocGen
object.
|
DocGen.DisplayFilter |
getDisplayFilter()
Returns the DisplayFilter object associated with this DocGen
object, or null if no DisplayFilter has been set.
|
int |
getDocGenControlBits()
Returns the int value that represents the bit values used to
guide aspects of the document generation process for this
DocGen instance.
|
java.lang.String |
getDocGenKey()
Returns the String key that is the index for this particular
DocGen object.
|
protected java.lang.String |
getFirstContainingClass(KB kb,
java.lang.String term)
Returns a SUO-KIF constant that denotes the first containing
Class of term obtained in kb.
|
protected java.lang.String |
getFirstDatatype(KB kb,
java.lang.String term) |
protected java.lang.String |
getFirstGeneralTerm(KB kb,
java.lang.String term)
Returns the first containing, subsuming, or superordinate
entity that can be found for term in kb.
|
protected java.util.ArrayList<java.lang.String> |
getFirstGeneralTerms(KB kb,
java.lang.String term)
Returns a List of the first containing, subsuming, or
superordinate entities found for term in kb.
|
static java.lang.String |
getFirstHtmlFormatToken(KB kb,
java.lang.String ontology)
Returns the first String token retrieved from ontology in kb
that denotes an HTML output format.
|
protected java.util.ArrayList |
getFirstInstances(KB kb,
java.lang.String term)
Returns a List of the entities that are immediate instances of
term in kb.
|
protected java.util.ArrayList<java.lang.String> |
getFirstSpecificTerms(KB kb,
java.lang.String term)
Returns a List of the first instances or syntactic subordinate
entities that can be found for term in kb.
|
protected java.util.ArrayList |
getFirstSubClasses(KB kb,
java.lang.String term)
Returns a List containing the immediate SUO-KIF subclasses of
term in kb.
|
protected java.lang.String |
getFirstSubsumingTerm(KB kb,
java.lang.String term)
Returns the first purely "subsuming" entity that can be found
for term in kb, assuming that term denotes a Class or a
Relation.
|
protected java.lang.String |
getFirstTermFormat(KB kb,
java.lang.String term,
java.util.List contexts)
Returns a String that is the first termFormat value obtained
for term in kb, else returns null if no termFormat value
exists.
|
java.lang.String |
getFooterText()
Returns the String that will be used as the footer text for
HTML document generation, else returns an empty String if no
footer text value has been set.
|
java.util.Set |
getInhibitDisplayRelations()
Returns a Set containing the names of those predicates for
which diplay should be suppressed, and tries to create the Set
from docGenInhibitDisplayRelations statements found in the
current KB if the Set does not already exist.
|
static DocGen |
getInstance() |
static DocGen |
getInstance(KB kb,
java.lang.String ontology) |
static DocGen |
getInstance(java.lang.String compositeKey) |
KB |
getKB() |
static java.lang.String |
getKifNamespaceDelimiter() |
java.lang.String |
getLineSeparator() |
protected java.util.ArrayList<java.lang.String> |
getNamespaceDelimiters(KB kb,
java.lang.String ontology)
Returns a List of all Strings used as namespace delimiters in
terms defined or referred to in ontology, as specified by
statements formed with the SUO-KIF predicate
docGenNamespaceDelimiter.
|
protected java.lang.String |
getNamespacePrefix(KB kb,
java.lang.String term)
Returns the namespace prefix of term based on the namespaces
known in kb, else returns the empty String if term appears to
have no namespace prefix.
|
java.util.ArrayList<java.lang.String> |
getNamespacePrefixes()
Returns an ArrayList of all known namespace prefixes sorted by
length, from longest to shortest.
|
java.util.ArrayList<java.lang.String> |
getNamespaces()
Returns a List of all SUO-KIF terms that denote namespaces in
any loaded KB, obtained by gathering statements formed with the
predicates inNamespace and ontologyNamespace as well as
explicit instance statements.
|
protected java.util.ArrayList<java.lang.String> |
getNamespaces(KB kb,
java.lang.String ontology,
boolean force)
Returns a List of all SUO-KIF terms denoting namespaces in kb
or in ontology, using the predicates inNamespace and
ontologyNamespace.
|
protected java.lang.String |
getNearestContainingClass(KB kb,
java.lang.String term)
Returns the first containing Class that can be found for term
in kb.
|
java.lang.String |
getOntology()
Returns a term denoting the default Ontology for this DocGen
object if an Ontology has been set, and tries very hard to find
a relevant Ontology if one has not been set.
|
java.lang.String |
getOntology(KB kb)
Returns a term denoting the default Ontology for this DocGen
object if an Ontology has been set, and tries very hard to find
a relevant Ontology if one has not been set.
|
protected java.util.ArrayList<java.lang.String> |
getOntologyNamespaces(KB kb,
java.lang.String ontology)
Returns a List of all SUO-KIF terms denoting those namespaces
containing terms that are defined in, or occur in, statements
in ontology.
|
java.lang.String |
getOutputDirectoryPath()
Returns the canonical pathname String of the current directory
in which output files will be (are being) saved.
|
static java.util.ArrayList<java.lang.String> |
getOutputFormatTokens(KB kb,
java.lang.String ontology)
Returns a List of String tokens that determine how the output
should be formatted.
|
java.io.File |
getOutputParentDir()
Returns a File object representing the directory in which the
subdirectories for the various types of output files will be
located.
|
protected java.util.ArrayList |
getPredicates(KB kb,
boolean requireNamespace)
Collects and returns a List of all Predicates in kb.
|
static java.util.ArrayList<java.lang.String> |
getRangeValueList(KB kb,
java.lang.String predicate)
Returns an ArrayList of Strings extracted from the range
argument (arg2) of the first retrieved statement formed with
predicate.
|
java.util.HashMap |
getRelationsByKB() |
static java.lang.String |
getSafeNamespaceDelimiter() |
boolean |
getSimplified()
Returns true if a termFormat value obtained for term will be
displayed during HTML rendering rather than the term name
itself.
|
java.lang.String |
getStringReplacement(java.lang.String fromString)
Returns the String replacement for fromString, if one can be
located, else just returns fromString.
|
java.util.Map |
getStringReplacementMap()
Returns the Map to be used for HTML character entity to ASCII
replacements, attempting to build it from
docGenCodeMapTranslation statements found in the KB if the Map
does not already exist.
|
java.lang.String |
getStyleSheet()
Returns the base filename plus filename suffix form of the
Cascading Style Sheet file to be referenced during HTML
document generation, else returns an empty String if no value
has been set.
|
protected java.util.ArrayList |
getSubComponents(KB kb,
java.lang.String term)
Returns a List containing those terms that are immediate
syntactic subordinates of term in kb.
|
protected java.util.ArrayList |
getSubordinateAttributes(KB kb,
java.lang.String kifTerm)
Returns a List containing the subordinate XmlAttributes of
kifTerm, else return an empty List.
|
protected java.util.ArrayList |
getSubordinateElements(KB kb,
java.lang.String kifTerm)
Returns a List containing the subordinate XmlElements of
kifTerm, else return an empty List.
|
protected java.util.ArrayList |
getSuperComponents(KB kb,
java.lang.String term)
Returns a List containing those terms that are immediate
syntactic superiors or "containers" of term in kb.
|
protected java.util.ArrayList |
getSyntacticCompositeTerms(KB kb,
java.lang.String term,
int targetArgnum) |
protected java.util.ArrayList |
getSyntacticExtensionTerms(KB kb,
java.lang.String term,
int targetArgnum,
boolean computeClosure) |
protected java.util.ArrayList<java.lang.String> |
getSyntacticSubordinateTerms(KB kb,
java.lang.String term)
Returns a List of the entities that are immediate syntactic
subordinates of term in kb.
|
protected java.util.ArrayList |
getSyntacticUnionTerms(KB kb,
java.lang.String term,
int targetArgnum) |
java.lang.String |
getTermNamespace(KB kb,
java.lang.String term) |
java.lang.String |
getTermPresentationName(KB kb,
java.lang.String term) |
java.lang.String |
getTermPresentationName(KB kb,
java.lang.String namespace,
java.lang.String term) |
java.lang.String |
getTermPresentationName(KB kb,
java.lang.String namespace,
java.lang.String term,
boolean withSpanTags) |
java.lang.String |
getTitleText()
Returns the String that will be used as the title text for HTML
document generation, else returns an empty String if no title
text value has been set.
|
java.lang.String |
getTocHeader()
Returns the String header to be used in generated HTML files.
|
static java.lang.String |
getW3cNamespaceDelimiter() |
protected boolean |
hasSubComponents(KB kb,
java.lang.String term)
Returns true if term has syntactic subcomponents such as XML
elements or XML attributes in kb, else returns false.
|
static java.lang.String |
indentChars(java.lang.String str,
int indent)
Returns a String consisting of str concatenated indent times.
|
static boolean |
isComposite(KB kb,
java.lang.String term)
Returns true if term is an instance or subclass of
CompositeContentBearingObject in kb, else returns false.
|
protected boolean |
isDataType(KB kb,
java.lang.String term) |
protected static boolean |
isInstanceOf(KB kb,
java.lang.String i,
java.lang.String c)
Returns true if i is an instance of c, else returns false.
|
protected boolean |
isLegalForDisplay(java.lang.String term)
Returns true if statements that include term and occur in the
kb and ontology associated with this DocGen object may be
displayed or output (at all, in any form).
|
static boolean |
isNonEmptyString(java.lang.String s) |
protected static boolean |
isSkipNode(KB kb,
java.lang.String term)
Returns true if term should be skipped over during printing,
else returns false.
|
protected boolean |
isXmlAttribute(KB kb,
java.lang.String term)
Returns a List that constitutes the graph containing those XML
elements and attributes syntactically subordinate to term in
kb.
|
static void |
main(java.lang.String[] args) |
protected java.io.File |
makeOutputDir(java.lang.String token)
Creates a subdirectory of SIGMA_HOME/files/, in which output
files of the type specified by token are saved.
|
protected void |
printHTMLPages(java.util.TreeMap pageList,
java.lang.String dirpath)
Save pages below the KBs directory in a directory called
HTML.
|
protected java.lang.String |
processDocString(KB kb,
java.lang.String kbHref,
java.lang.String namespace,
java.lang.String docString,
boolean isXmlDoc,
boolean addHrefs) |
java.util.ArrayList |
readSpreadsheetFile(java.lang.String inpath,
char delimiter,
int delimitersPerRow,
java.util.List<java.lang.String> rowFlags)
Parses a file of delimited fields into an ArrayList of
ArrayLists.
|
protected java.lang.String |
removeLinkableNamespacePrefixes(KB kb,
java.lang.String text)
Removes namespace prefixes from all SUO-KIF terms to be
hyperlinked in text.
|
java.util.SortedSet<java.lang.String> |
resortKbTerms(KB kb)
Rebuilds the TreeSet containing all terms in kb, and forces
the new TreeSet to sort according to each term's presentation
name.
|
protected void |
saveIndexPages(KB kb,
java.util.TreeMap alphaList,
java.lang.String dir,
java.lang.String language)
Generate and save all the index pages that link to the
individual term pages.
|
void |
setDefaultImageFile(java.lang.String filename)
Sets the base name plus suffix filename of the logo image file
to be referenced during HTML document generation.
|
void |
setDefaultImageFileMarkup(java.lang.String markup)
Sets the base name plus suffix filename of the logo image file
to be referenced during HTML document generation.
|
void |
setDefaultNamespace(java.lang.String namespace)
Sets the default namespace for this DocGen object.
|
void |
setDefaultPredicateNamespace(java.lang.String namespace)
Sets the default namespace for predicates in the ontology
associated with this DB object.
|
void |
setDisplayFilter(DocGen.DisplayFilter filterObj)
Sets the DisplayFilter associated with this DocGen object to
filterObj.
|
void |
setDocGenKey(java.lang.String key)
Sets the String key that is the index for this particular
DocGen object.
|
void |
setFooterText(java.lang.String str)
Sets the footer text String to be used during HTML document
generation.
|
void |
setInhibitDisplayRelations(java.util.Set relations)
Sets the predicates for which diplay should be suppressed to
those contained in relations.
|
void |
setKB(KB kb) |
void |
setLineSeparator(java.lang.String ls) |
void |
setMetaDataFromKB(KB kb,
java.lang.String ontology)
Tries to use the values obtained from kb and ontology to set
some of the parameter values used for HTML generation.
|
void |
setOntology(java.lang.String term) |
void |
setOutputDirectoryPath(java.lang.String pathname)
Sets the canonical pathname String of the current directory in
which output files will be (are being) saved.
|
void |
setOutputParentDir(java.io.File obj)
Sets the parent directory in which subdirectories for different
types of output files will be created to the File obj, and
tries to create the directory pathname if it does not already
exist.
|
void |
setOutputParentDir(KB kb,
java.lang.String ontology)
Sets the parent directory in which subdirectories for different
types of output files will be created to the abstract pathname
represented by a statement in kb formed with the predicate
docGenOutputParentDirectory and the argument ontology.
|
void |
setOutputParentDir(java.util.List pathnameComponents)
Sets the parent directory in which subdirectories for different
types of output files will be created to the File obj, and
tries to create the directory pathname if it does not already
exist.
|
void |
setOutputParentDir(java.lang.String pathname)
Sets to pathname the parent directory in which subdirectories
for different types of output files will be created, and tries
to create the directory pathname if it does not already exist.
|
void |
setSimplified(boolean val)
Sets this.simplified to val.
|
void |
setStringReplacementMap(java.util.Map keyValPairs)
Sets the Map to be used for HTML character entity to ASCII
replacements.
|
void |
setStyleSheet(java.lang.String filename)
Sets the base name plus suffix filename of the Cascading Style
Sheet file to be referenced during HTML document generation.
|
void |
setTitleText(java.lang.String titlestr)
Sets the title text to be used during HTML document generation.
|
void |
setTocHeader(java.lang.String header)
Sets the String header to be used in generated HTML files to
header.
|
protected java.lang.String |
showCardinalityCell(KB kb,
java.lang.String kbHref,
java.lang.String term,
java.lang.String context)
Returns a String containing HTML markup for the Cardinality
field of an HTML page displaying the definition of term in kb.
|
java.lang.String |
showTermName(KB kb,
java.lang.String term,
java.lang.String language)
Returns the termFormat entry for term in kb and language,
otherwise returns the termFormat entry for term in English,
otherwise just returns the term name.
|
void |
sortByPresentationName(KB kb,
java.lang.String namespaceTerm,
java.util.List stringList)
Sorts stringList in place by the presentation name of each its
terms, which could be very different from the raw term name.
|
protected void |
sortByTermLength(java.util.List terms)
Sorts the List terms by the length of the Strings it contains,
from longest to shortest.
|
protected java.lang.String |
stripNamespacePrefix(KB kb,
java.lang.String term)
Returns term without its namespace prefix if it appears to have
one in kb, else just returns term.
|
boolean |
testDocGenControlBits(int valToTest)
Returns true if the bit values represented by valToTest are
among the control bits represented for this DocGen instance.
|
boolean |
testDocGenControlBits(java.lang.String token)
Returns true if the bit values corresponding to token are among
the control bits represented for this DocGen instance.
|
protected java.lang.String |
toKifNamespace(KB kb,
java.lang.String term)
Returns a SUO-KIF term denoting a namespace.
|
static void |
writeToStream(java.util.List<java.lang.String> data,
java.io.OutputStream stream)
Writes a List of Strings to an OutputStream.
|
protected static final java.lang.String F_SI
protected static java.util.List<java.lang.String> F_CONTROL_TOKENS
protected static final java.lang.String SP2
protected static java.lang.String INDEX_FILE_NAME
protected int localCounter
protected static final java.lang.String DEFAULT_KEY
protected static java.util.Hashtable DOC_GEN_INSTANCES
protected java.lang.String lineSeparator
protected int docGenControlBits
protected java.lang.String defaultNamespace
protected java.lang.String defaultPredicateNamespace
protected java.lang.String ontology
protected KB kb
protected java.util.Set codedIdentifiers
protected java.lang.String titleText
protected java.lang.String footerText
protected java.lang.String styleSheet
protected java.lang.String defaultImageFile
protected java.lang.String defaultImageFileMarkup
protected java.lang.String outputDirectoryPath
protected java.util.Map stringReplacementMap
protected java.util.Set inhibitDisplayRelations
protected java.lang.String tocHeader
protected java.lang.String docGenKey
protected boolean simplified
protected java.util.HashMap relationsByKB
protected java.io.File outputParentDir
protected DocGen.DisplayFilter displayFilter
protected java.util.TreeMap alphaList
protected java.util.ArrayList<java.lang.String> namespacePrefixes
protected java.util.ArrayList<java.lang.String> namespaces
protected static java.util.Map isInstanceOfCache
protected DocGen()
public static java.util.List<java.lang.String> getControlTokens()
public static int getControlBitValue(java.lang.String token)
public static DocGen getInstance()
public static DocGen getInstance(java.lang.String compositeKey)
public java.lang.String getLineSeparator()
public void setLineSeparator(java.lang.String ls)
public int getDocGenControlBits()
public void clearDocGenControlBits()
public int addDocGenControlBits(int val)
val
- An integer representing bit valuespublic int addDocGenControlBits(java.lang.String token)
val
- An integer representing bit valuespublic boolean testDocGenControlBits(int valToTest)
valToTest
- An integer representing bit values to be testedpublic boolean testDocGenControlBits(java.lang.String token)
token
- A String token corresponding to a bit valuepublic static java.util.ArrayList<java.lang.String> getOutputFormatTokens(KB kb, java.lang.String ontology)
kb
- The KB in which to look for docGenOutputFormat statementsontology
- A SUO-KIF term denoting an Ontologypublic static java.lang.String getFirstHtmlFormatToken(KB kb, java.lang.String ontology)
kb
- The KB in which to look for docGenOutputFormat statementsontology
- A SUO-KIF term denoting an Ontologypublic java.lang.String getDefaultNamespace()
public void setDefaultNamespace(java.lang.String namespace)
public java.lang.String getDefaultPredicateNamespace()
public void setDefaultPredicateNamespace(java.lang.String namespace)
public void setOntology(java.lang.String term)
public java.lang.String getOntology()
public java.lang.String getOntology(KB kb)
public void setKB(KB kb)
public KB getKB()
protected java.util.Set getCodedIdentifiers(KB kb)
kb
- The KB in which to gather terms defined as coded
identifierspublic void setTitleText(java.lang.String titlestr)
titlestr
- A String that will be used as the HTML document
titlepublic java.lang.String getTitleText()
public void setFooterText(java.lang.String str)
str
- A String that will be used as the HTML document
footer textpublic java.lang.String getFooterText()
public void setStyleSheet(java.lang.String filename)
filename
- A String that is a base filename plus a
filename suffixpublic java.lang.String getStyleSheet()
public void setDefaultImageFile(java.lang.String filename)
filename
- A String that is a base filename plus a
filename suffixpublic java.lang.String getDefaultImageFile()
public void setDefaultImageFileMarkup(java.lang.String markup)
markup
- A String that includes the image file pathname
plus any additional markup required for proper display of the
imagepublic java.lang.String getDefaultImageFileMarkup()
public void setOutputDirectoryPath(java.lang.String pathname)
pathname
- A canonical pathname Stringpublic java.lang.String getOutputDirectoryPath()
public void setStringReplacementMap(java.util.Map keyValPairs)
public java.util.Map getStringReplacementMap()
public java.lang.String getStringReplacement(java.lang.String fromString)
fromString
- A String for which a replacement is soughtpublic void setInhibitDisplayRelations(java.util.Set relations)
relations
- A Set of predicate namespublic java.util.Set getInhibitDisplayRelations()
public void setTocHeader(java.lang.String header)
public java.lang.String getTocHeader()
public java.lang.String getDocGenKey()
public void setDocGenKey(java.lang.String key)
public static java.lang.String getKifNamespaceDelimiter()
public static java.lang.String getW3cNamespaceDelimiter()
public static java.lang.String getSafeNamespaceDelimiter()
public boolean getSimplified()
public void setSimplified(boolean val)
public java.util.HashMap getRelationsByKB()
public static java.lang.String indentChars(java.lang.String str, int indent)
str
- The String to be concatentated with itselfindent
- An int indicating the number of times str should
be concatenatedpublic void setOutputParentDir(java.io.File obj)
obj
- A File object representing a directorypublic void setOutputParentDir(java.lang.String pathname)
pathname
- A String representing a directory pathnamepublic void setOutputParentDir(java.util.List pathnameComponents)
pathname
- A String representing a directory pathnamepublic void setOutputParentDir(KB kb, java.lang.String ontology)
kb
- The KB containing a statement formed with the
predicate docGenOutputParentDirectory and ontologyontology
- The ontology referred to in a statement formed
with the predicate docGenOutputParentDirectory in kbpublic java.io.File getOutputParentDir()
public void setDisplayFilter(DocGen.DisplayFilter filterObj)
filterObj
- An instance of DisplayFilterpublic DocGen.DisplayFilter getDisplayFilter()
public java.util.SortedSet<java.lang.String> resortKbTerms(KB kb)
public java.util.TreeMap getAlphaList(KB kb)
stringMap
- is a map of String keys and valuespublic void clearAlphaList()
protected java.util.TreeMap createAlphaList(KB kb)
stringMap
- is a map of String keys and valuespublic static boolean isComposite(KB kb, java.lang.String term)
kb
- The KB in which to check the definition of termterm
- A SUO-KIF termpublic static java.util.ArrayList<java.lang.String> getRangeValueList(KB kb, java.lang.String predicate)
kb
- The KB from which to retrieve a statement with predicatepredicate
- public void setMetaDataFromKB(KB kb, java.lang.String ontology)
kb
- The KB from which to gather stated parameter valuesontology
- The ontology from which to gather stated
parameter valuesprotected static java.util.List<java.lang.String> getClientOntologyNames()
public java.lang.String createCompositePage(KB kb, java.lang.String kbHref, java.lang.String term, java.util.TreeMap alphaList, int limit, java.lang.String language, java.lang.String formatToken)
alphaList
- a TreeMap of TreeMaps of ArrayLists. @see
createAlphaList()public java.lang.String createPage(KB kb, java.lang.String kbHref, java.lang.String term, java.util.TreeMap alphaList, int limit, java.lang.String language, java.lang.String formatToken)
alphaList
- a TreeMap of TreeMaps of ArrayLists.createAlphaList()
public java.util.ArrayList<java.lang.String> getAllNamespaceDelimiters()
public java.lang.String generateHtmlDocStart(java.lang.String title)
title
- A String to be used as the document titleprotected java.lang.String generateHtmlFooter(java.lang.String footerText)
footerText
- The text String to be diplayed at the bottom
of an HTML documentprotected boolean isLegalForDisplay(java.lang.String term)
protected java.util.ArrayList<java.lang.String> getOntologyNamespaces(KB kb, java.lang.String ontology)
kb
- The KB in which ontologyNamespace statements will be
soughtontology
- The name of the ontology that will be checkedprotected java.util.ArrayList<java.lang.String> getNamespaceDelimiters(KB kb, java.lang.String ontology)
kb
- The KB that will be checked to find statements formed
with docGenNamespaceDelimiterontology
- The name of the ontology that will be checkedpublic java.util.ArrayList<java.lang.String> getNamespacePrefixes()
public java.util.ArrayList<java.lang.String> getNamespaces()
protected java.util.ArrayList<java.lang.String> getNamespaces(KB kb, java.lang.String ontology, boolean force)
kb
- The KB in which statements will be checkedontology
- The name of the ontology that will be checkedforce
- If true, this parameter will force the List of
namespaces to be recomputedprotected java.lang.String getNamespacePrefix(KB kb, java.lang.String term)
protected java.lang.String stripNamespacePrefix(KB kb, java.lang.String term)
protected java.lang.String toKifNamespace(KB kb, java.lang.String term)
kb
- The KB in which to determine if term is an namespaceterm
- A String denoting a namespace, perhaps in W3C formatprotected java.lang.String removeLinkableNamespacePrefixes(KB kb, java.lang.String text)
kb
- The KB is use when checking for valid namespace prefixestext
- The String in which all linkable SUO-KIF terms are
to be transformedprotected java.util.ArrayList getPredicates(KB kb, boolean requireNamespace)
kb
- The KB from which to gather all terms that are
instances of BinaryPredicateprotected boolean hasSubComponents(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String denoting a SUO-KIF constant nameprotected java.util.ArrayList getSubComponents(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that is a SUO-KIF constantprotected java.util.ArrayList getSuperComponents(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String, a SUO-KIF constantprotected java.lang.String getFirstTermFormat(KB kb, java.lang.String term, java.util.List contexts)
kb
- The KB in which term is definedterm
- A String that is a SUO-KIF constantcontexts
- A List of namespaces or other terms that index
context-specific termFormat statementsprotected java.lang.String getContextualDocumentation(KB kb, java.lang.String term, java.util.List contexts)
kb
- The KB in which term is definedterm
- A String that is a SUO-KIF constantcontexts
- A List of namespaces or other terms that index
context-specific documentation or comment statementsprotected java.lang.String getNearestContainingClass(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that is a SUO-KIF constantprotected java.lang.String getFirstSubsumingTerm(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF Class or Relationprotected java.lang.String getFirstGeneralTerm(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that is a SUO-KIF constantprotected java.util.ArrayList<java.lang.String> getFirstGeneralTerms(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF termprotected java.util.ArrayList<java.lang.String> getFirstSpecificTerms(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF termprotected java.util.ArrayList<java.lang.String> getSyntacticSubordinateTerms(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF termprotected java.util.ArrayList getFirstInstances(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF Classprotected java.lang.String getFirstContainingClass(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF termprotected java.util.ArrayList getFirstSubClasses(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF termprotected java.lang.String createDocs(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String language)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
documentation Strings in kbprotected java.lang.String createComments(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String language)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
comment Strings in kbprotected java.lang.String createSynonyms(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String formatToken)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termprotected java.lang.String createDisplayNames(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String formatToken)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termformatToken
- A String token that partly determines the
format of the outputprotected java.lang.String createHasSameComponents(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String language)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbprotected java.lang.String createUsingSameComponents(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String language)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbprotected java.lang.String createParents(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String language, java.util.Set parentsSet)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbparentsSet
- A Set for accumulating the parent terms of
termprotected java.lang.String createChildren(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String language)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbprotected java.lang.String createInstances(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String language, java.util.List excluded)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbexcluded
- A List of terms to be excluded from the displayprotected java.lang.String createFormula(KB kb, java.lang.String kbHref, java.lang.String indentSeq, int level, java.lang.String previousTerm, java.lang.String currentTerm, java.lang.String context)
kb
- The KB in which formula occurskbHref
- A String containing the constant parts of the
href link for the constants in formula, or an empty StringindentSeq
- A character sequence that will be used as the
indentation quantum for formulalevel
- The current indentation levelpreviousTerm
- A String, the term that occurs sequentially
before currentTerm in the same level of nesting. The value of
previousTerm aids in determining how a given Formula should be
formatted, and could be null.currentTerm
- A String denoting a SUO-KIF Formula or part
of a Formulacontext
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbprotected java.lang.String createRelations(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String language, java.lang.String formatToken)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbprotected java.lang.String showCardinalityCell(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String context)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termcontext
- A String denoting a SUO-KIF namespace, a natural
language, or other type of entity that indexes termFormat
Strings in kb -- this parameter is currently ignored, since
LocalInstance terms are already highly specificprotected java.lang.String createCompositeComponentLine(KB kb, java.lang.String kbHref, java.lang.String term, int indent, java.lang.String language)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termident
- A int value that determines the depth to which
term will be indented when displayedlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbpublic java.lang.String showTermName(KB kb, java.lang.String term, java.lang.String language)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or another type of entity that contextualizes
or indexes termFormat Strings in kbwithSpanTags
- If true, the returned String is wrapped in
HTML span tags that allow additional formatting for term via a
style sheetprotected java.lang.String formatCompositeHierarchy(KB kb, java.lang.String kbHref, java.util.List hier, java.lang.String language)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringhier
- A List containing term names and representing one
sub-branch in a treelanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbprotected java.util.ArrayList createCompositeRecurse(KB kb, java.lang.String term, boolean isAttribute, int indent)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF termisAttribute
- If true, this parameter indicates that term
denotes an XML attributeint
- An integer indicating the depth or level to which
term should be indented when displayedprotected boolean isXmlAttribute(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF termisAttribute
- If true, this parameter indicates that term
denotes an XML attributeint
- An integer indicating the depth or level to which
term should be indented when displayedprotected java.lang.String createContainingCompositeComponentLine(KB kb, java.lang.String kbHref, java.lang.String containingComp, java.lang.String instance, int indent, java.lang.String language)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty StringcontainingComp
- A String that denotes the term that
contains, or is syntactically superordinate to, instanceinstance
- A String that denotes a SUO-KIF termident
- An int value that determines the depth to which
instance will be indented when displayedlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbprotected java.lang.String formatContainingComposites(KB kb, java.lang.String kbHref, java.util.ArrayList containing, java.lang.String composite, java.lang.String language)
protected static boolean isSkipNode(KB kb, java.lang.String term)
protected java.util.ArrayList getContainingComposites(KB kb, java.lang.String term)
protected java.lang.String createBelongsToClass(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String language, java.util.Set<java.lang.String> parents)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbparents
- A Set containing the terms displayed in the
Parent field for term, to avoid duplication between the Parents
field and the Belongs to Class fieldprotected java.lang.String createBelongsToClass(KB kb, java.lang.String kbHref, java.lang.String term, java.lang.String language)
kb
- The KB in which term is definedkbHref
- A String containing the constant parts of the
href link for term, or an empty Stringterm
- A String that denotes a SUO-KIF termlanguage
- A String denoting a SUO-KIF namespace, a
natural language, or other type of entity that indexes
termFormat Strings in kbprotected java.util.ArrayList findContainingComposites(KB kb, java.lang.String term)
kb
- The KB in which term is definedterm
- A String that denotes a SUO-KIF termpublic java.lang.String createAllStatements(KB kb, java.lang.String kbHref, java.lang.String term, int limit)
public java.lang.String generateDynamicTOCHeader(java.lang.String kbHref)
protected java.lang.String generateTocHeader(KB kb, java.util.TreeMap alphaList, java.lang.String allname)
alphaList
- a TreeMap of TreeMaps of ArrayLists. @see
createAlphaList()protected java.lang.String generateTOCPage(KB kb, java.lang.String firstLetter, java.util.TreeMap alphaList, java.lang.String language)
alphaList
- a TreeMap of TreeMaps of ArrayLists. @see
createAlphaList()protected void saveIndexPages(KB kb, java.util.TreeMap alphaList, java.lang.String dir, java.lang.String language)
pageList
- is a map of all term pages keyed by term
namedir
- is the directory in which to save the pagesalphaList
- a TreeMap of TreeMaps of ArrayLists. @see
createAlphaList()protected void printHTMLPages(java.util.TreeMap pageList, java.lang.String dirpath)
protected java.io.File makeOutputDir(java.lang.String token)
token
- A token that indicates a type of output fileprotected java.util.TreeMap generateHTMLPages(KB kb, java.util.TreeMap alphaList, java.lang.String language, java.lang.String formatToken)
alphaList
- a TreeMap of TreeMaps of ArrayLists. @see
createAlphaList()inverseHeadwordMap
- is a HashMap where the keys are the
headwords and the values are ArrayLists of term
names (since headwords are not unique identifiers
for terms). If there's no headword, the term name is
used.public void generateHTML(KB kb, java.lang.String language, boolean simplified, java.lang.String formatToken)
simplified
- Indicates whether to present a "simplified"
view of terms, meaning using a termFormat or headword, rather
than the term name itselfpublic void generateSingleHTML(KB kb, java.lang.String dir, java.util.TreeMap alphaList, java.lang.String language, boolean simplified)
alphaList
- a TreeMap of TreeMaps of ArrayLists.simplified
- Indicates whether to present a "simplified"
view of terms, meaning using a termFormat or headword, rather
than the term name itselfletter-> formattedTerm1->term11,term12...term1N
formattedTerm2->term21,term22...term2N
public void generateSingleHTML(KB kb, java.lang.String language, boolean simplified) throws java.io.IOException
java.io.IOException
protected java.util.ArrayList getSubordinateAttributes(KB kb, java.lang.String kifTerm)
protected java.util.ArrayList getSubordinateElements(KB kb, java.lang.String kifTerm)
protected java.util.ArrayList getSyntacticExtensionTerms(KB kb, java.lang.String term, int targetArgnum, boolean computeClosure)
protected java.util.ArrayList getSyntacticUnionTerms(KB kb, java.lang.String term, int targetArgnum)
protected java.util.ArrayList getSyntacticCompositeTerms(KB kb, java.lang.String term, int targetArgnum)
protected java.lang.String getClosestXmlDataType(KB kb, java.lang.String term)
protected static boolean isInstanceOf(KB kb, java.lang.String i, java.lang.String c)
kb
- A KB objecti
- A String denoting an instancec
- A String denoting a Classprotected java.lang.String getFirstDatatype(KB kb, java.lang.String term)
protected java.util.ArrayList getDatatypeTerms(KB kb, java.lang.String term, int targetArgnum)
protected boolean isDataType(KB kb, java.lang.String term)
public java.lang.String getTermPresentationName(KB kb, java.lang.String term)
public java.lang.String getTermPresentationName(KB kb, java.lang.String namespace, java.lang.String term)
public java.lang.String getTermPresentationName(KB kb, java.lang.String namespace, java.lang.String term, boolean withSpanTags)
public void sortByPresentationName(KB kb, java.lang.String namespaceTerm, java.util.List stringList)
kb
- The KB from which to obtain the presentation namesnamespaceTerm
- A KIF term denoting a namespacestringList
- The List of Strings to be sortedprotected void sortByTermLength(java.util.List terms)
public java.lang.String getTermNamespace(KB kb, java.lang.String term)
protected java.lang.String processDocString(KB kb, java.lang.String kbHref, java.lang.String namespace, java.lang.String docString, boolean isXmlDoc, boolean addHrefs)
isXmlDoc
- If true, HTML character entities will be
replaced with their ASCII equivalents, when
possibleaddHrefs
- If true, HTML anchor markup will be added
for recognized termspublic static void writeToStream(java.util.List<java.lang.String> data, java.io.OutputStream stream)
data
- A List of String objectsstream
- An OutputSteam objectpublic static boolean emptyString(java.lang.String s)
public static boolean isNonEmptyString(java.lang.String s)
public java.util.ArrayList readSpreadsheetFile(java.lang.String inpath, char delimiter, int delimitersPerRow, java.util.List<java.lang.String> rowFlags)
fname
- The pathname of the file to be processeddelimiter
- A char that delimits each field in a rowdelimitersPerRow
- An int that indicates the number of
expected delimiter chars per rowrowFlags
- A List of the tokens (Strings) that indicate
the start of a new rowprotected void convertRowStringsToLists(java.util.List rows, char delimiter)
rows
- A List of char-delimited Strings. The list is
processed in place, and will contain only Lists when
processing is finished.delimiter
- A char that delimits each field in line.protected int countDelimiters(java.lang.String line, char delimiter)
line
- A line of data fields that are separated by
occurrences of a delimiter char.delimiter
- A char that delimits each field in line.public static void main(java.lang.String[] args)