com.hp.hpl.jena.reasoner.dig
Class DIGQueryIsEquivalentTranslator

java.lang.Object
  extended by com.hp.hpl.jena.reasoner.dig.DIGQueryTranslator
      extended by com.hp.hpl.jena.reasoner.dig.DIGQueryIsEquivalentTranslator

public class DIGQueryIsEquivalentTranslator
extends DIGQueryTranslator

Translator to map variants of owl:equivalentClass to the DIG <equivalents> query, where the query is testing if two concepts are indeed equivalent (rather than listing the atoms that are, in fact, equivalent to a given concept, which is what DIGQueryEquivalentsTranslator does).

Version:
CVS $Id: DIGQueryIsEquivalentTranslator.java,v 1.16 2008/01/02 12:07:09 andy_seaborne Exp $
Author:
Ian Dickinson, HP Labs (email)

Field Summary
 
Fields inherited from class com.hp.hpl.jena.reasoner.dig.DIGQueryTranslator
ALL
 
Constructor Summary
DIGQueryIsEquivalentTranslator(java.lang.String predicate)
          Construct a translator for the DIG query 'equivalents'.
 
Method Summary
 boolean checkTriple(TriplePattern pattern, DIGAdapter da, Model premises)
          Check whether the pattern matches the preconditions for the translation step.
 org.w3c.dom.Document translatePattern(TriplePattern pattern, DIGAdapter da)
          Answer a query that will generate a query to see if two concepts are equivalent
 org.w3c.dom.Document translatePattern(TriplePattern pattern, DIGAdapter da, Model premises)
          Answer an XML document that presents the translation of the query into DIG query language, given that either the subject or object may be expressions defined by the statements in the premises model.
 ExtendedIterator translateResponseHook(org.w3c.dom.Document response, TriplePattern query, DIGAdapter da)
          Answer an iterator of triples that match the original find query.
 boolean trigger(TriplePattern pattern, DIGAdapter da, Model premises)
          Answer true if this translator applies to the given triple pattern.
 
Methods inherited from class com.hp.hpl.jena.reasoner.dig.DIGQueryTranslator
checkObject, checkPredicate, checkSubject, find, find, translateResponse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DIGQueryIsEquivalentTranslator

public DIGQueryIsEquivalentTranslator(java.lang.String predicate)

Construct a translator for the DIG query 'equivalents'.

Parameters:
predicate - The predicate URI to trigger on
Method Detail

translatePattern

public org.w3c.dom.Document translatePattern(TriplePattern pattern,
                                             DIGAdapter da)

Answer a query that will generate a query to see if two concepts are equivalent

Specified by:
translatePattern in class DIGQueryTranslator

translatePattern

public org.w3c.dom.Document translatePattern(TriplePattern pattern,
                                             DIGAdapter da,
                                             Model premises)
Description copied from class: DIGQueryTranslator

Answer an XML document that presents the translation of the query into DIG query language, given that either the subject or object may be expressions defined by the statements in the premises model.

Specified by:
translatePattern in class DIGQueryTranslator

translateResponseHook

public ExtendedIterator translateResponseHook(org.w3c.dom.Document response,
                                              TriplePattern query,
                                              DIGAdapter da)

Answer an iterator of triples that match the original find query.


checkTriple

public boolean checkTriple(TriplePattern pattern,
                           DIGAdapter da,
                           Model premises)

Check whether the pattern matches the preconditions for the translation step. This means that the subject and object must be concepts or bNodes. A limitation on DIG means that both cannot be expressions (bNodes). The predicate must be equivalence, or one of the boolean definition relations (in which case the query will have to introduce a bNode as a comprehension step).

Overrides:
checkTriple in class DIGQueryTranslator
Parameters:
pattern - The triple pattern
da - The current dig adapter
premises - Model denoting premises to the query, or null
Returns:
True if the pattern conforms to the prerequisites for a given translation step

trigger

public boolean trigger(TriplePattern pattern,
                       DIGAdapter da,
                       Model premises)
Description copied from class: DIGQueryTranslator

Answer true if this translator applies to the given triple pattern.

Overrides:
trigger in class DIGQueryTranslator
Parameters:
pattern - An incoming patter to match against
da - The current dig adapter
premises - An optional Model that is used to convey the statements in the additional premises to the query
Returns:
True if this translator applies to the pattern.


Copyright � 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP