|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.api.CycAccess | +--org.opencyc.kif.CycAssertionsFactory
Provides wrappers for the OpenCyc API.
Extends the CycAccess class.
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 classes inherited from class org.opencyc.api.CycAccess |
CycAccess.TraceWithNamesInfo |
Field Summary | |
static CycConstant |
argGenl
|
static CycConstant |
argIsa
|
static CycConstant |
cycadministrator
|
static CycConstant |
cycBasedProject
|
static CycConstant |
cycFalse
|
static CycConstant |
cyclist
|
static CycConstant |
cyclistDefinitionalMt
|
static CycConstant |
cycNull
|
static CycConstant |
cycTrue
|
static CycConstant |
cycVoid
|
static CycConstant |
functionalRelation
|
static CycConstant |
genlpreds
|
static CycConstant |
makeCycConstantError
|
static CycConstant |
metaRelation
|
static CycConstant |
microtheory
|
static CycConstant |
opencycproject
|
static CycConstant |
predarity
|
static CycConstant |
predicate
|
static CycConstant |
relation
|
static CycConstant |
resultGenl
|
static CycConstant |
resultIsa
|
Fields inherited from class org.opencyc.api.CycAccess |
and, askCache, baseKB, binaryPredicate, bookkeepingMt, collection, comment, communicationMode, countAllInstancesCache, cycAccessInstances, cycConnection, DEFAULT_CONNECTION, deferObjectCompletion, different, elementOf, genlMt, genls, hostName, inferencePSC, isa, isCollectionCache, isGenlOfCache, messagingMode, not, numericallyEqual, OK_RESPONSE_CODE, or, PERSISTENT_CONNECTION, persistentConnection, plusFn, port, saveTrace, sharedCycAccessInstance, thing, traceWithNames, traceWithNamesStack, TRANSIENT_CONNECTION, universalVocabularyMt |
Constructor Summary | |
CycAssertionsFactory()
Constructs a new CycAssertionsFactory object. |
|
CycAssertionsFactory(java.lang.String hostName,
int basePort,
int communicationMode,
boolean persistentConnection)
Constructs a new CycAssertionsFactory object given a host name, port, communication mode and persistence indicator. |
|
CycAssertionsFactory(java.lang.String myAgentName,
java.lang.String cycProxyAgentName,
int agentCommunity)
Constructs a new CycAssertionsFactory object to the given CycProxyAgent in the given agent community. |
Method Summary | |
static java.lang.Integer |
arityFromString(java.lang.String term)
|
static java.lang.String |
aryFromInt(int term)
|
static java.lang.String |
aryFromString(java.lang.String term)
|
void |
assertGafNoWff(CycFort mt,
CycConstant predicate,
java.lang.Object arg1,
java.lang.Object arg2)
Asserts a ground atomic formula (gaf) in the specified microtheory MT. |
void |
assertGafNoWff(CycFort mt,
CycConstant predicate,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Asserts a ground atomic formula (gaf) in the specified microtheory MT. |
void |
assertGenlMt(CycFort mt1,
CycFort mt2)
Asserts a genlMt formula in BaseKB. |
void |
assertGenlMt(CycFort mt1,
java.lang.String mt2)
Asserts a genlMt formula in BaseKB. |
void |
assertWithTranscriptNoWffCheck(CycList sentence,
CycFort mt)
Asserts the given sentence and also places it on the transcript queue with default strength and direction. |
void |
assertWithTranscriptNoWffCheck(java.lang.String sentence,
CycFort mt)
Asserts the given sentence and also places it on the transcript queue with default strength and direction. |
void |
createFunction(java.lang.String microtheoryname,
java.lang.String username,
java.lang.String functionname,
java.lang.String genlpredsname,
java.lang.String arityname,
java.lang.String commentname,
java.lang.String categoryname,
java.lang.String resultisaname,
java.lang.String resultisagenlname,
java.lang.String[] arg,
java.lang.String[] isagenl)
|
void |
createPredicate(java.lang.String microtheoryname,
java.lang.String username,
java.lang.String predicatename,
java.util.ArrayList genlpredss,
java.lang.String arityname,
java.lang.String commentname,
java.util.ArrayList isas,
java.lang.String[] arg,
java.lang.String[] isagenl)
|
boolean |
deleteGaf(CycList sentence,
CycFort mt)
|
java.util.ArrayList |
getArrayList(java.lang.String mt,
java.lang.String collectionname)
|
java.util.ArrayList |
getCollections()
|
java.util.ArrayList |
getMts()
|
boolean |
isMetaRelation(CycFort cycPredicate)
Returns true if cycPredicate is a MetaRelation. |
CycConstant |
makeCycConstant(java.lang.String name)
Override of CycAccess Constructs a new CycConstant object using the constant name. |
CycConstant |
makeCycConstantOrNull(java.lang.String name)
|
static CycList |
makeGaf(CycConstant cycPredicate,
CycConstant arg1,
CycConstant arg2)
Constructs a new CycList object representing a Gaf using the the three parameters |
CycList |
makeIsa(CycConstant term,
CycConstant type)
Constructs a new CycList object representing a Isa based Gaf using the the two parameters |
CycList |
makeIsa(CycConstant term,
java.lang.String type)
Constructs a new CycList object representing a Isa based Gaf using the the two parameters |
java.util.ArrayList |
queryArrayListSEL(java.lang.String mt,
java.lang.String query)
Returns a list of bindings for a query with a single unbound variable. |
java.util.ArrayList |
queryArrayListSEL(java.lang.String mt,
java.lang.String query,
java.lang.String params)
|
java.lang.String |
withBookkeepingInfo()
Returns a with-bookkeeping-info macro expresssion. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static CycConstant argIsa
public static CycConstant argGenl
public static CycConstant resultIsa
public static CycConstant resultGenl
public static CycConstant predicate
public static CycConstant relation
public static CycConstant microtheory
public static CycConstant cyclist
public static CycConstant predarity
public static CycConstant genlpreds
public static CycConstant cyclistDefinitionalMt
public static CycConstant cycBasedProject
public static CycConstant metaRelation
public static CycConstant makeCycConstantError
public static CycConstant cycadministrator
public static CycConstant opencycproject
public static CycConstant functionalRelation
public static CycConstant cycTrue
public static CycConstant cycFalse
public static CycConstant cycVoid
public static CycConstant cycNull
Constructor Detail |
public CycAssertionsFactory() throws java.io.IOException, java.net.UnknownHostException, CycApiException
public CycAssertionsFactory(java.lang.String myAgentName, java.lang.String cycProxyAgentName, int agentCommunity) throws java.io.IOException, CycApiException
myAgentName
- the name of the local agentcycProxyAgentName
- the name of the cyc proxy agentagentCommunity
- the agent community to which the cyc proxy agent belongspublic CycAssertionsFactory(java.lang.String hostName, int basePort, int communicationMode, boolean persistentConnection) throws java.io.IOException, java.net.UnknownHostException, CycApiException
hostName
- the host namebasePort
- the base (HTML serving) TCP socket port numbercommunicationMode
- either ASCII_MODE or BINARY_MODEpersistentConnection
- when true keep a persistent socket connection with
the OpenCyc serverMethod Detail |
public java.util.ArrayList getMts() throws java.lang.Exception
public java.util.ArrayList getCollections() throws java.lang.Exception
public java.lang.String withBookkeepingInfo()
withBookkeepingInfo
in class CycAccess
org.opencyc.api.CycAccess
public void assertGenlMt(CycFort mt1, CycFort mt2) throws java.io.IOException, CycApiException
assertGenlMt
in class CycAccess
CycFort
- mt1 the child Microtheory that inherits from mt2CycFort
- mt2 the parent Microtheory that lends it's assertions to the childpublic void assertGenlMt(CycFort mt1, java.lang.String mt2) throws java.io.IOException, CycApiException
CycFort
- mt1 the child Microtheory that inherits from mt2String
- mt2 the parent Microtheory that lends it's assertions to the childpublic CycConstant makeCycConstant(java.lang.String name)
makeCycConstant
in class CycAccess
name
- Name of the constant. If prefixed with "#$", then the prefix is
removed for canonical representation.
SPECIAL: If the name is not considered makeable it appends "Logic" to the end.
If it still fails, it returns the #$MakeCycConstantErrorFn (public CycConstant makeCycConstantError)public boolean isMetaRelation(CycFort cycPredicate) throws java.io.IOException, CycApiException
cycPredicate
- the predicate for determination as a MetaRelationpublic static CycList makeGaf(CycConstant cycPredicate, CycConstant arg1, CycConstant arg2)
CycConstant
- cycPredicate of the GafCycConstant
- arg1 of the GafCycConstant
- arg2 of the Gafpublic CycList makeIsa(CycConstant term, java.lang.String type)
CycConstant
- term of the GafString
- type the Collections namepublic CycList makeIsa(CycConstant term, CycConstant type)
CycConstant
- term of the GafCycConstant
- type Collectionpublic void createPredicate(java.lang.String microtheoryname, java.lang.String username, java.lang.String predicatename, java.util.ArrayList genlpredss, java.lang.String arityname, java.lang.String commentname, java.util.ArrayList isas, java.lang.String[] arg, java.lang.String[] isagenl) throws CycApiException
public void createFunction(java.lang.String microtheoryname, java.lang.String username, java.lang.String functionname, java.lang.String genlpredsname, java.lang.String arityname, java.lang.String commentname, java.lang.String categoryname, java.lang.String resultisaname, java.lang.String resultisagenlname, java.lang.String[] arg, java.lang.String[] isagenl) throws CycApiException
public java.util.ArrayList getArrayList(java.lang.String mt, java.lang.String collectionname)
public java.util.ArrayList queryArrayListSEL(java.lang.String mt, java.lang.String query)
query
- the query to be asked in the knowledge basevariable
- the single unbound variable in the query for which bindings are soughtmt
- the microtheory in which the query is askedpublic java.util.ArrayList queryArrayListSEL(java.lang.String mt, java.lang.String query, java.lang.String params)
public static java.lang.Integer arityFromString(java.lang.String term)
public static java.lang.String aryFromString(java.lang.String term)
public static java.lang.String aryFromInt(int term)
public void assertWithTranscriptNoWffCheck(java.lang.String sentence, CycFort mt) throws java.io.IOException, java.net.UnknownHostException, CycApiException
String
- sentence the given sentence for assertionCycFort
- mt the microtheory in which the assertion is placedpublic void assertWithTranscriptNoWffCheck(CycList sentence, CycFort mt) throws java.io.IOException, java.net.UnknownHostException, CycApiException
CycList
- sentence the given sentence for assertionCycFort
- mt the microtheory in which the assertion is placedpublic void assertGafNoWff(CycFort mt, CycConstant predicate, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
mt
- the microtheory in which the assertion is madepredicate
- the binary predicate of the assertionarg1
- the first argument of the predicatearg2
- the second argument of the predicatearg3
- the third argument of the predicatepublic void assertGafNoWff(CycFort mt, CycConstant predicate, java.lang.Object arg1, java.lang.Object arg2)
mt
- the microtheory in which the assertion is madepredicate
- the binary predicate of the assertionarg1
- the first argument of the predicatearg2
- the second argument of the predicatepublic boolean deleteGaf(CycList sentence, CycFort mt)
public CycConstant makeCycConstantOrNull(java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |