com.hp.hpl.jena.sparql.engine.optimizer
Class StatsMatcher
java.lang.Object
com.hp.hpl.jena.sparql.engine.optimizer.StatsMatcher
public final class StatsMatcher
- extends Object
Stats format:
(stats
(meta ...)
((S P O) weight)
( weight)
)
where S
, P
, O
is a URI, variable,
literal or one of the words ANY
(matches anything),
VAR
(matches a variable), TERM
(matches a
fixed URI, or literal), URI
, BNODE
,
LITERAL
(matches one of these types).
Method Summary |
void |
addPattern(Pattern pattern)
|
void |
addPatterns(com.hp.hpl.jena.graph.Node predicate,
double numProp)
Add patterns based solely on the predicate count and some guessing |
void |
addPatternsSmall(com.hp.hpl.jena.graph.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(Item subj,
Item pred,
Item obj)
Return the matching weight for the first triple match found,
else apply default value for fixed, unknnown predciate,
else return NOMATCH |
double |
match(PatternTriple pTriple)
|
double |
match(com.hp.hpl.jena.graph.Triple t)
|
void |
printSSE(PrintStream ps)
|
String |
toString()
|
STATS
public static final String STATS
- See Also:
- Constant Field Values
META
public static final String META
- See Also:
- Constant Field Values
COUNT
public static final 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
StatsMatcher
public StatsMatcher()
StatsMatcher
public StatsMatcher(String filename)
StatsMatcher
public StatsMatcher(Item stats)
addPatterns
public void addPatterns(com.hp.hpl.jena.graph.Node predicate,
double numProp)
- Add patterns based solely on the predicate count and some guessing
addPatternsSmall
public void addPatternsSmall(com.hp.hpl.jena.graph.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(com.hp.hpl.jena.graph.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, unknnown predciate,
else return NOMATCH
toString
public String toString()
- Overrides:
toString
in class Object
printSSE
public void printSSE(PrintStream ps)
Licenced under the Apache License, Version 2.0