|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.stanbol.enhancer.servicesapi.helper.ExecutionPlanHelper
public final class ExecutionPlanHelper
| Method Summary | |
|---|---|
static void |
addDependend(java.util.Collection<org.apache.clerezza.rdf.core.NonLiteral> collection,
org.apache.clerezza.rdf.core.TripleCollection executionPlan,
org.apache.clerezza.rdf.core.NonLiteral executionNode)
|
static org.apache.clerezza.rdf.core.Graph |
calculateExecutionPlan(java.lang.String chainName,
java.util.List<EnhancementEngine> availableEngines,
java.util.Set<java.lang.String> optional,
java.util.Set<java.lang.String> missing)
Creates an execution plan based on the ServiceProperties.ENHANCEMENT_ENGINE_ORDERING of the parsed
EnhancementEngines. |
static org.apache.clerezza.rdf.core.NonLiteral |
createExecutionPlan(org.apache.clerezza.rdf.core.MGraph graph,
java.lang.String chainName)
Creates an ExecutionPlan for the parsed chainName in the parsed Graph |
static java.util.List<EnhancementEngine> |
getActiveEngines(EnhancementEngineManager engineManager,
org.apache.clerezza.rdf.core.TripleCollection ep)
Calculates a sorted list of active EnhancementEngines form the given ExecutinPlan |
static java.util.Set<org.apache.clerezza.rdf.core.NonLiteral> |
getDependend(org.apache.clerezza.rdf.core.TripleCollection executionPlan,
org.apache.clerezza.rdf.core.NonLiteral executionNode)
|
static java.lang.String |
getEngine(org.apache.clerezza.rdf.core.TripleCollection executionPlan,
org.apache.clerezza.rdf.core.NonLiteral executionNode)
|
static java.util.Set<org.apache.clerezza.rdf.core.NonLiteral> |
getExecutable(org.apache.clerezza.rdf.core.TripleCollection executionPlan,
java.util.Set<org.apache.clerezza.rdf.core.NonLiteral> executed)
Evaluates the parsed execution plan and the set of already executed
ep:ExecutionNodes to find the next
nodes that can be executed. |
static java.util.Set<org.apache.clerezza.rdf.core.NonLiteral> |
getExecutionNodes(org.apache.clerezza.rdf.core.TripleCollection ep,
org.apache.clerezza.rdf.core.NonLiteral executionPlanNode)
Getter for the set of ExecutionNodes part of an execution plan. |
static org.apache.clerezza.rdf.core.NonLiteral |
getExecutionPlan(org.apache.clerezza.rdf.core.TripleCollection graph,
java.lang.String chainName)
Getter for the ExecutionPlan.EXECUTION_PLAN node of an execution
plan for the given chainNmame. |
static boolean |
isOptional(org.apache.clerezza.rdf.core.TripleCollection executionPlan,
org.apache.clerezza.rdf.core.NonLiteral executionNode)
|
static java.util.Set<java.lang.String> |
validateExecutionPlan(org.apache.clerezza.rdf.core.TripleCollection executionPlan)
Utility that checks if the parsed graph contains a valid execution plan. |
static org.apache.clerezza.rdf.core.NonLiteral |
writeExecutionNode(org.apache.clerezza.rdf.core.MGraph graph,
org.apache.clerezza.rdf.core.NonLiteral epNode,
java.lang.String engineName,
boolean optional,
java.util.Set<org.apache.clerezza.rdf.core.NonLiteral> dependsOn)
Writes all triples for an ep:ExecutionNode to the parsed MGraph. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static org.apache.clerezza.rdf.core.NonLiteral writeExecutionNode(org.apache.clerezza.rdf.core.MGraph graph,
org.apache.clerezza.rdf.core.NonLiteral epNode,
java.lang.String engineName,
boolean optional,
java.util.Set<org.apache.clerezza.rdf.core.NonLiteral> dependsOn)
MGraph.
An BNode is use for representing the execution node resource.
graph - the graph to write the triples. MUST NOT be emptyepNode - the NonLiteral representing the ep:ExecutionPlanengineName - the name of the engine. MUST NOT be null nor emptyoptional - if the execution of this node is optional or requireddependsOn - other nodes that MUST BE executed before this one. Parse
null or an empty set if none.
public static org.apache.clerezza.rdf.core.NonLiteral createExecutionPlan(org.apache.clerezza.rdf.core.MGraph graph,
java.lang.String chainName)
graph - the graphchainName - the chain name
public static java.util.Set<org.apache.clerezza.rdf.core.NonLiteral> getExecutable(org.apache.clerezza.rdf.core.TripleCollection executionPlan,
java.util.Set<org.apache.clerezza.rdf.core.NonLiteral> executed)
execution plan and the set of already executed
ep:ExecutionNodes to find the next
nodes that can be executed.
executionPlan - the execution planexecuted - the already executed nodes
or an empty set to determine the nodes to start the execution.
public static org.apache.clerezza.rdf.core.Graph calculateExecutionPlan(java.lang.String chainName,
java.util.List<EnhancementEngine> availableEngines,
java.util.Set<java.lang.String> optional,
java.util.Set<java.lang.String> missing)
ServiceProperties.ENHANCEMENT_ENGINE_ORDERING of the parsed
EnhancementEngines. NOTE that the parsed list is modified as it is sroted by
using the EnhancementEngineHelper.EXECUTION_ORDER_COMPARATOR.
A second parameter with the set of optional engines can be used to define
what ExecutionPlan.EXECUTION_NODE in the execution plan should be
marked as ExecutionPlan.OPTIONAL.
chainName - the name of the Chain to build the execution plan foravailableEngines - the list of enginesthe - names of optional engines.
public static java.util.Set<java.lang.String> validateExecutionPlan(org.apache.clerezza.rdf.core.TripleCollection executionPlan)
throws ChainException
This especially checks:
ExecutionPlan.EXECUTION_NODEs
ExecutionPlan.ENGINE property and
ExecutionPlan.DEPENDS_ON values do actually point
to an other execution node in the parsed graph
This method does not modify the parsed graph. Therefore it is save
to parse a Graph object.
TODO: There is no check for cycles implemented yet.
the - graph to check
ChainException
public static java.util.Set<org.apache.clerezza.rdf.core.NonLiteral> getDependend(org.apache.clerezza.rdf.core.TripleCollection executionPlan,
org.apache.clerezza.rdf.core.NonLiteral executionNode)
public static void addDependend(java.util.Collection<org.apache.clerezza.rdf.core.NonLiteral> collection,
org.apache.clerezza.rdf.core.TripleCollection executionPlan,
org.apache.clerezza.rdf.core.NonLiteral executionNode)
public static boolean isOptional(org.apache.clerezza.rdf.core.TripleCollection executionPlan,
org.apache.clerezza.rdf.core.NonLiteral executionNode)
public static java.lang.String getEngine(org.apache.clerezza.rdf.core.TripleCollection executionPlan,
org.apache.clerezza.rdf.core.NonLiteral executionNode)
public static java.util.List<EnhancementEngine> getActiveEngines(EnhancementEngineManager engineManager,
org.apache.clerezza.rdf.core.TripleCollection ep)
engineManager - The engine manager (OSGI service or EnginesTracker)ep - the execution plan
public static org.apache.clerezza.rdf.core.NonLiteral getExecutionPlan(org.apache.clerezza.rdf.core.TripleCollection graph,
java.lang.String chainName)
ExecutionPlan.EXECUTION_PLAN node of an execution
plan for the given chainNmame. This method is handy for components that
need to get an execution plan for a graph that might potentially contain
more than a single execution plan.
graph - the graphchainName - the chain name
null if not found
public static java.util.Set<org.apache.clerezza.rdf.core.NonLiteral> getExecutionNodes(org.apache.clerezza.rdf.core.TripleCollection ep,
org.apache.clerezza.rdf.core.NonLiteral executionPlanNode)
ep - the execution plan graphexecutionPlanNode - the execution plan node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||