| java.lang.Object com.hp.hpl.jena.reasoner.dig.DIGQueryTranslator
All known Subclasses: com.hp.hpl.jena.reasoner.dig.DIGQueryAllIndividualsTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryRoleAncestorsTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryIsEquivalentTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryIsRoleTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryRelatedIndividualsTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryAncestorsTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryInstanceTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryTypesTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryRoleFillersTranslator, com.hp.hpl.jena.reasoner.dig.DIGIteratedQueryTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryInstancesTranslator, com.hp.hpl.jena.reasoner.dig.DIGQuerySubsumesTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryAllRolesTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryRoleFillerTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryDifferentFromTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryEquivalentsTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryAllConceptsTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryIsConceptTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryDisjointTranslator, com.hp.hpl.jena.reasoner.dig.DIGQueryIsIndividualTranslator,
DIGQueryTranslator | abstract public class DIGQueryTranslator (Code) | |
Base class for translators that map incoming RDF find patterns to DIG queries.
author: Ian Dickinson, HP Labs (email) version: Release @release@ ($Id: DIGQueryTranslator.java,v 1.20 2008/01/02 12:07:10 andy_seaborne Exp $) |
Method Summary | |
public boolean | checkObject(Node object, DIGAdapter da, Model premises) Additional test on the object of the incoming find pattern. | public boolean | checkPredicate(Node pred, DIGAdapter da, Model premises) Additional test on the predicate of the incoming find pattern. | public boolean | checkSubject(Node subject, DIGAdapter da, Model premises) Additional test on the subject of the incoming find pattern. | public boolean | checkTriple(TriplePattern pattern, DIGAdapter da, Model premises) An optional post-trigger check on the consituents of the triple pattern. | protected ExtendedIterator | conceptSetNameCheck(Document response, DIGAdapter da, Node node, Triple result) | public ExtendedIterator | find(TriplePattern pattern, DIGAdapter da) Translate the given pattern to a DIG query, and pass it on to the DIG
adapter as a query. | public ExtendedIterator | find(TriplePattern pattern, DIGAdapter da, Model premises) Translate the given pattern (with given premises)
to a DIG query, and pass it on to the DIG
adapter as a query. | protected Filter | getResultsTripleFilter(TriplePattern query) Extension point: translators can add an optional filter stage to
the translated result by providing a non-null filter here. | protected boolean | isFalse(Document response) Answer true if the given document is the response <false> from a DIG reasoner. | protected boolean | isTrue(Document response) Answer true if the given document is the response <true> from a DIG reasoner. | protected Node | mapNode(String uri) Answer a node corresponding to the given URI.
Parameters: uri - A node URI, or the special string *, or null. | protected ExtendedIterator | translateConceptSetResponse(Document response, TriplePattern query, boolean object, DIGAdapter da) | protected ExtendedIterator | translateIndividualPairSetResponse(Document response, TriplePattern query) | protected ExtendedIterator | translateIndividualSetResponse(Document response, TriplePattern query, boolean object) | protected ExtendedIterator | translateNameSetResponse(Document response, TriplePattern query, boolean object, String[] path) | abstract public Document | translatePattern(TriplePattern query, DIGAdapter da) | abstract public Document | translatePattern(TriplePattern pattern, DIGAdapter da, Model premises) | final public ExtendedIterator | translateResponse(Document response, TriplePattern query, DIGAdapter da) | abstract protected ExtendedIterator | translateResponseHook(Document response, TriplePattern query, DIGAdapter da) | protected ExtendedIterator | translateRoleSetResponse(Document response, TriplePattern query, boolean object) | protected ExtendedIterator | translateSpecialConcepts(Document response, DIGAdapter da, Node ref, Node pred, boolean refSubject) | public boolean | trigger(TriplePattern pattern, DIGAdapter da, Model premises) | protected boolean | trigger(Node lhs, Node rhs, Model premises) A node matches a trigger (lhs) node if either the lhs is null, or
the nodes are equal. |
DIGQueryTranslator | public DIGQueryTranslator(String subject, String predicate, String object)(Code) | | Construct an abstract translator, given the URI's of nodes to match against
or null to represent
|
checkObject | public boolean checkObject(Node object, DIGAdapter da, Model premises)(Code) | | Additional test on the object of the incoming find pattern. Default
is to always match
Parameters: object - The object resource from the incoming pattern Parameters: da - The current dig adapter Parameters: premises - A model that conveys additional information about the premisesof the query, which might assist the check to suceed or fail. By default itis ignored. True if this object matches the trigger condition expressed by this translator instance |
checkPredicate | public boolean checkPredicate(Node pred, DIGAdapter da, Model premises)(Code) | | Additional test on the predicate of the incoming find pattern. Default
is to always match
Parameters: pred - The predicate resource from the incoming pattern Parameters: da - The current dig adapter Parameters: premises - A model that conveys additional information about the premisesof the query, which might assist the check to suceed or fail. By default itis ignored. True if this predicate matches the trigger condition expressed by this translator instance |
checkSubject | public boolean checkSubject(Node subject, DIGAdapter da, Model premises)(Code) | | Additional test on the subject of the incoming find pattern. Default
is to always match
Parameters: subject - The subject resource from the incoming pattern Parameters: da - The current dig adapter Parameters: premises - A model that conveys additional information about the premisesof the query, which might assist the check to suceed or fail. By default itis ignored. True if this subject matches the trigger condition expressed by this translator instance |
checkTriple | public boolean checkTriple(TriplePattern pattern, DIGAdapter da, Model premises)(Code) | | An optional post-trigger check on the consituents of the triple pattern. By default,
delegates to a check on each of the subjec, object and predicate. However, this method
may be overridden by sub-classes to provide a more context-sensitive test.
Parameters: pattern - The triple pattern Parameters: da - The current dig adapter Parameters: premises - Model denoting premises to the query, or null True if the pattern conforms to the prerequisites for a given translation step |
conceptSetNameCheck | protected ExtendedIterator conceptSetNameCheck(Document response, DIGAdapter da, Node node, Triple result)(Code) | | Check if a document representing a concept-set response from the DIG reasoner
contains a given node as a value, and, if so, return a singleton iterator over the
given result triple.
Parameters: response - The XML document to process Parameters: da - The DIG adapter Parameters: node - The node we are seeking Parameters: result - The triple to return if node occurs in the concept set in response The singeleton iterator over result, or the null iterator if node is not presentin the response. |
find | public ExtendedIterator find(TriplePattern pattern, DIGAdapter da)(Code) | | Translate the given pattern to a DIG query, and pass it on to the DIG
adapter as a query. Translate the results of the query back to a
triple stream via an extended iterator. Assumes this method is called
contingent on a successful
DIGQueryTranslator.trigger .
Parameters: pattern - The pattern to translate to a DIG query Parameters: da - The DIG adapter through which we communicate with a DIG reasoner |
find | public ExtendedIterator find(TriplePattern pattern, DIGAdapter da, Model premises)(Code) | | Translate the given pattern (with given premises)
to a DIG query, and pass it on to the DIG
adapter as a query. Translate the results of the query back to a
triple stream via an extended iterator.
Parameters: pattern - The pattern to translate to a DIG query Parameters: da - The DIG adapter through which we communicate with a DIG reasoner Parameters: premises - Model conveying additional information about the resourcesin the subject or object |
getResultsTripleFilter | protected Filter getResultsTripleFilter(TriplePattern query)(Code) | | Extension point: translators can add an optional filter stage to
the translated result by providing a non-null filter here. The filter
should accept triples, and return true for those triples that are to
remain in the final result iterator.
An optional filter on the results of a DIG query |
isFalse | protected boolean isFalse(Document response)(Code) | | Answer true if the given document is the response <false> from a DIG reasoner.
Parameters: response - The document encoding the response True iff this is the response false . |
isTrue | protected boolean isTrue(Document response)(Code) | | Answer true if the given document is the response <true> from a DIG reasoner.
Parameters: response - The document encoding the response True iff this is the response true . |
mapNode | protected Node mapNode(String uri)(Code) | | Answer a node corresponding to the given URI.
Parameters: uri - A node URI, or the special string *, or null. A Jena Node corresponding to the given URI |
translateConceptSetResponse | protected ExtendedIterator translateConceptSetResponse(Document response, TriplePattern query, boolean object, DIGAdapter da)(Code) | | Translate a concept set document into an extended iterator
of triples, placing the concept identities into either the subject
or object position in the returned triple.
Parameters: response - The response XML document Parameters: query - The original query Parameters: object - Flag to indicate that the concept names should occupy the subject fieldof the returned triple, otherwise the object |
translateIndividualPairSetResponse | protected ExtendedIterator translateIndividualPairSetResponse(Document response, TriplePattern query)(Code) | | Translate an individualPairSet response, which lists pairs of related
individuals for some queried relation p.
Parameters: response - Parameters: query - An iterator over triples formed from the result pairs and the known query predicate |
translateIndividualSetResponse | protected ExtendedIterator translateIndividualSetResponse(Document response, TriplePattern query, boolean object)(Code) | | Translate an instance set document into an extended iterator
of triples, placing the concept identities into either the subject
or object position in the returned triple.
Parameters: response - The response XML document Parameters: query - The original query Parameters: object - Flag to indicate that the instance names should occupy the subject fieldof the returned triple, or the object |
translateNameSetResponse | protected ExtendedIterator translateNameSetResponse(Document response, TriplePattern query, boolean object, String[] path)(Code) | | Translate an document encoding a set of named entities into an extended iterator
of triples, placing the concept identities into either the subject
or object position in the returned triple.
Parameters: response - The response XML document Parameters: query - The original query Parameters: object - Flag to indicate that the instance names should occupy the subject fieldof the returned triple, or the object Parameters: path - The element name path to follow from the root |
translatePattern | abstract public Document translatePattern(TriplePattern query, DIGAdapter da)(Code) | | Answer an XML document that presents the translation of the query into DIG query language.
|
translatePattern | abstract public Document translatePattern(TriplePattern pattern, DIGAdapter da, Model premises)(Code) | | 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.
|
translateRoleSetResponse | protected ExtendedIterator translateRoleSetResponse(Document response, TriplePattern query, boolean object)(Code) | | Translate a role set document into an extended iterator
of triples, placing the concept identities into either the subject
or object position in the returned triple.
Parameters: response - The response XML document Parameters: query - The original query Parameters: object - Flag to indicate that the role names should occupy the subject fieldof the returned triple, or the object |
translateSpecialConcepts | protected ExtendedIterator translateSpecialConcepts(Document response, DIGAdapter da, Node ref, Node pred, boolean refSubject)(Code) | | Answer an iterator that contains appropriate triples if the given
response contains either top or bottom elements.
Parameters: response - The XML document to process Parameters: da - The DIG adapter Parameters: ref - The fixed node in the triple Parameters: pred - The predicate in the triple Parameters: refSubject - True if the reference node is to be the subject of anycreated triples An iterator over any subset of Thing and Nothing, if eitheror both of top and bottom appear as elements in the response document. |
trigger | public boolean trigger(TriplePattern pattern, DIGAdapter da, Model premises)(Code) | | Answer true if this translator applies to the given triple pattern.
Parameters: pattern - An incoming patter to match against Parameters: da - The current dig adapter Parameters: premises - An optional Model that is used to convey the statements in the additionalpremises to the query True if this translator applies to the pattern. |
trigger | protected boolean trigger(Node lhs, Node rhs, Model premises)(Code) | | A node matches a trigger (lhs) node if either the lhs is null, or
the nodes are equal. Note: not matching in the same sense as triple patterns.
Parameters: lhs - The trigger node to match against Parameters: rhs - The incoming pattern node Parameters: premises - A model that conveys additional information about the premisesof the query, which might assist the trigger to suceed or fail. By default itis ignored. True if match |
|
|