|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.xml.ExportDaml
DAML+OIL 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 | |
CycList |
applicableBinaryPredicates
List of applicable binary predicates. |
CycFort |
cycKbSubsetCollection
The CycKBSubsetCollection whose elements are exported to DAML. |
Guid |
cycKbSubsetCollectionGuid
The CycKBSubsetCollection whose elements are exported to DAML. |
protected CycFort |
cycKbSubsetFilter
The CycKBSubsetCollection whose elements are exported to DAML if they also generalizations of cycKbSubsetCollectionGuid collections or predicates above. |
Guid |
cycKbSubsetFilterGuid
The guid which identifies the CycKBSubsetCollection whose elements are exported to DAML if they also generalizations of cycKbSubsetCollectionGuid collections or predicates above. |
protected static int |
DEFAULT_VERBOSITY
The default verbosity of the DAML export output. |
static int |
EXPORT_ENTIRE_KB
Command indicating that the DAML export contains all the terms in the KB. |
static int |
EXPORT_KB_SUBSET
Command indicating that the DAML export contains only the marked KB subset terms. |
static int |
EXPORT_KB_SUBSET_BELOW_TERM
Command indicating that the DAML 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 DAML 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 DAML extract process. |
boolean |
includeUpwardClosure
Indicates whether the upward closure of terms should be exported. |
java.lang.String |
outputPath
The DAML export path and file name. |
CycFort |
rootTerm
Used in the export command EXPORT_KB_SUBSET_BELOW_TERM. |
Guid |
rootTermGuid
Used in the export command EXPORT_KB_SUBSET_BELOW_TERM. |
java.lang.String |
title
The DAML comment that titles the output file. |
int |
verbosity
Sets verbosity of the DAML export output. |
Constructor Summary | |
ExportDaml(CycAccess cycAccess)
Constructs a new ExportDaml object given the CycAccess object. |
Method Summary | |
protected java.util.ArrayList |
applyCycKbSubsetFilter(CycList constants)
Removes terms from the given list which are not elements of cycKbSubsetFilter. |
protected CycConstant |
bestIsaForIndividual()
Returns the best isa for the current Individual term. |
protected void |
createClassNode(CycConstant cycConstant)
Creates a DAML class node for a single Cyc collection. |
protected void |
createConstantNode(CycConstant cycConstant)
Creates a DAML node for a single Cyc Constant. |
protected void |
createCycGuidNode()
Creates the DAML node that defines the guid property. |
protected void |
createDamlOntologyNode()
Creates a DAML Ontology node. |
protected void |
createIndividualNode(CycConstant cycConstant)
Creates a DAML individual node for a single Cyc individual. |
protected void |
createPropertyAssertionNodes(org.w3c.dom.Element node)
Creates a property assertions node for the given Element. |
protected void |
createPropertyNode(CycConstant cycConstant)
Creates a DAML property node for a single Cyc binary predicate. |
protected void |
createRdfNode()
Creates an RDF node. |
void |
export(int exportCommand)
Exports the desired KB content into DAML. |
protected CycList |
filterSelectedConstants(CycList constants)
Removes unselected terms from the given list. |
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 genlPreds for predicate terms. |
protected boolean |
isFilteredDamlSelectedConstant(java.lang.Object object)
Return True iff the object is a selected constant. |
protected boolean |
isFilteredSelectedConstant(java.lang.Object object)
Return True iff the object is a instance of the desired KB subset collection |
protected void |
populateArg1Format(CycConstant cycConstant)
Populates the argument 1 format for a Cyc predicate. |
protected void |
populateArg1Isa(CycConstant cycConstant)
Populates the argument 1 type constaint for a Cyc predicate. |
protected void |
populateArg2Format(CycConstant cycConstant)
Populates the argument 2 format for a Cyc predicate. |
protected void |
populateArg2Isa(CycConstant cycConstant)
Populates the argument 2 type constaint for a Cyc predicate. |
protected void |
populateCoExtensionals(CycConstant cycConstant)
Populates the coExtensionals for a Cyc collection. |
protected void |
populateComment(CycConstant cycConstant)
Populates the comment for a Cyc term. |
protected void |
populateDisjointWiths(CycConstant cycConstant)
Populates the disjointWiths for a Cyc collection. |
protected void |
populateGenlPreds(CycConstant cycConstant)
Populates the genlPreds for a Cyc predicate. |
protected void |
populateGenls(CycConstant cycConstant)
Populates the genls for a Cyc term. |
protected void |
populateIsas(CycConstant cycConstant)
Populates the isas for a Cyc term. |
protected void |
populatePropertyAssertions(CycConstant cycConstant)
Populates the non-definitional ground atomic formulas in which the the predicate is an element of the list of applicable binary predicates and in which the given term appears as the first argument. |
protected void |
setup()
Sets up the DAML export process. |
protected CycList |
substituteGenlConstantsForNarts(CycList cycForts)
Substitutes more general collection constants for functional collection terms. |
protected java.lang.String |
translateTerm(CycConstant cycConstant)
Translates a Cyc term into a kind of DAML node: DAML Thing, DAML class, DAML property or DAML transitive property. |
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
public static final int EXPORT_ENTIRE_KB
protected int exportCommand
protected static final int DEFAULT_VERBOSITY
public int verbosity
public boolean includeUpwardClosure
public CycFort cycKbSubsetCollection
public Guid cycKbSubsetCollectionGuid
public Guid cycKbSubsetFilterGuid
protected CycFort cycKbSubsetFilter
public CycList applicableBinaryPredicates
public Guid rootTermGuid
public CycFort rootTerm
public java.lang.String outputPath
public java.lang.String title
Constructor Detail |
public ExportDaml(CycAccess cycAccess)
cycAccess
- the CycAccess object which manages the api connectionMethod Detail |
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 createRdfNode()
protected void createDamlOntologyNode()
protected void createConstantNode(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void createClassNode(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void createPropertyAssertionNodes(org.w3c.dom.Element node) throws java.net.UnknownHostException, java.io.IOException, CycApiException
element
- the given elementprotected void createIndividualNode(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected CycConstant bestIsaForIndividual() throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void createCycGuidNode()
protected void createPropertyNode(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected java.lang.String translateTerm(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populateComment(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected java.util.ArrayList applyCycKbSubsetFilter(CycList constants) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected CycList filterSelectedConstants(CycList constants)
protected CycList substituteGenlConstantsForNarts(CycList cycForts) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected boolean isFilteredDamlSelectedConstant(java.lang.Object object)
protected boolean isFilteredSelectedConstant(java.lang.Object object) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populateIsas(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populateGenls(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populateGenlPreds(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populateArg1Isa(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populateArg2Isa(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populateArg1Format(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populateArg2Format(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populateDisjointWiths(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populateCoExtensionals(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
protected void populatePropertyAssertions(CycConstant cycConstant) throws java.net.UnknownHostException, java.io.IOException, CycApiException
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 |