|
|||||||||
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.
Inner Class Summary | |
class |
ExportHtml.Category
Provides a container for term category information used to make vocabulary category HTML pages. |
Field Summary | |
java.util.ArrayList |
categories
List of HTML vocabulary category page information items. |
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 static int |
DEFAULT_VERBOSITY
The default verbosity of the HTML export output. |
static Guid |
eeldSharedOntologyCandidateConstantGuid
The #$EELDSharedOntologyConstant guid. |
static Guid |
eeldSharedOntologyConstantGuid
The #$EELDSharedOntologyConstant guid. |
static Guid |
eeldSharedOntologyCoreConstantGuid
The #$EELDSharedOntologyCoreConstant guid. |
static Guid |
equalSymbolsGuid
#$equalSymbols 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 java.util.ArrayList |
filterFromDirectInstanceGuids
Additional term guids not to appear in the list of direct instances even if otherwise qualified to appear. |
protected java.util.ArrayList |
filterFromDirectInstances
Additional terms not to appear in the list of direct instances even if otherwise qualified to appear. |
protected boolean |
hasComment
Indicates the presence of a comment for the current term. |
protected java.lang.String |
hostname
|
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. |
static Guid |
inferencePSCGuid
#$InferencePSC guid |
java.lang.String |
nartNoteOutputPath
The NART note file name. |
protected int |
port
|
protected java.util.HashSet |
previouslyExpandedTerms
indicates which terms have been previously expanded in the hierarchy page |
boolean |
print_guid
Export the GUID string for each term? |
boolean |
produceHierarchyPages
Indicates whether hierarchy pages are produced. |
static Guid |
publicConstantGuid
The #$PublicConstant guid. |
static Guid |
rewriteOfGuid
#$rewriteOf guid |
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 |
java.util.ArrayList |
upwardClosureKbSubsetCollectionGuids
Upward closure filtering kb subset collections guids. |
protected java.util.ArrayList |
upwardClosureKbSubsetCollections
Upward closure filtering kb subset collections. |
int |
verbosity
Sets verbosity of the HTML export output. |
Constructor Summary | |
ExportHtml()
Constructs a new ExportHtml object. |
|
ExportHtml(java.lang.String hostname,
int port)
Constructs a new ExportHtml object which will connect to the cyc server at hostname, port. |
|
ExportHtml(java.lang.String hostname,
int port,
boolean print_guid)
Constructs a new ExportHtml object which will connect to the cyc server at hostname, port. |
Method Summary | |
protected void |
addAllActorSlots()
Categorizes all actorslots. |
protected void |
addAllBinaryPredicates()
Categorizes all binary predicates. |
protected void |
addAllCategories()
Adds all categories to the HTML export. |
protected void |
addAllDenotingFunctions()
Categorizes all denoting functions. |
protected void |
addAllEventTypes()
Categorizes all event types. |
protected void |
addAllIETRef()
Categorizes all ontology constants directly referenced in the IET Mapping. |
protected void |
addAllMaterials()
Categorizes all 'materials'. |
protected void |
addAllOrganizationTypes()
Categorizes all organization types. |
protected void |
addAllPartonomicPredicates()
Categorizes all partonomic predicates. |
protected void |
addAllPersonTypes()
Categorizes all person types. |
protected void |
addAllRelations()
Categorizes all relations. |
protected void |
addAllSchemaMappingTypes()
Categorizes all schema mapping types. |
protected void |
addAllScriptedEventTypes()
Categorizes all scripted event types. |
protected void |
addAllSpecializationsOfAffiliation()
Categorizes all specializations of affiliation. |
protected void |
addAllSpecializationsOfVestedInterest()
Categorizes all specializations of vested interest. |
protected void |
addAllSraRef()
Categorizes all constants directly reference in the SRA NetOwl Mapping. |
protected void |
addAllSyracuseRef()
Categorizes all ontology constants directly referenced in the Syracuse Mapping. |
protected void |
addAllTemporalRelations()
Categorizes all temporal relations. |
protected void |
addAllVeridianRef()
Categorizes all ontology constants directly referenced in the Veridian Mapping. |
protected void |
addAllWeaponTypes()
Categorizes all weapon types. |
protected void |
addEeldCoreOntology()
Categorizes the original EELD 'core' ontology. |
protected void |
addPublicSharedOntology()
Categorizes all public shared ontology constants. |
protected void |
addScriptRepresentationVocabulary()
Categorizes script representation vocabulary. |
protected void |
addSemanticConstraintVocabulary()
Categorizes semantic constraint vocabulary. |
protected void |
askEeldCoreOntology()
Categorizes the original EELD 'core' ontology. |
protected CycList |
askQueryString(java.lang.String queryString,
CycConstant mt)
Returns the sorted terms resulting from asking the given query string. |
protected void |
createArg1IsaNodes(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates HTML nodes for arg1Isa links. |
protected void |
createArg2IsaNodes(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates HTML nodes for arg2Isa links. |
protected void |
createArg3IsaNodes(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates HTML nodes for arg3Isa links. |
protected void |
createArg4IsaNodes(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates HTML nodes for arg4Isa links. |
protected void |
createCategorizedVocabularies()
Creates categorized vocabulary HTML pages. |
protected void |
createCategorizedVocabulary(java.lang.String title,
java.lang.String queryString,
CycConstant mt,
java.lang.String outputPath)
Creates the given categorized vocabulary HTML page. |
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 |
createFunctionNode(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates an HTML node for a single Cyc function. |
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 |
createResultIsaNodes(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Creates HTML nodes for resultIsa links. |
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 boolean |
isEligibleForUpwardClosureInclusion(CycFort cycFort)
Returns true if the given term is eligible for incusion in the upward closure. |
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 boolean |
processRewriteOf(CycConstant cycConstant,
org.w3c.dom.Element parentElement)
Processes the case where the given Cyc constant has a #$rewriteOf relationship to a Cyc FORT (First Order Reified Term). |
protected void |
processRewrittenNart(java.lang.Object object,
org.w3c.dom.Element parentElement)
Creates nodes for rewritten NARTs. |
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 boolean produceHierarchyPages
public java.util.ArrayList upwardClosureKbSubsetCollectionGuids
protected java.util.ArrayList upwardClosureKbSubsetCollections
public CycFort cycKbSubsetCollection
public static final Guid eeldSharedOntologyConstantGuid
public static final Guid eeldSharedOntologyCandidateConstantGuid
public static final Guid eeldSharedOntologyCoreConstantGuid
public static final Guid counterTerrorismConstantGuid
public static final Guid ikbConstantGuid
public static final Guid publicConstantGuid
public Guid cycKbSubsetCollectionGuid
public Guid cycKbSubsetFilterGuid
protected CycFort cycKbSubsetFilter
public Guid rootTermGuid
public CycFort rootTerm
public static final Guid rewriteOfGuid
public static final Guid equalSymbolsGuid
public static final Guid inferencePSCGuid
public java.lang.String exportedVocabularyOutputPath
public java.lang.String exportedHierarchyOutputPath
public java.lang.String nartNoteOutputPath
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
protected java.lang.String hostname
protected int port
protected java.util.ArrayList filterFromDirectInstanceGuids
protected java.util.ArrayList filterFromDirectInstances
public boolean print_guid
public java.util.ArrayList categories
Constructor Detail |
public ExportHtml()
public ExportHtml(java.lang.String hostname, int port)
hostname
- the cyc server hostnameport
- the cyc server base portpublic ExportHtml(java.lang.String hostname, int port, boolean print_guid)
hostname
- the cyc server hostnameport
- the cyc server base portprint_guid
- gates guid presence in the HTML documentMethod 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 boolean processRewriteOf(CycConstant cycConstant, org.w3c.dom.Element parentElement) throws java.net.UnknownHostException, java.io.IOException, CycApiException
cycConstant
- the given CycConstant for processing if a #$rewriteOfparentElement
- the parent HTML element for inserting rewriteOf textprotected void processRewrittenNart(java.lang.Object object, org.w3c.dom.Element parentElement) throws java.net.UnknownHostException, java.io.IOException, CycApiException
object
- the given ojbect for processing in a #$rewriteOfparentElement
- the parent HTML element for inserting rewriteOf textprotected 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 elementprotected 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 elementprotected 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 elementprotected 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 elementprotected CycList specificCollections(CycList collections) throws java.io.IOException, CycApiException
collections
- the given set of collection termsprotected void createPredicateNode(CycConstant cycConstant, org.w3c.dom.Element parentElement) throws java.net.UnknownHostException, java.io.IOException, CycApiException
parentElement
- the parent HTML DOM elementprotected void createFunctionNode(CycConstant cycConstant, org.w3c.dom.Element parentElement) throws java.net.UnknownHostException, java.io.IOException, CycApiException
parentElement
- the parent HTML DOM elementprotected 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 elementprotected void createArg1IsaNodes(CycConstant cycConstant, org.w3c.dom.Element parentElement) throws java.io.IOException, CycApiException
cycConstant
- the CycConstant for which arg1Isa links are to be createdparentElement
- the parent HTML DOM elementprotected void createArg2IsaNodes(CycConstant cycConstant, org.w3c.dom.Element parentElement) throws java.io.IOException, CycApiException
cycConstant
- the CycConstant for which arg2Isa links are to be createdparentElement
- the parent HTML DOM elementprotected void createArg3IsaNodes(CycConstant cycConstant, org.w3c.dom.Element parentElement) throws java.io.IOException, CycApiException
cycConstant
- the CycConstant for which arg3Isa links are to be createdparentElement
- the parent HTML DOM elementprotected void createArg4IsaNodes(CycConstant cycConstant, org.w3c.dom.Element parentElement) throws java.io.IOException, CycApiException
cycConstant
- the CycConstant for which arg4Isa links are to be createdparentElement
- the parent HTML DOM elementprotected void createResultIsaNodes(CycConstant cycConstant, org.w3c.dom.Element parentElement) throws java.io.IOException, CycApiException
cycConstant
- the CycConstant for which resultIsa links are to be createdparentElement
- the parent HTML DOM elementprotected void createIndividualNode(CycConstant cycConstant, org.w3c.dom.Element parentElement) throws java.net.UnknownHostException, java.io.IOException, CycApiException
parentElement
- the parent HTML DOM elementprotected void createCollectionNode(CycConstant cycConstant, org.w3c.dom.Element parentElement) throws java.net.UnknownHostException, java.io.IOException, CycApiException
parentElement
- the parent HTML DOM elementprotected void createHierarchyPage(CycFort rootTerm) throws java.net.UnknownHostException, java.io.IOException, CycApiException
rootTerm
- the root term of the hierarchy treeprotected 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 levelprotected 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
protected boolean isEligibleForUpwardClosureInclusion(CycFort cycFort) throws java.net.UnknownHostException, java.io.IOException, CycApiException
cycFort
- the given termprotected void createCategorizedVocabularies() throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void createCategorizedVocabulary(java.lang.String title, java.lang.String queryString, CycConstant mt, java.lang.String outputPath) throws java.net.UnknownHostException, java.io.IOException, CycApiException
title
- the title of the categorized vocabulary HTML pagequeryString
- the query string which finds the terms in the
categorymt
- the mt in which the query is askedoutputPath
- the name of the output HTML pageprotected void addAllCategories() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllIETRef() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllSyracuseRef() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllSraRef() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllVeridianRef() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllSchemaMappingTypes() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addScriptRepresentationVocabulary() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addSemanticConstraintVocabulary() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllPersonTypes() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllOrganizationTypes() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllEventTypes() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllMaterials() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllWeaponTypes() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllRelations() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllBinaryPredicates() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllActorSlots() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllTemporalRelations() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllPartonomicPredicates() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllSpecializationsOfAffiliation() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllSpecializationsOfVestedInterest() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllDenotingFunctions() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addAllScriptedEventTypes() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addEeldCoreOntology() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void addPublicSharedOntology() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected void askEeldCoreOntology() throws CycApiException, java.io.IOException, java.net.UnknownHostException
protected CycList askQueryString(java.lang.String queryString, CycConstant mt) throws CycApiException, java.io.IOException, java.net.UnknownHostException
queryString
- the query, as a stringmt
- the mt in which the query is asked
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |