public class URIMakerRule extends Object implements Comparator<TripleRelation>
The URI maker rule states that any URI that matches a URI pattern is not contained in a URI column. The reasoning is that lookup of a node in a URI pattern is relatively quick -- often it requires just an integer lookup in a primary key table -- but lookup in URI columns may require multiple full table scans. Since URI lookup is such a common operation, this rule can help a lot by reducing full table scans.
Checking a number of NodeMakers against the rule works like this:
createRuleChecker(Node)
,URIMakerRule.URIMakerRuleChecker.canMatch(NodeMaker)
will return false
if the argument is backed by a URI column.Performance is best when all candidate NodeMakers backed by URI patterns are
sent to the rule checker before any NodeMaker backed by a URI column. For this
purpose, sortRDFRelations(Collection)
sorts a collection of
RDFRelations in an order that puts URI patterns first.
Modifier and Type | Class and Description |
---|---|
class |
URIMakerRule.URIMakerRuleChecker |
Constructor and Description |
---|
URIMakerRule() |
Modifier and Type | Method and Description |
---|---|
int |
compare(TripleRelation o1,
TripleRelation o2) |
URIMakerRule.URIMakerRuleChecker |
createRuleChecker(Node node) |
List<TripleRelation> |
sortRDFRelations(Collection<TripleRelation> tripleRelations) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
public List<TripleRelation> sortRDFRelations(Collection<TripleRelation> tripleRelations)
public URIMakerRule.URIMakerRuleChecker createRuleChecker(Node node)
public int compare(TripleRelation o1, TripleRelation o2)
compare
in interface Comparator<TripleRelation>