DIG 1.1 Reasoners API, April 26, 2004 (12:45 PM)

org.kr.dl.dig.reasoner.v1_1.impl
Class TReasoner

java.lang.Object
  extended byorg.kr.dl.dig.reasoner.v1_1.impl.TReasoner
All Implemented Interfaces:
Reasoner, TReasoner

public class TReasoner
extends Object
implements TReasoner

TBox reasoner wrapper for Reasoners.

Version:
$Id: TReasoner.java,v 1.3 2004/04/26 11:44:33 dturi Exp $
Author:
dturi

Field Summary
 
Fields inherited from interface org.kr.dl.dig.reasoner.v1_1.Reasoner
XML_HEADER
 
Constructor Summary
TReasoner(Reasoner reasoner)
          Sets reasoner.
 
Method Summary
 Set allConceptNames(URI kbURI)
          Returns the Set of String s corresponding to names of all concepts in the knowledge base kbURI.
 Set ancestorsNames(Concept concept, URI kbURI)
          Returns the Set of String s corresponding to names of concept ancestors of concept.
 ResponsesDocument asks(AsksDocument asks)
          Delegates to wrapped Reasoner.
 Set childrenNames(Concept concept, URI kbURI)
          Returns the Set of String s corresponding to names of concept children of concept.
 Set descendantsNames(Concept concept, URI kbURI)
          Returns the Set of String s corresponding to names of concept descendants of concept.
 Set equivalentsNames(Concept concept, URI kbURI)
          Returns the Set of String s corresponding to names of concept descendants of concept.
static void extractError(ResponseType responses)
          Throws a ReasonerExceptionusing the first error in responses if it exists, or simply "Unknown error in ask" with code 400.
 IdentifierDocument getIdentifier()
          Delegates to wrapped Reasoner.
 Reasoner getReasoner()
           
 URI newKB()
          Delegates to wrapped Reasoner.
 Set parentsNames(Concept concept, URI kbURI)
          Returns the Set of String s corresponding to names of concept parents of concept.
 boolean releaseKB(URI kb)
          Delegates to wrapped Reasoner.
 boolean satisfiable(Concept concept, URI kbURI)
          Returns true if concept is satisfiable.
 void setReasoner(Reasoner reasoner)
           
 boolean subsumes(Concept subsumer, Concept subsumee, URI kbURI)
          Returns true if subsumer subsumes subsumee.
 ResponseDocument tells(TellsDocument tells)
          Delegates to wrapped Reasoner.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TReasoner

public TReasoner(Reasoner reasoner)
Sets reasoner.

Parameters:
reasoner - The reasoner to set.
Method Detail

allConceptNames

public Set allConceptNames(URI kbURI)
                    throws ReasonerException
Returns the Set of String s corresponding to names of all concepts in the knowledge base kbURI.

Specified by:
allConceptNames in interface TReasoner
Parameters:
kbURI - the URIof the knowledge base we want to use.
Returns:
the Set of String s corresponding to names of all concepts in the knowledge base.
Throws:
ReasonerException.
ReasonerException
See Also:
Reasoner.asks(AsksDocument).

satisfiable

public boolean satisfiable(Concept concept,
                           URI kbURI)
                    throws ReasonerException
Returns true if concept is satisfiable.

Specified by:
satisfiable in interface TReasoner
Parameters:
concept - the Conceptfor which satisfiability is tested.
kbURI - the URIof the knowledge base we want to use.
Returns:
true if concept is satisfiable.
Throws:
ReasonerException
See Also:
Reasoner.asks(AsksDocument).

subsumes

public boolean subsumes(Concept subsumer,
                        Concept subsumee,
                        URI kbURI)
                 throws ReasonerException
Returns true if subsumer subsumes subsumee.

Specified by:
subsumes in interface TReasoner
Parameters:
subsumer - a Conceptexpected to subsume subsumee.
subsumee - a Conceptexpected to be subsumed subsumer.
kbURI - the URIof the knowledge base we want to use.
Returns:
true if subsumer subsumes subsumee.
Throws:
ReasonerException
See Also:
Reasoner.asks(AsksDocument).

extractError

public static void extractError(ResponseType responses)
                         throws ReasonerException
Throws a ReasonerExceptionusing the first error in responses if it exists, or simply "Unknown error in ask" with code 400.

Parameters:
responses - a ResponseType.
Throws:
a - new ReasonerExceptionusing the first error in responses if it exists, or simply "Unknown error in ask" with code 400.
ReasonerException

childrenNames

public Set childrenNames(Concept concept,
                         URI kbURI)
                  throws ReasonerException
Returns the Set of String s corresponding to names of concept children of concept.

Specified by:
childrenNames in interface TReasoner
Parameters:
concept - the Conceptwhose children are returned.
kbURI - the URIof the knowledge base we want to use.
Returns:
the Set of String s corresponding to names of concept children of concept.
Throws:
ReasonerException.
ReasonerException
See Also:
Reasoner.asks(AsksDocument).

descendantsNames

public Set descendantsNames(Concept concept,
                            URI kbURI)
                     throws ReasonerException
Returns the Set of String s corresponding to names of concept descendants of concept.

Specified by:
descendantsNames in interface TReasoner
Parameters:
concept - the Conceptwhose descendants are returned.
kbURI - the URIof the knowledge base we want to use.
Returns:
the Set of String s corresponding to names of concept descendants of concept.
Throws:
ReasonerException.
ReasonerException
See Also:
Reasoner.asks(AsksDocument).

parentsNames

public Set parentsNames(Concept concept,
                        URI kbURI)
                 throws ReasonerException
Returns the Set of String s corresponding to names of concept parents of concept.

Specified by:
parentsNames in interface TReasoner
Parameters:
concept - the Conceptwhose parents are returned.
kbURI - the URIof the knowledge base we want to use.
Returns:
the Set of String s corresponding to names of concept parents of concept.
Throws:
ReasonerException.
ReasonerException
See Also:
Reasoner.asks(AsksDocument)

ancestorsNames

public Set ancestorsNames(Concept concept,
                          URI kbURI)
                   throws ReasonerException
Returns the Set of String s corresponding to names of concept ancestors of concept.

Specified by:
ancestorsNames in interface TReasoner
Parameters:
concept - the Conceptwhose ancestors are returned.
kbURI - the URIof the knowledge base we want to use.
Returns:
the Set of String s corresponding to names of concept ancestors of concept.
Throws:
ReasonerException.
ReasonerException
See Also:
Reasoner.asks(AsksDocument)

equivalentsNames

public Set equivalentsNames(Concept concept,
                            URI kbURI)
                     throws ReasonerException
Returns the Set of String s corresponding to names of concept descendants of concept.

Specified by:
equivalentsNames in interface TReasoner
Parameters:
concept - the Conceptwhose descendants are returned.
kbURI - the URIof the knowledge base we want to use.
Returns:
the Set of String s corresponding to names of concept descendants of concept.
Throws:
ReasonerException.
ReasonerException
See Also:
Reasoner.asks(AsksDocument)

tells

public ResponseDocument tells(TellsDocument tells)
                       throws ReasonerException
Delegates to wrapped Reasoner.

Specified by:
tells in interface Reasoner
Parameters:
tells - a TellsDocument.
Returns:
the ResponseDocument corresponding to the tells.
Throws:
ReasonerException - with code:
  • 602 if the reasoner response does not parse or, if logger is finest, validate;
  • 104 if an IOException occurs;
See Also:
Reasoner.tells(org.kr.dl.dig.v1_1.TellsDocument)

asks

public ResponsesDocument asks(AsksDocument asks)
                       throws ReasonerException
Delegates to wrapped Reasoner.

Specified by:
asks in interface Reasoner
Parameters:
asks - an AsksDocument.
Returns:
the ResponsesDocument corresponding to the asks.
Throws:
ReasonerException - with code:
  • 602 if the reasoner response does not parse or, if logger is finest, validate;
  • 104 if an IOException occurs;
See Also:
Reasoner.asks(org.kr.dl.dig.v1_1.AsksDocument)

getIdentifier

public IdentifierDocument getIdentifier()
                                 throws ReasonerException
Delegates to wrapped Reasoner.

Specified by:
getIdentifier in interface Reasoner
Returns:
the IdentifierDocument corresponding to the getIdentifier request.
Throws:
ReasonerException - with code:
  • 602 if the reasoner response does not parse or, if logger is finest, validate;
  • 104 if an IOException occurs;
See Also:
Reasoner.getIdentifier()

newKB

public URI newKB()
          throws ReasonerException
Delegates to wrapped Reasoner.

Specified by:
newKB in interface Reasoner
Returns:
the URI for a new knowledge base from the reasoner.
Throws:
ReasonerException - with code:
  • 602 if the reasoner responses do not parse or, if logger is finest, validate;
  • 104 if an IOException occurs;
  • 202 if the reasoner returns a malformed URI.
See Also:
Reasoner.newKB()

releaseKB

public boolean releaseKB(URI kb)
                  throws ReasonerException
Delegates to wrapped Reasoner.

Specified by:
releaseKB in interface Reasoner
Parameters:
kb - the URI of a knowledge base.
Returns:
true if the operation succeeds.
Throws:
ReasonerException - with code:
  • 602 if the reasoner response does not parse or, if logger is finest, validate;
  • 104 if an IOException occurs;
See Also:
Reasoner.releaseKB(java.net.URI)

getReasoner

public Reasoner getReasoner()
Returns:
Returns the reasoner.

setReasoner

public void setReasoner(Reasoner reasoner)
Parameters:
reasoner - The reasoner to set.

DIG 1.1 Reasoners API, April 26, 2004 (12:45 PM)