|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.opencyc.xml.ExportHtml
HTML ontology export for OpenCyc.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| Field Summary | |
static Guid |
counterTerrorismConstantGuid
The #$CounterTerrorismConstant guid. |
protected CycAccess |
cycAccess
Manages connection to the cyc server api. |
CycFort |
cycKbSubsetCollection
The CycKBSubsetCollection whose elements are exported to HTML. |
Guid |
cycKbSubsetCollectionGuid
The CycKBSubsetCollection whose elements are exported to HTML. |
protected CycFort |
cycKbSubsetFilter
The CycKBSubsetCollection whose elements are exported to HTML if they also generalizations of cycKbSubsetCollectionGuid collections or predicates above. |
Guid |
cycKbSubsetFilterGuid
The guid which identifies the CycKBSubsetCollection whose elements are exported to HTML if they also generalizations of cycKbSubsetCollectionGuid collections or predicates above. |
protected CycConstant |
cycLConstant
|
static Guid |
cycLConstantGuid
The #$CycLConstant guid. |
protected static int |
DEFAULT_VERBOSITY
The default verbosity of the HTML export output. |
static Guid |
eeldSharedOntologyConstantGuid
The #$EELDSharedOntologyConstant guid. |
static Guid |
eeldSharedOntologyCoreConstantGuid
The #$EELDSharedOntologyCoreConstant guid. |
static int |
EXPORT_KB_SUBSET
Command indicating that the HTML export contains only the marked KB subset terms. |
static int |
EXPORT_KB_SUBSET_BELOW_TERM
Command indicating that the HTML export contains the collections whose direct or indirect genl is the collection term indentified by rootTermGuid. |
static int |
EXPORT_KB_SUBSET_PLUS_UPWARD_CLOSURE
Command indicating that the HTML export contains the marked KB subset terms plus all the terms in the upward closure to #$Thing. |
protected int |
exportCommand
The command performed by the HTML extract process. |
java.lang.String |
exportedHierarchyOutputPath
The HTML exported hierarchy path and file name. |
java.lang.String |
exportedVocabularyOutputPath
The HTML exported vocabulary path and file name. |
protected boolean |
hasComment
Indicates the presence of a comment for the current term. |
protected org.w3c.dom.Element |
htmlBodyElement
the HTML body element |
protected org.w3c.dom.html.HTMLDocument |
htmlDocument
the html document |
static Guid |
ikbConstantGuid
The #$IKBConstant guid. |
boolean |
includeUpwardClosure
Indicates whether the upward closure of terms should be exported. |
protected java.util.HashSet |
previouslyExpandedTerms
indicates which terms have been previously expanded in the hierarchy page |
CycFort |
rootTerm
Used in the export command EXPORT_KB_SUBSET_BELOW_TERM. |
Guid |
rootTermGuid
Used in the export command EXPORT_KB_SUBSET_BELOW_TERM. |
protected CycList |
selectedCycForts
the selected terms |
int |
verbosity
Sets verbosity of the HTML export output. |
| Constructor Summary | |
ExportHtml()
Constructs a new ExportHtml object. |
|
| Method Summary | |
protected void |
createCollectionNode(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates an HTML node for a single Cyc collection. |
protected void |
createCommentNodes(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates HTML nodes for comment text containing CycConstants which are to be represented as hyperlinks. |
protected void |
createCycConstantNode(CycConstant cycConstant)
Creates a HTML node for a single Cyc Constant. |
protected void |
createCycNartNode(CycNart cycNart)
Creates a HTML node for a single Cyc Nart. |
protected void |
createGenlNodes(CycFort cycFort,
org.w3c.dom.Element parentElement)
Creates HTML nodes for genl links. |
protected void |
createGenlPredsNodes(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates HTML nodes for genlPreds links. |
protected void |
createGuidNode(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates HTML node for guid. |
protected void |
createHierarchyNodes(CycFort cycFort,
int indent)
Recursively creates hierarchy nodes for the given term and its spec collection terms. |
protected void |
createHierarchyPage(CycFort rootTerm)
Creates hierarchy HTML page. |
protected void |
createIndividualNode(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates an HTML individual node for a single Cyc individual. |
protected void |
createIsaNodes(CycFort cycFort,
org.w3c.dom.Element parentElement)
Creates HTML nodes for isa links. |
protected void |
createPredicateNode(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates an HTML node for a single Cyc predicate. |
protected void |
createVocabularyPage()
Creates vocabulary HTML page. |
void |
export(int exportCommand)
Exports the desired KB content into HTML. |
protected CycList |
filterSelectedConstants(CycList constants)
Removes unselected terms from the given list. |
protected CycFort |
findSelectedGenls(CycFort collection)
Returns the first indirect genls above the given term which is a member of the selected terms. |
protected CycList |
gatherUpwardClosure(CycList selectedCycForts)
Gather the updward closure of the selected CycForts with regard to isas and genls for collection terms, and with regard to isas and genlPreds for predicate terms. |
protected void |
horizontalRule()
Creates a horizontal rule in the HTML document. |
protected org.w3c.dom.Element |
italics(org.w3c.dom.Element parentElement)
Creates an italics element in the HTML document. |
protected void |
lineBreak(org.w3c.dom.Element parentElement)
Creates a line break in the HTML document. |
static void |
main(java.lang.String[] args)
Runs the ExportHtml application. |
protected void |
paragraphBreak()
Creates a paragraph break in the HTML document. |
protected void |
serialize(org.w3c.dom.html.HTMLDocument htmlDocument,
java.lang.String outputPath)
Serializes the given HTML document to the given path. |
protected void |
setup()
Sets up the HTML export process. |
protected CycList |
specificCollections(CycList collections)
Given a set of collection terms, returns a set which does not contain any collections are more genl than the remaining collections. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int EXPORT_KB_SUBSET
public static final int EXPORT_KB_SUBSET_PLUS_UPWARD_CLOSURE
public static final int EXPORT_KB_SUBSET_BELOW_TERM
protected int exportCommand
protected static final int DEFAULT_VERBOSITY
public int verbosity
public boolean includeUpwardClosure
public CycFort cycKbSubsetCollection
public static final Guid eeldSharedOntologyConstantGuid
public static final Guid eeldSharedOntologyCoreConstantGuid
public static final Guid counterTerrorismConstantGuid
public static final Guid ikbConstantGuid
public static final Guid cycLConstantGuid
protected CycConstant cycLConstant
public Guid cycKbSubsetCollectionGuid
public Guid cycKbSubsetFilterGuid
protected CycFort cycKbSubsetFilter
public Guid rootTermGuid
public CycFort rootTerm
public java.lang.String exportedVocabularyOutputPath
public java.lang.String exportedHierarchyOutputPath
protected org.w3c.dom.html.HTMLDocument htmlDocument
protected CycAccess cycAccess
protected org.w3c.dom.Element htmlBodyElement
protected CycList selectedCycForts
protected boolean hasComment
protected java.util.HashSet previouslyExpandedTerms
| Constructor Detail |
public ExportHtml()
| Method Detail |
public static void main(java.lang.String[] args)
args - the command line arguments.
public void export(int exportCommand)
throws java.net.UnknownHostException,
java.io.IOException,
CycApiException
protected void setup()
throws java.net.UnknownHostException,
java.io.IOException,
CycApiException
protected void createVocabularyPage()
throws java.net.UnknownHostException,
java.io.IOException,
CycApiException
protected void createCycNartNode(CycNart cycNart)
throws java.net.UnknownHostException,
java.io.IOException,
CycApiException
protected void createCycConstantNode(CycConstant cycConstant)
throws java.net.UnknownHostException,
java.io.IOException,
CycApiException
protected void paragraphBreak()
protected org.w3c.dom.Element italics(org.w3c.dom.Element parentElement)
parentElement - the parent HTML DOM elementprotected void lineBreak(org.w3c.dom.Element parentElement)
parentElement - the parent HTML DOM elementprotected void horizontalRule()
protected void createCommentNodes(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
throws java.io.IOException,
CycApiException
cycConstant - the CycConstant for which isa links are to be createdparentElement - the parent HTML DOM element
protected void createGuidNode(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
throws java.io.IOException,
CycApiException
cycConstant - the CycConstant for which isa links are to be createdparentElement - the parent HTML DOM element
protected void createIsaNodes(CycFort cycFort,
org.w3c.dom.Element parentElement)
throws java.io.IOException,
CycApiException
cycConstant - the CycConstant for which isa links are to be createdparentElement - the parent HTML DOM element
protected CycFort findSelectedGenls(CycFort collection)
throws java.io.IOException,
CycApiException
collection - the cyc collection which is not a member of the selected terms.
protected void createGenlNodes(CycFort cycFort,
org.w3c.dom.Element parentElement)
throws java.io.IOException,
CycApiException
cycConstant - the CycConstant for which genl links are to be createdparentElement - the parent HTML DOM element
protected CycList specificCollections(CycList collections)
throws java.io.IOException,
CycApiException
collections - the given set of collection terms
protected void createGenlPredsNodes(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
throws java.io.IOException,
CycApiException
cycConstant - the CycConstant for which genlPreds links are to be createdparentElement - the parent HTML DOM element
protected void createIndividualNode(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
throws java.net.UnknownHostException,
java.io.IOException,
CycApiException
parentElement - the parent HTML DOM element
protected void createCollectionNode(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
throws java.net.UnknownHostException,
java.io.IOException,
CycApiException
parentElement - the parent HTML DOM element
protected void createPredicateNode(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
throws java.net.UnknownHostException,
java.io.IOException,
CycApiException
parentElement - the parent HTML DOM element
protected void createHierarchyPage(CycFort rootTerm)
throws java.net.UnknownHostException,
java.io.IOException,
CycApiException
rootTerm - the root term of the hierarchy tree
protected void createHierarchyNodes(CycFort cycFort,
int indent)
throws java.io.IOException,
CycApiException
cycFort - the given term for which hierarchy nodes will be createdindent - the current indent level
protected void serialize(org.w3c.dom.html.HTMLDocument htmlDocument,
java.lang.String outputPath)
throws java.io.IOException
htmlDocument - the HTML document model for serializationoutputPath - the file name of the serialized HTML documentprotected CycList filterSelectedConstants(CycList constants)
protected CycList gatherUpwardClosure(CycList selectedCycForts)
throws java.net.UnknownHostException,
java.io.IOException,
CycApiException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||