uk.ac.manchester.cs.owl.inference.dig11
Class DIGTranslatorImpl

java.lang.Object
  extended by uk.ac.manchester.cs.owl.inference.dig11.DIGTranslatorImpl
All Implemented Interfaces:
DIGTranslator

public class DIGTranslatorImpl
extends java.lang.Object
implements DIGTranslator

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 21-Nov-2006


Field Summary
static java.lang.String DL_NAMESPACE
           
 
Constructor Summary
DIGTranslatorImpl(OWLOntologyManager manager)
           
 
Method Summary
 void createAllConceptNamesQuery(org.w3c.dom.Document doc, java.lang.String queryID)
          Creates a DIG Query that will return a list of the primitive concepts in the knowledge base.
 void createAllIndividualsQuery(org.w3c.dom.Document doc, java.lang.String queryID)
          Create a DIG Query that will return a list of the individuals in the knowledge base.
 void createAllPropertyNamesQuery(org.w3c.dom.Document doc, java.lang.String queryID)
          Creates a DIG Query that will return a list of properties in the knowledge base.
 void createAncestorConceptsQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLDescription aClass)
          Creates a query that asks for the ancestor concepts of a given concept, this includes all super concepts (not just direct ones).
 void createAncestorPropertiesQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLObjectProperty property)
          Creates a query that asks for the ancestor properties (i.e.
 org.w3c.dom.Document createAsksDocument(java.lang.String kbURI)
          A convenience method that creates an XML DIG Asks document.
 void createDescendantConceptsQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLDescription aClass)
          Creates a query that asks for the descendant concepts of a given concept.
 void createDescendantPropertiesQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLObjectProperty property)
          Creates a query that asks for the descendant properties (i.e.
 org.w3c.dom.Document createDIGDocument(java.lang.String rootTagName)
          Creates an XML DIG Document, whose root contains the appropriate name spaces etc.
 org.w3c.dom.Document createDIGDocument(java.lang.String rootTagName, java.lang.String kbURI)
          Creates an XML DIG Document, whose root contains the appropriate namespaces etc.
 void createDirectSubConceptsQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLDescription aClass)
          Creates a query that asks for the direct sub concepts of a given concept.
 void createDirectSubPropertiesQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLObjectProperty property)
          Creates a query that asks for the direct sub properties of a given property.
 void createDirectSuperConceptsQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLDescription aClass)
          Creates a query that asks for the direct super concepts of a given concept.
 void createDirectSuperConceptsQuery(org.w3c.dom.Document doc, java.lang.String queryID, java.util.Set<OWLDescription> clses)
          Creates a query that asks for the direct super concepts of an intersection of classes.
 void createDirectSuperPropertiesQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLObjectProperty property)
          Creates a query that asks for the direct super properties of a given property.
 void createDisjointQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLDescription cls1, OWLDescription cls2)
          Creates a query that asks if one concept is disjoint with another concept.
 void createEquivalentConceptsQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLDescription aClass)
          Creates a query that asks for the concepts that are equivalent (i.e.
 void createIndividualInstanceOfConceptQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLIndividual ins, OWLDescription aClass)
          Creates a query that asks if an individual is an instance (member of) a given class.
 void createIndividualTypesQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLIndividual ins)
          Creates a query that asks for the types (concepts) that an individual belongs to.
 void createInstancesOfConceptQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLDescription aClass)
          Creates a query that asks for the instances (individuals belonging to) a given concept.
 void createPropertyFillersQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLIndividual ins, OWLObjectProperty property)
          Creates a query that asks for the fillers for a qiven individual/property pair.
protected static org.w3c.dom.Element createQueryElement(org.w3c.dom.Document doc, java.lang.String name, java.lang.String queryID)
           
 void createRelatedIndividualsQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLObjectProperty property)
          Creates a query that asks for the individuals that are related to each other via a given property.
 void createSatisfiableQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLDescription aClass)
          Creates a query that asks if a given class is satisfiable.
 void createSatisfiableQuery(org.w3c.dom.Document doc, java.lang.String queryID, java.util.Set<OWLDescription> clses)
          Creates a query that asks if the intersection of a set of classes is satisfiable/consistent.
 void createSubsumesQuery(org.w3c.dom.Document doc, java.lang.String queryID, OWLDescription cls1, OWLDescription cls2)
          Creates a query that asks if one concept subsumes another concept.
 org.w3c.dom.Document createTellsDocument(java.lang.String kbURI)
          A convenience method that creates an XML DIG Tells document.
 java.util.Iterator<DIGQueryResponse> getDIGQueryResponseIterator(OWLDataFactory factory, org.w3c.dom.Document doc)
          Returns an iterator that can be used to traverse the responses to multiple queries.
 void translateToDIG(OWLObject i, org.w3c.dom.Document doc, org.w3c.dom.Node node)
          Translates an OWLObject to DIG
 void translateToDIG(java.util.Set<OWLOntology> ontologies, org.w3c.dom.Document doc, org.w3c.dom.Element node)
          Translates a set of OWLOntology objects to DIG
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DL_NAMESPACE

public static final java.lang.String DL_NAMESPACE
See Also:
Constant Field Values
Constructor Detail

DIGTranslatorImpl

public DIGTranslatorImpl(OWLOntologyManager manager)
Method Detail

createTellsDocument

public org.w3c.dom.Document createTellsDocument(java.lang.String kbURI)
Description copied from interface: DIGTranslator
A convenience method that creates an XML DIG Tells document.

Specified by:
createTellsDocument in interface DIGTranslator
Parameters:
kbURI - The URI that specifies the external DIG reasoner knowledge base that the tells request relates to.

createAsksDocument

public org.w3c.dom.Document createAsksDocument(java.lang.String kbURI)
Description copied from interface: DIGTranslator
A convenience method that creates an XML DIG Asks document.

Specified by:
createAsksDocument in interface DIGTranslator
Parameters:
kbURI - The URI that specifies the external DIG reasoner knowledge base that the ask request should act upon.

createDIGDocument

public org.w3c.dom.Document createDIGDocument(java.lang.String rootTagName,
                                              java.lang.String kbURI)
Description copied from interface: DIGTranslator
Creates an XML DIG Document, whose root contains the appropriate namespaces etc.

Specified by:
createDIGDocument in interface DIGTranslator
Parameters:
rootTagName - The name of the document root element.
kbURI - The URI of the knowledge base held in the external DIG reasoner, which the document relates to.

createDIGDocument

public org.w3c.dom.Document createDIGDocument(java.lang.String rootTagName)
Description copied from interface: DIGTranslator
Creates an XML DIG Document, whose root contains the appropriate name spaces etc. The document created does not contain a knowledge base URI, and therfore cannot be used to formulate requests that will act on a specific knowledge base.

Specified by:
createDIGDocument in interface DIGTranslator
Parameters:
rootTagName - The name of the document root element.

translateToDIG

public void translateToDIG(java.util.Set<OWLOntology> ontologies,
                           org.w3c.dom.Document doc,
                           org.w3c.dom.Element node)
                    throws DIGReasonerException
Description copied from interface: DIGTranslator
Translates a set of OWLOntology objects to DIG

Specified by:
translateToDIG in interface DIGTranslator
Parameters:
ontologies - The ontologies to be translated
doc - The Document that the rendering will be created in
node - The parent node that the dig rendereing will be appended to
Throws:
DIGReasonerException

translateToDIG

public void translateToDIG(OWLObject i,
                           org.w3c.dom.Document doc,
                           org.w3c.dom.Node node)
                    throws DIGReasonerException
Translates an OWLObject to DIG

Specified by:
translateToDIG in interface DIGTranslator
Parameters:
i - The element to be translated
doc - The Document that the rendering will be created in
node - The parent node that the dig rendereing will be appended to
Throws:
DIGReasonerException

getDIGQueryResponseIterator

public java.util.Iterator<DIGQueryResponse> getDIGQueryResponseIterator(OWLDataFactory factory,
                                                                        org.w3c.dom.Document doc)
                                                                 throws DIGReasonerException
Description copied from interface: DIGTranslator
Returns an iterator that can be used to traverse the responses to multiple queries. The iterator will iterate over DIGQueryResonse objects.

Specified by:
getDIGQueryResponseIterator in interface DIGTranslator
Throws:
DIGReasonerException

createQueryElement

protected static org.w3c.dom.Element createQueryElement(org.w3c.dom.Document doc,
                                                        java.lang.String name,
                                                        java.lang.String queryID)

createAllConceptNamesQuery

public void createAllConceptNamesQuery(org.w3c.dom.Document doc,
                                       java.lang.String queryID)
Description copied from interface: DIGTranslator
Creates a DIG Query that will return a list of the primitive concepts in the knowledge base.

Specified by:
createAllConceptNamesQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.

createAllPropertyNamesQuery

public void createAllPropertyNamesQuery(org.w3c.dom.Document doc,
                                        java.lang.String queryID)
Description copied from interface: DIGTranslator
Creates a DIG Query that will return a list of properties in the knowledge base.

Specified by:
createAllPropertyNamesQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.

createAllIndividualsQuery

public void createAllIndividualsQuery(org.w3c.dom.Document doc,
                                      java.lang.String queryID)
Description copied from interface: DIGTranslator
Create a DIG Query that will return a list of the individuals in the knowledge base.

Specified by:
createAllIndividualsQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.

createSatisfiableQuery

public void createSatisfiableQuery(org.w3c.dom.Document doc,
                                   java.lang.String queryID,
                                   OWLDescription aClass)
                            throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks if a given class is satisfiable.

Specified by:
createSatisfiableQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
aClass - The class whose satisfiability/consistency is to be determined.
Throws:
DIGReasonerException

createSatisfiableQuery

public void createSatisfiableQuery(org.w3c.dom.Document doc,
                                   java.lang.String queryID,
                                   java.util.Set<OWLDescription> clses)
                            throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks if the intersection of a set of classes is satisfiable/consistent.

Specified by:
createSatisfiableQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
clses - A set of classes, whose intersection will be tested for satisfiability.
Throws:
DIGReasonerException

createSubsumesQuery

public void createSubsumesQuery(org.w3c.dom.Document doc,
                                java.lang.String queryID,
                                OWLDescription cls1,
                                OWLDescription cls2)
                         throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks if one concept subsumes another concept.

Specified by:
createSubsumesQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
cls1 - The cconcept that is the subsumer
cls2 - The concept that is the subsumee
Throws:
DIGReasonerException

createDisjointQuery

public void createDisjointQuery(org.w3c.dom.Document doc,
                                java.lang.String queryID,
                                OWLDescription cls1,
                                OWLDescription cls2)
                         throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks if one concept is disjoint with another concept.

Specified by:
createDisjointQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
cls1 - The first concept
cls2 - The second concept
Throws:
DIGReasonerException

createDirectSuperConceptsQuery

public void createDirectSuperConceptsQuery(org.w3c.dom.Document doc,
                                           java.lang.String queryID,
                                           OWLDescription aClass)
                                    throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the direct super concepts of a given concept.

Specified by:
createDirectSuperConceptsQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
aClass - The concept whose super concepts are to be asked for.
Throws:
DIGReasonerException

createDirectSuperConceptsQuery

public void createDirectSuperConceptsQuery(org.w3c.dom.Document doc,
                                           java.lang.String queryID,
                                           java.util.Set<OWLDescription> clses)
                                    throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the direct super concepts of an intersection of classes.

Specified by:
createDirectSuperConceptsQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
clses - A set of classes whose intersection super concepts are to be asked for.
Throws:
DIGReasonerException

createDirectSubConceptsQuery

public void createDirectSubConceptsQuery(org.w3c.dom.Document doc,
                                         java.lang.String queryID,
                                         OWLDescription aClass)
                                  throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the direct sub concepts of a given concept.

Specified by:
createDirectSubConceptsQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
aClass - The concept whose sub concepts are to be asked for.
Throws:
DIGReasonerException

createAncestorConceptsQuery

public void createAncestorConceptsQuery(org.w3c.dom.Document doc,
                                        java.lang.String queryID,
                                        OWLDescription aClass)
                                 throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the ancestor concepts of a given concept, this includes all super concepts (not just direct ones).

Specified by:
createAncestorConceptsQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
aClass - The concept whose ancestor concepts are to be asked for.
Throws:
DIGReasonerException

createDescendantConceptsQuery

public void createDescendantConceptsQuery(org.w3c.dom.Document doc,
                                          java.lang.String queryID,
                                          OWLDescription aClass)
                                   throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the descendant concepts of a given concept. This includes all sub concepts (not just direct ones).

Specified by:
createDescendantConceptsQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
aClass - The concept whose subconcepts are to be asked for.
Throws:
DIGReasonerException

createEquivalentConceptsQuery

public void createEquivalentConceptsQuery(org.w3c.dom.Document doc,
                                          java.lang.String queryID,
                                          OWLDescription aClass)
                                   throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the concepts that are equivalent (i.e. have the same extension as) to a given concept.

Specified by:
createEquivalentConceptsQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
aClass - The concepts whose equivalent concepts are to be asked for.
Throws:
DIGReasonerException

createDirectSuperPropertiesQuery

public void createDirectSuperPropertiesQuery(org.w3c.dom.Document doc,
                                             java.lang.String queryID,
                                             OWLObjectProperty property)
                                      throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the direct super properties of a given property.

Specified by:
createDirectSuperPropertiesQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
property - The property (property) whose direct super properties are to be asked for.
Throws:
DIGReasonerException

createDirectSubPropertiesQuery

public void createDirectSubPropertiesQuery(org.w3c.dom.Document doc,
                                           java.lang.String queryID,
                                           OWLObjectProperty property)
                                    throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the direct sub properties of a given property.

Specified by:
createDirectSubPropertiesQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
property - The property (property) whose direct sub properites are to be asked for.
Throws:
DIGReasonerException

createAncestorPropertiesQuery

public void createAncestorPropertiesQuery(org.w3c.dom.Document doc,
                                          java.lang.String queryID,
                                          OWLObjectProperty property)
                                   throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the ancestor properties (i.e. all super properties and not just direct super properties) of a given property.

Specified by:
createAncestorPropertiesQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
property - The property (property) whose super properties are to be asked for.
Throws:
DIGReasonerException

createDescendantPropertiesQuery

public void createDescendantPropertiesQuery(org.w3c.dom.Document doc,
                                            java.lang.String queryID,
                                            OWLObjectProperty property)
                                     throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the descendant properties (i.e. all sub properties and not just the direct sub properties) of a given property.

Specified by:
createDescendantPropertiesQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
property - The property (property) whose sub properties are to be asked for.
Throws:
DIGReasonerException

createInstancesOfConceptQuery

public void createInstancesOfConceptQuery(org.w3c.dom.Document doc,
                                          java.lang.String queryID,
                                          OWLDescription aClass)
                                   throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the instances (individuals belonging to) a given concept.

Specified by:
createInstancesOfConceptQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
aClass - The concept (RDFSClass) whose instances are to be asked for.
Throws:
DIGReasonerException

createIndividualTypesQuery

public void createIndividualTypesQuery(org.w3c.dom.Document doc,
                                       java.lang.String queryID,
                                       OWLIndividual ins)
                                throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the types (concepts) that an individual belongs to.

Specified by:
createIndividualTypesQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
ins - The individual (RDFIndividual) whose types are to be asked for.
Throws:
DIGReasonerException

createIndividualInstanceOfConceptQuery

public void createIndividualInstanceOfConceptQuery(org.w3c.dom.Document doc,
                                                   java.lang.String queryID,
                                                   OWLIndividual ins,
                                                   OWLDescription aClass)
                                            throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks if an individual is an instance (member of) a given class.

Specified by:
createIndividualInstanceOfConceptQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
ins - The individual.
aClass - The class.
Throws:
DIGReasonerException

createPropertyFillersQuery

public void createPropertyFillersQuery(org.w3c.dom.Document doc,
                                       java.lang.String queryID,
                                       OWLIndividual ins,
                                       OWLObjectProperty property)
                                throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the fillers for a qiven individual/property pair.

Specified by:
createPropertyFillersQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
ins - The individual (instance) that the property is 'attached' to.
property - The property whose fillers are to be retrieved.
Throws:
DIGReasonerException

createRelatedIndividualsQuery

public void createRelatedIndividualsQuery(org.w3c.dom.Document doc,
                                          java.lang.String queryID,
                                          OWLObjectProperty property)
                                   throws DIGReasonerException
Description copied from interface: DIGTranslator
Creates a query that asks for the individuals that are related to each other via a given property.

Specified by:
createRelatedIndividualsQuery in interface DIGTranslator
Parameters:
doc - The document that the query will be created in/appended to. Note that the knowledge base URI parameter of the document root element will determine the knowledge base that this query relates to.
queryID - A String that represents an identifier for the query, which can be used to match the query to its result.
property - The property (property).
Throws:
DIGReasonerException