public class QueryTreeImpl<N> extends Object implements QueryTree<N>
Modifier and Type | Class and Description |
---|---|
static class |
QueryTreeImpl.LiteralNodeConversionStrategy |
static class |
QueryTreeImpl.LiteralNodeSubsumptionStrategy |
static class |
QueryTreeImpl.NodeType |
Constructor and Description |
---|
QueryTreeImpl(N userObject) |
QueryTreeImpl(N userObject,
QueryTreeImpl.NodeType nodeType) |
QueryTreeImpl(N userObject,
QueryTreeImpl.NodeType nodeType,
int id) |
QueryTreeImpl(QueryTree<N> tree) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(QueryTree<N> child) |
void |
addChild(QueryTree<N> child,
Object edge) |
void |
addChild(QueryTreeImpl<N> child) |
void |
addChild(QueryTreeImpl<N> child,
int position) |
void |
addChild(QueryTreeImpl<N> child,
Object edge) |
void |
addChild(QueryTreeImpl<N> child,
Object edge,
int position) |
void |
addLiteral(org.apache.jena.rdf.model.Literal l) |
void |
addLiterals(Collection<org.apache.jena.rdf.model.Literal> literals) |
String |
asJSON() |
org.semanticweb.owlapi.model.OWLClassExpression |
asOWLClassExpression()
Converts the query tree in a corresponding OWL class expression.
|
org.semanticweb.owlapi.model.OWLClassExpression |
asOWLClassExpression(QueryTreeImpl.LiteralNodeConversionStrategy literalNodeConversionStrategy)
Converts the query tree in a corresponding OWL class expression.
|
void |
clearChildren() |
Object |
clone() |
void |
dump() |
void |
dump(PrintWriter writer) |
void |
dump(PrintWriter writer,
int indent) |
List<N> |
fillDepthFirst() |
int |
getChildCount() |
List<QueryTree<N>> |
getChildren() |
List<QueryTree<N>> |
getChildren(Object edge) |
List<QueryTree<N>> |
getChildrenClosure() |
org.apache.jena.datatypes.RDFDatatype |
getDatatype() |
Object |
getEdge(QueryTree<N> child) |
Set<Object> |
getEdges() |
int |
getId() |
List<QueryTree<N>> |
getLeafs() |
Set<org.apache.jena.rdf.model.Literal> |
getLiterals() |
int |
getMaxDepth() |
QueryTree<N> |
getNodeById(int nodeId) |
QueryTreeImpl.NodeType |
getNodeType() |
QueryTree<N> |
getParent() |
List<QueryTree<N>> |
getPathToRoot() |
QueryTree<N> |
getRoot() |
int |
getSize() |
QueryTree<N> |
getSPARQLQueryTree() |
String |
getStringRepresentation() |
String |
getStringRepresentation(boolean stopIfChildIsResourceNode)
Prints the query tree and shows children of resources only if enabled.
|
String |
getStringRepresentation(int indent) |
int |
getTriplePatternCount() |
N |
getUserObject()
Gets the "content" of this tree node.
|
Set<N> |
getUserObjectClosure() |
List<N> |
getUserObjectPathToRoot() |
boolean |
isBlankNode() |
boolean |
isEmpty() |
boolean |
isLeaf() |
boolean |
isLiteralNode() |
boolean |
isResourceNode() |
boolean |
isRoot() |
boolean |
isSameTreeAs(QueryTree<N> tree) |
boolean |
isSubsumedBy(QueryTree<N> tree) |
boolean |
isSubsumedBy(QueryTree<N> tree,
boolean stopAfterError) |
boolean |
isSubsumedBy(QueryTree<N> tree,
QueryTreeImpl.LiteralNodeSubsumptionStrategy strategy) |
boolean |
isTagged() |
boolean |
isVarNode() |
int |
removeChild(QueryTreeImpl<N> child) |
void |
removeChildren(Object edge)
Removes all children connected by the given edge.
|
void |
removeChildren(Set<QueryTreeImpl<N>> children) |
void |
replace(QueryTreeImpl<N> tree) |
boolean |
sameType(QueryTree<N> tree) |
void |
setId(int id)
Set the ID of the current node
|
void |
setIsBlankNode(boolean isBlankNode) |
void |
setIsLiteralNode(boolean isLiteralNode) |
void |
setIsResourceNode(boolean isResourceNode) |
void |
setParent(QueryTree<N> parent) |
void |
setParent(QueryTreeImpl<N> parent) |
void |
setUserObject(N userObject) |
void |
setVarNode(boolean isVarNode) |
void |
sortChildren(Comparator<QueryTree<N>> comparator) |
void |
tag() |
org.apache.jena.query.Query |
toQuery() |
org.apache.jena.query.Query |
toSPARQLQuery() |
String |
toSPARQLQueryString() |
String |
toSPARQLQueryString(boolean filterMeaninglessProperties,
boolean useNumericalFilters) |
String |
toSPARQLQueryString(boolean filterMeaninglessProperties,
boolean useNumericalFilters,
Map<String,String> prefixMap) |
String |
toString() |
public QueryTreeImpl(N userObject)
public QueryTreeImpl(N userObject, QueryTreeImpl.NodeType nodeType)
public QueryTreeImpl(N userObject, QueryTreeImpl.NodeType nodeType, int id)
public QueryTreeImpl(QueryTree<N> tree)
public N getUserObject()
QueryTree
getUserObject
in interface QueryTree<N>
public void setUserObject(N userObject)
setUserObject
in interface QueryTree<N>
public void setId(int id)
QueryTree
public int getId()
public QueryTreeImpl.NodeType getNodeType()
getNodeType
in interface QueryTree<N>
public QueryTree<N> getNodeById(int nodeId)
getNodeById
in interface QueryTree<N>
public boolean isLiteralNode()
isLiteralNode
in interface QueryTree<N>
public void setIsLiteralNode(boolean isLiteralNode)
setIsLiteralNode
in interface QueryTree<N>
public void setIsBlankNode(boolean isBlankNode)
public boolean isBlankNode()
public boolean isResourceNode()
isResourceNode
in interface QueryTree<N>
public void setIsResourceNode(boolean isResourceNode)
setIsResourceNode
in interface QueryTree<N>
public void setVarNode(boolean isVarNode)
setVarNode
in interface QueryTree<N>
public void setParent(QueryTreeImpl<N> parent)
public void addChild(QueryTreeImpl<N> child)
public void addChild(QueryTreeImpl<N> child, int position)
public void addChild(QueryTreeImpl<N> child, Object edge)
public void addChild(QueryTreeImpl<N> child, Object edge, int position)
public int removeChild(QueryTreeImpl<N> child)
removeChild
in interface QueryTree<N>
public void removeChildren(Set<QueryTreeImpl<N>> children)
public void removeChildren(Object edge)
removeChildren
in interface QueryTree<N>
public void sortChildren(Comparator<QueryTree<N>> comparator)
sortChildren
in interface QueryTree<N>
public void clearChildren()
public List<QueryTree<N>> getChildren()
getChildren
in interface QueryTree<N>
public List<QueryTree<N>> getChildren(Object edge)
getChildren
in interface QueryTree<N>
public int getChildCount()
getChildCount
in interface QueryTree<N>
public boolean isSubsumedBy(QueryTree<N> tree)
isSubsumedBy
in interface QueryTree<N>
public boolean isSubsumedBy(QueryTree<N> tree, QueryTreeImpl.LiteralNodeSubsumptionStrategy strategy)
isSubsumedBy
in interface QueryTree<N>
public boolean isSubsumedBy(QueryTree<N> tree, boolean stopAfterError)
isSubsumedBy
in interface QueryTree<N>
public List<QueryTree<N>> getPathToRoot()
getPathToRoot
in interface QueryTree<N>
public List<N> getUserObjectPathToRoot()
getUserObjectPathToRoot
in interface QueryTree<N>
public List<QueryTree<N>> getChildrenClosure()
getChildrenClosure
in interface QueryTree<N>
public Set<N> getUserObjectClosure()
getUserObjectClosure
in interface QueryTree<N>
public int getTriplePatternCount()
getTriplePatternCount
in interface QueryTree<N>
public QueryTree<N> getSPARQLQueryTree()
public String getStringRepresentation()
getStringRepresentation
in interface QueryTree<N>
public String getStringRepresentation(boolean stopIfChildIsResourceNode)
getStringRepresentation
in interface QueryTree<N>
stopIfChildIsResourceNode
- whether to stop if child is resourcepublic String getStringRepresentation(int indent)
public void dump(PrintWriter writer)
public void dump(PrintWriter writer, int indent)
public List<N> fillDepthFirst()
fillDepthFirst
in interface QueryTree<N>
public void replace(QueryTreeImpl<N> tree)
public int getSize()
public int getMaxDepth()
getMaxDepth
in interface QueryTree<N>
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public boolean isSameTreeAs(QueryTree<N> tree)
isSameTreeAs
in interface QueryTree<N>
public org.apache.jena.query.Query toSPARQLQuery()
toSPARQLQuery
in interface QueryTree<N>
public String toSPARQLQueryString()
toSPARQLQueryString
in interface QueryTree<N>
public String toSPARQLQueryString(boolean filterMeaninglessProperties, boolean useNumericalFilters)
toSPARQLQueryString
in interface QueryTree<N>
public String toSPARQLQueryString(boolean filterMeaninglessProperties, boolean useNumericalFilters, Map<String,String> prefixMap)
toSPARQLQueryString
in interface QueryTree<N>
public org.apache.jena.query.Query toQuery()
public void addLiteral(org.apache.jena.rdf.model.Literal l)
public Set<org.apache.jena.rdf.model.Literal> getLiterals()
getLiterals
in interface QueryTree<N>
public void addLiterals(Collection<org.apache.jena.rdf.model.Literal> literals)
public org.apache.jena.datatypes.RDFDatatype getDatatype()
getDatatype
in interface QueryTree<N>
public org.semanticweb.owlapi.model.OWLClassExpression asOWLClassExpression()
asOWLClassExpression
in interface QueryTree<N>
public org.semanticweb.owlapi.model.OWLClassExpression asOWLClassExpression(QueryTreeImpl.LiteralNodeConversionStrategy literalNodeConversionStrategy)
asOWLClassExpression
in interface QueryTree<N>
DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2019 Jens Lehmann