Package implementation.algorithms
Class Cluster
- java.lang.Object
-
- implementation.algorithms.Cluster
-
-
Method Summary
Modifier and Type Method Description java.lang.String
answersListString(CollectionsModel colMd)
Not sure if this is usefuljava.lang.String
answersString()
int
compareTo(Cluster other)
boolean
connected(java.util.Set<org.apache.jena.sparql.core.Var> vars)
org.apache.jena.sparql.algebra.Table
getAnswers()
The list containing all answers held by this cluster i.e.java.util.List<org.apache.jena.graph.Node>
getAnswersList()
java.util.Set<org.apache.jena.sparql.syntax.Element>
getAvailableQueryElements()
The query elements that have yet to be tested in this clusterjava.util.Set<org.apache.jena.sparql.core.Var>
getConnectedVars()
The Variables that are connected to this Clusterint
getExtensionDistance()
The size of the extension of this Cluster's query (i.e.org.apache.jena.sparql.algebra.Table
getMatchSet()
The Match-set containing all the answers to the relaxed queryMatchTreeRoot
getMatchTree()
This Cluster's Match-Treejava.util.Set<org.apache.jena.sparql.core.Var>
getProj()
The head of the query Normally only one variable but represented as a list for theoretical use as a query headint
getRelaxDistance()
The number of relaxations done to obtain this clusterjava.util.Set<org.apache.jena.sparql.syntax.Element>
getRelaxQueryElements()
The body of the relaxed Queryjava.util.Set<org.apache.jena.sparql.syntax.Element>
getRemovedQueryElements()
Query elements that have been tested and thrown away/relaxed, to avoid putting them twicevoid
move(org.apache.jena.sparql.syntax.Element element, java.util.Set<org.apache.jena.sparql.core.Var> vars)
Substract an element from the available query elements to mark it as used and adds it to the elements distinctive of this Cluster's neighborsjava.lang.String
queryString()
void
relax(org.apache.jena.sparql.syntax.Element element, CollectionsModel graph, int descriptionDepth)
Substracts an element from the available query elements to mark it as used and increases the relax distance of this Cluster by onejava.lang.String
relaxQueryElementsString(CollectionsModel colMd)
java.lang.String
toString()
java.lang.String
toString(CollectionsModel colMd)
Same astoString()
but usesanswersListString(CollectionsModel)
to write answers More efficient because it doesn't use a ResultSet
-
-
-
Method Detail
-
getProj
public java.util.Set<org.apache.jena.sparql.core.Var> getProj()
The head of the query Normally only one variable but represented as a list for theoretical use as a query head
-
getConnectedVars
public java.util.Set<org.apache.jena.sparql.core.Var> getConnectedVars()
The Variables that are connected to this Cluster
-
getRelaxQueryElements
public java.util.Set<org.apache.jena.sparql.syntax.Element> getRelaxQueryElements()
The body of the relaxed Query
-
getAvailableQueryElements
public java.util.Set<org.apache.jena.sparql.syntax.Element> getAvailableQueryElements()
The query elements that have yet to be tested in this cluster
-
getRemovedQueryElements
public java.util.Set<org.apache.jena.sparql.syntax.Element> getRemovedQueryElements()
Query elements that have been tested and thrown away/relaxed, to avoid putting them twice
-
getRelaxDistance
public int getRelaxDistance()
The number of relaxations done to obtain this cluster
-
getExtensionDistance
public int getExtensionDistance()
The size of the extension of this Cluster's query (i.e. the number of answers
-
getMatchSet
public org.apache.jena.sparql.algebra.Table getMatchSet()
The Match-set containing all the answers to the relaxed query
-
getAnswers
public org.apache.jena.sparql.algebra.Table getAnswers()
The list containing all answers held by this cluster i.e. not in any cluster with a lower relaxation distance
-
getMatchTree
public MatchTreeRoot getMatchTree()
This Cluster's Match-Tree- See Also:
MatchTreeNode
-
compareTo
public int compareTo(Cluster other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Cluster>
- Returns:
- the difference between this Cluster's relax distance and the other Cluster
-
connected
public boolean connected(java.util.Set<org.apache.jena.sparql.core.Var> vars)
- Parameters:
vars
- A list of Variables- Returns:
- true if this cluster is connected to an element mentioning these variables
-
move
public void move(org.apache.jena.sparql.syntax.Element element, java.util.Set<org.apache.jena.sparql.core.Var> vars) throws PartitionException
Substract an element from the available query elements to mark it as used and adds it to the elements distinctive of this Cluster's neighbors- Parameters:
element
- The Element to be movedvars
- The Jena Variables mentioned to the element- Throws:
PartitionException
-
relax
public void relax(org.apache.jena.sparql.syntax.Element element, CollectionsModel graph, int descriptionDepth) throws PartitionException
Substracts an element from the available query elements to mark it as used and increases the relax distance of this Cluster by one- Parameters:
element
- The element to relax- Throws:
PartitionException
-
queryString
public java.lang.String queryString()
- Returns:
- The string for the relaxed Query corresponding to this Cluster
-
answersString
public java.lang.String answersString()
- Returns:
- the answers as a string formatted by Jena
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(CollectionsModel colMd)
Same astoString()
but usesanswersListString(CollectionsModel)
to write answers More efficient because it doesn't use a ResultSet- Parameters:
colMd
- the model to use for prefixes
-
getAnswersList
public java.util.List<org.apache.jena.graph.Node> getAnswersList()
- Returns:
- This cluster's answers as a List of RDF Nodes
-
answersListString
public java.lang.String answersListString(CollectionsModel colMd)
Not sure if this is useful- Parameters:
colMd
- The model in which to search prefix mappings
-
relaxQueryElementsString
public java.lang.String relaxQueryElementsString(CollectionsModel colMd)
- Parameters:
colMd
- The CollectionsModel in which to search prefix mappings
-
-