edu.stanford.smi.protegex.owl.inference.dig.translator
Interface DIGTranslator

All Known Implementing Classes:
DefaultDIGTranslator

public interface DIGTranslator

User: matthewhorridge
The Univeristy Of Manchester
Medical Informatics Group
Date: Jun 28, 2004

matthew.horridge@cs.man.ac.uk
www.cs.man.ac.uk/~horridgm

The DIGTranslator represents a converter that translates back and forth between the OWLModel and DIG.


Method Summary
 void createAllConceptNamesQuery(Document doc, String queryID)
          Creates a DIG Query that will return a list of the primitive concepts in the knowledge base.
 void createAllIndividualsQuery(Document doc, String queryID)
          Create a DIG Query that will return a list of the individuals in the knowledge base.
 void createAllPropertyNamesQuery(Document doc, String queryID)
          Creates a DIG Query that will return a list of properties in the knowledge base.
 void createAncestorConceptsQuery(Document doc, String queryID, RDFSClass 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(Document doc, String queryID, OWLProperty property)
          Creates a query that asks for the ancestor properties (i.e. all super properties and not just direct super properties) of a given property.
 Document createAsksDocument(String kbURI)
          A convenience method that creates an XML DIG Asks document.
 void createDescendantConceptsQuery(Document doc, String queryID, RDFSClass aClass)
          Creates a query that asks for the descendant concepts of a given concept.
 void createDescendantPropertiesQuery(Document doc, String queryID, OWLProperty property)
          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.
 Document createDIGDocument(String rootTagName)
          Creates an XML DIG Document, whose root contains the appropriate name spaces etc.
 Document createDIGDocument(String rootTagName, String kbURI)
          Creates an XML DIG Document, whose root contains the appropriate namespaces etc.
 void createDirectSubConceptsQuery(Document doc, String queryID, RDFSClass aClass)
          Creates a query that asks for the direct sub concepts of a given concept.
 void createDirectSubPropertiesQuery(Document doc, String queryID, OWLProperty property)
          Creates a query that asks for the direct sub properties of a given property.
 void createDirectSuperConceptsQuery(Document doc, String queryID, RDFSClass aClass)
          Creates a query that asks for the direct super concepts of a given concept.
 void createDirectSuperConceptsQuery(Document doc, String queryID, RDFSClass[] clses)
          Creates a query that asks for the direct super concepts of an intersection of classes.
 void createDirectSuperPropertiesQuery(Document doc, String queryID, OWLProperty property)
          Creates a query that asks for the direct super properties of a given property.
 void createDisjointQuery(Document doc, String queryID, RDFSClass cls1, RDFSClass cls2)
          Creates a query that asks if one concept is disjoint with another concept.
 void createEquivalentConceptsQuery(Document doc, String queryID, RDFSClass aClass)
          Creates a query that asks for the concepts that are equivalent (i.e.
 void createIndividualInstanceOfConceptQuery(Document doc, String queryID, RDFIndividual ins, RDFSClass aClass)
          Creates a query that asks if an individual is an instance (member of) a given class.
 void createIndividualTypesQuery(Document doc, String queryID, RDFIndividual ins)
          Creates a query that asks for the types (concepts) that an individual belongs to.
 void createInstancesOfConceptQuery(Document doc, String queryID, RDFSClass aClass)
          Creates a query that asks for the instances (individuals belonging to) a given concept.
 void createPropertyFillersQuery(Document doc, String queryID, RDFIndividual ins, OWLProperty property)
          Creates a query that asks for the fillers for a qiven individual/property pair.
 void createRelatedIndividualsQuery(Document doc, String queryID, OWLProperty property)
          Creates a query that asks for the individuals that are related to each other via a given property.
 void createSatisfiableQuery(Document doc, String queryID, RDFSClass aClass)
          Creates a query that asks if a given class is satisfiable.
 void createSatisfiableQuery(Document doc, String queryID, RDFSClass[] clses)
          Creates a query that asks if the intersection of a list of classes is satisfiable/consistent.
 void createSubsumesQuery(Document doc, String queryID, RDFSClass cls1, RDFSClass cls2)
          Creates a query that asks if one concept subsumes another concept.
 Document createTellsDocument(String kbURI)
          A convenience method that creates an XML DIG Tells document.
 Iterator getDIGQueryResponseIterator(OWLModel kb, Document doc)
          Returns an iterator that can be used to traverse the responses to multiple queries.
 void setReasonerIdentity(DIGReasonerIdentity reasonerIdentity)
          Sets the reasoner identity that the translator will respect when it translates the ontology DIG.
 void translateToDIG(OWLModel kb, Document doc, Node node)
          Translates an OWLModel to DIG
 void translateToDIG(RDFResource i, Document doc, Node node)
          Translates an element of an OWLModel to DIG
 

Method Detail

createDIGDocument

public Document createDIGDocument(String rootTagName,
                                  String kbURI)
                           throws DIGReasonerException
Creates an XML DIG Document, whose root contains the appropriate namespaces etc.

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.
Throws:
DIGReasonerException

createDIGDocument

public Document createDIGDocument(String rootTagName)
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.

Parameters:
rootTagName - The name of the document root element.

createTellsDocument

public Document createTellsDocument(String kbURI)
A convenience method that creates an XML DIG Tells document.

Parameters:
kbURI - The URI that specifies the external DIG reasoner knowledge base that the tells request relates to.

createAsksDocument

public Document createAsksDocument(String kbURI)
A convenience method that creates an XML DIG Asks document.

Parameters:
kbURI - The URI that specifies the external DIG reasoner knowledge base that the ask request should act upon.

translateToDIG

public void translateToDIG(OWLModel kb,
                           Document doc,
                           Node node)
                    throws DIGReasonerException
Translates an OWLModel to DIG

Parameters:
kb - The knowledge base 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(RDFResource i,
                           Document doc,
                           Node node)
                    throws DIGReasonerException
Translates an element of an OWLModel to DIG

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

createAllConceptNamesQuery

public void createAllConceptNamesQuery(Document doc,
                                       String queryID)
                                throws DIGReasonerException
Creates a DIG Query that will return a list of the primitive concepts in the knowledge base.

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.
Throws:
DIGReasonerException

createAllPropertyNamesQuery

public void createAllPropertyNamesQuery(Document doc,
                                        String queryID)
                                 throws DIGReasonerException
Creates a DIG Query that will return a list of properties in the knowledge base.

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.
Throws:
DIGReasonerException

createAllIndividualsQuery

public void createAllIndividualsQuery(Document doc,
                                      String queryID)
                               throws DIGReasonerException
Create a DIG Query that will return a list of the individuals in the knowledge base.

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.
Throws:
DIGReasonerException

createSatisfiableQuery

public void createSatisfiableQuery(Document doc,
                                   String queryID,
                                   RDFSClass aClass)
                            throws DIGReasonerException
Creates a query that asks if a given class is satisfiable.

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(Document doc,
                                   String queryID,
                                   RDFSClass[] clses)
                            throws DIGReasonerException
Creates a query that asks if the intersection of a list of classes is satisfiable/consistent.

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 - An array of classes, whose intersection will be tested for satisfiability.
Throws:
DIGReasonerException

createSubsumesQuery

public void createSubsumesQuery(Document doc,
                                String queryID,
                                RDFSClass cls1,
                                RDFSClass cls2)
                         throws DIGReasonerException
Creates a query that asks if one concept subsumes another concept.

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(Document doc,
                                String queryID,
                                RDFSClass cls1,
                                RDFSClass cls2)
                         throws DIGReasonerException
Creates a query that asks if one concept is disjoint with another concept.

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(Document doc,
                                           String queryID,
                                           RDFSClass aClass)
                                    throws DIGReasonerException
Creates a query that asks for the direct super concepts of a given concept.

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(Document doc,
                                           String queryID,
                                           RDFSClass[] clses)
                                    throws DIGReasonerException
Creates a query that asks for the direct super concepts of an intersection of classes.

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 - An array of classes whose intersection super concepts are to be asked for.
Throws:
DIGReasonerException

createDirectSubConceptsQuery

public void createDirectSubConceptsQuery(Document doc,
                                         String queryID,
                                         RDFSClass aClass)
                                  throws DIGReasonerException
Creates a query that asks for the direct sub concepts of a given concept.

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(Document doc,
                                        String queryID,
                                        RDFSClass aClass)
                                 throws DIGReasonerException
Creates a query that asks for the ancestor concepts of a given concept, this includes all super concepts (not just direct ones).

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(Document doc,
                                          String queryID,
                                          RDFSClass aClass)
                                   throws DIGReasonerException
Creates a query that asks for the descendant concepts of a given concept. This includes all sub concepts (not just direct ones).

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(Document doc,
                                          String queryID,
                                          RDFSClass aClass)
                                   throws DIGReasonerException
Creates a query that asks for the concepts that are equivalent (i.e. have the same extension as) to a given concept.

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(Document doc,
                                             String queryID,
                                             OWLProperty property)
                                      throws DIGReasonerException
Creates a query that asks for the direct super properties of a given property.

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(Document doc,
                                           String queryID,
                                           OWLProperty property)
                                    throws DIGReasonerException
Creates a query that asks for the direct sub properties of a given property.

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(Document doc,
                                          String queryID,
                                          OWLProperty property)
                                   throws DIGReasonerException
Creates a query that asks for the ancestor properties (i.e. all super properties and not just direct super properties) of a given property.

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(Document doc,
                                            String queryID,
                                            OWLProperty property)
                                     throws DIGReasonerException
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.

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(Document doc,
                                          String queryID,
                                          RDFSClass aClass)
                                   throws DIGReasonerException
Creates a query that asks for the instances (individuals belonging to) a given concept.

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(Document doc,
                                       String queryID,
                                       RDFIndividual ins)
                                throws DIGReasonerException
Creates a query that asks for the types (concepts) that an individual belongs to.

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(Document doc,
                                                   String queryID,
                                                   RDFIndividual ins,
                                                   RDFSClass aClass)
                                            throws DIGReasonerException
Creates a query that asks if an individual is an instance (member of) a given class.

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(Document doc,
                                       String queryID,
                                       RDFIndividual ins,
                                       OWLProperty property)
                                throws DIGReasonerException
Creates a query that asks for the fillers for a qiven individual/property pair.

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(Document doc,
                                          String queryID,
                                          OWLProperty property)
                                   throws DIGReasonerException
Creates a query that asks for the individuals that are related to each other via a given property.

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

getDIGQueryResponseIterator

public Iterator getDIGQueryResponseIterator(OWLModel kb,
                                            Document doc)
                                     throws DIGReasonerException
Returns an iterator that can be used to traverse the responses to multiple queries. The iterator will iterate over DIGQueryResonse objects.

Throws:
DIGReasonerException

setReasonerIdentity

public void setReasonerIdentity(DIGReasonerIdentity reasonerIdentity)
Sets the reasoner identity that the translator will respect when it translates the ontology DIG.

Parameters:
reasonerIdentity - The reasoner identity, or null if the translation should not be constrained by the capabilities of a specific reasoner.