Class StatsMatcher
- java.lang.Object
-
- org.apache.jena.sparql.engine.optimizer.StatsMatcher
-
public final class StatsMatcher extends java.lang.Object
Stats format:(stats (meta ...) ((S P O) weight) (
whereweight) ) S
,P
,O
is a URI, variable, literal or one of the wordsANY
(matches anything),VAR
(matches a variable),TERM
(matches a fixed URI, or literal),URI
,BNODE
,LITERAL
(matches one of these types).
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COUNT
static java.lang.String
META
static Item
OTHER
static java.lang.String
STATS
static double
weightPO
static double
weightPO_small
static double
weightSP
static double
weightSP_small
static double
weightTypeO
static double
weightTypeO_small
-
Constructor Summary
Constructors Constructor Description StatsMatcher()
StatsMatcher(java.lang.String filename)
StatsMatcher(Item stats)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPattern(Pattern pattern)
void
addPatterns(Node predicate, double numProp)
Add patterns based solely on the predicate count and some guessingvoid
addPatternsSmall(Node predicate, double numProp)
Add patterns based solely on the predicate count and some guessing for a small graph (less than a few thousand triples)double
match(Triple t)
double
match(PatternTriple pTriple)
double
match(Item subj, Item pred, Item obj)
Return the matching weight for the first triple match found, else apply default value for fixed, unknown predicate, else return NOMATCHvoid
printSSE(java.io.OutputStream ps)
java.lang.String
toString()
-
-
-
Field Detail
-
STATS
public static final java.lang.String STATS
- See Also:
- Constant Field Values
-
META
public static final java.lang.String META
- See Also:
- Constant Field Values
-
COUNT
public static final java.lang.String COUNT
- See Also:
- Constant Field Values
-
OTHER
public static final Item OTHER
-
weightSP
public static final double weightSP
- See Also:
- Constant Field Values
-
weightPO
public static final double weightPO
- See Also:
- Constant Field Values
-
weightTypeO
public static final double weightTypeO
- See Also:
- Constant Field Values
-
weightSP_small
public static final double weightSP_small
- See Also:
- Constant Field Values
-
weightPO_small
public static final double weightPO_small
- See Also:
- Constant Field Values
-
weightTypeO_small
public static final double weightTypeO_small
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StatsMatcher
public StatsMatcher()
-
StatsMatcher
public StatsMatcher(java.lang.String filename)
-
StatsMatcher
public StatsMatcher(Item stats)
-
-
Method Detail
-
addPatterns
public void addPatterns(Node predicate, double numProp)
Add patterns based solely on the predicate count and some guessing
-
addPatternsSmall
public void addPatternsSmall(Node predicate, double numProp)
Add patterns based solely on the predicate count and some guessing for a small graph (less than a few thousand triples)
-
addPattern
public void addPattern(Pattern pattern)
-
match
public double match(Triple t)
-
match
public double match(PatternTriple pTriple)
-
match
public double match(Item subj, Item pred, Item obj)
Return the matching weight for the first triple match found, else apply default value for fixed, unknown predicate, else return NOMATCH
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
printSSE
public void printSSE(java.io.OutputStream ps)
-
-