com.bigdata.rdf.rules
Class AbstractRuleFastClosure_3_5_6_7_9.FastClosureRuleTask

java.lang.Object
  extended by com.bigdata.rdf.rules.AbstractRuleFastClosure_3_5_6_7_9.FastClosureRuleTask
All Implemented Interfaces:
IStepTask, Callable<RuleStats>
Enclosing class:
AbstractRuleFastClosure_3_5_6_7_9

protected abstract static class AbstractRuleFastClosure_3_5_6_7_9.FastClosureRuleTask
extends Object
implements IStepTask

Custom rule execution task. You must implement getSet().

Version:
$Id: AbstractRuleFastClosure_3_5_6_7_9.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Field Summary
protected  IConstant<Long> propertyId
           
protected  IConstant<Long> rdfsSubPropertyOf
           
 
Constructor Summary
AbstractRuleFastClosure_3_5_6_7_9.FastClosureRuleTask(String database, String focusStore, IRule rule, IJoinNexus joinNexus, IBuffer<ISolution[]> buffer, IConstant<Long> rdfsSubPropertyOf, IConstant<Long> propertyId)
          (?x, {P}, ?y) -> (?x, propertyId, ?y) Note: Both the database and the (optional) focusStore relation names MUST be declared for these rules.
 
Method Summary
 RuleStats call()
          Evaluate the rule.
protected abstract  Set<Long> getSet()
          Return the set of term identifiers that will be processed by the rule.
protected  long[] getSortedArray(Set<Long> ids)
          Convert a Set of term identifiers into a sorted array of term identifiers.
protected  Set<Long> getSubProperties()
          Delegates to AbstractRuleFastClosure_3_5_6_7_9.SubPropertyClosureTask
protected  Set<Long> getSubPropertiesOf(IConstant<Long> propertyId)
          Delegates to AbstractRuleFastClosure_3_5_6_7_9.SubPropertiesOfClosureTask
protected  IRelation<ISPO> getView()
          Return the IRelation (or RelationFusedView) used by the getSet() impls for their IAccessPaths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rdfsSubPropertyOf

protected final IConstant<Long> rdfsSubPropertyOf

propertyId

protected final IConstant<Long> propertyId
Constructor Detail

AbstractRuleFastClosure_3_5_6_7_9.FastClosureRuleTask

public AbstractRuleFastClosure_3_5_6_7_9.FastClosureRuleTask(String database,
                                                             String focusStore,
                                                             IRule rule,
                                                             IJoinNexus joinNexus,
                                                             IBuffer<ISolution[]> buffer,
                                                             IConstant<Long> rdfsSubPropertyOf,
                                                             IConstant<Long> propertyId)
(?x, {P}, ?y) -> (?x, propertyId, ?y) Note: Both the database and the (optional) focusStore relation names MUST be declared for these rules. While the rule only declares a single tail predicate, there is a "hidden" query based on the [database + focusStore] fused view that populates the P,D,C,R, or T Set which is an input to the custom evaluation of the rule.

Parameters:
database - Name of the database relation (required).
focusStore - Optional name of the focusStore relation (may be null). When non-null, this is used to query the fused view of the [database + focusStore] in getView().
rule - The rule.
joinNexus -
buffer - A buffer used to accumulate chunks of entailments.
rdfsSubPropertyOf - The Constant corresponding to the term identifier for rdfs:subPropertyOf.
propertyId - The propertyId to be used in the assertions.
Method Detail

call

public RuleStats call()
Description copied from interface: IStepTask
Evaluate the rule.

Specified by:
call in interface IStepTask
Specified by:
call in interface Callable<RuleStats>

getSortedArray

protected long[] getSortedArray(Set<Long> ids)
Convert a Set of term identifiers into a sorted array of term identifiers.

Note: When issuing multiple queries against the database, it is generally faster to issue those queries in key order.

Returns:
The sorted term identifiers.

getView

protected IRelation<ISPO> getView()
Return the IRelation (or RelationFusedView) used by the getSet() impls for their IAccessPaths.


getSet

protected abstract Set<Long> getSet()
Return the set of term identifiers that will be processed by the rule. When the closure is being computed for truth maintenance the implementation MUST read from the [database+focusStore] fused view. Otherwise it reads from the database.

Note: The subclass need only invoke getSubProperties() or getSubPropertiesOf(IConstant) as appropriate for the rule.

Returns:
The set.

getSubProperties

protected Set<Long> getSubProperties()
Delegates to AbstractRuleFastClosure_3_5_6_7_9.SubPropertyClosureTask

Returns:
The closure.

getSubPropertiesOf

protected Set<Long> getSubPropertiesOf(IConstant<Long> propertyId)
Delegates to AbstractRuleFastClosure_3_5_6_7_9.SubPropertiesOfClosureTask

Parameters:
propertyId - The property of interest.
Returns:
The closure.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.