Class JCoReUIMAPipeline
- java.lang.Object
-
- de.julielab.jcore.pipeline.builder.base.main.JCoReUIMAPipeline
-
public class JCoReUIMAPipeline extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringAGGREGATE_ANALYSIS_ENGINE_WITH_INTEGRATED_DELEGATE_DESCRIPTORS_XMLstatic StringCPE_AAE_DESC_NAMEstatic StringDIR_CONFstatic StringDIR_DESCstatic StringDIR_DESC_ALLstatic StringDIR_LIB
-
Constructor Summary
Constructors Constructor Description JCoReUIMAPipeline()Empty constructur for creating a pipeline from scratch.JCoReUIMAPipeline(File baseDirectory)Set the pipeline base directory to later load the pipeline from.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCasMultiplier(Description multiplier)Add a CAS multiplier to this pipeline.voidaddCcDesc(Description ccDesc)voidaddDelegateAe(Description aeDesc)Add an analysis engine to this pipeline.voidclear()org.apache.uima.analysis_engine.AnalysisEngineDescriptiongetAaeCmDesc()org.apache.uima.analysis_engine.AnalysisEngineDescriptiongetAaeDesc()The single primitive analysis engine description or the aggregate analysis engine description of this pipeline.List<Description>getAeDelegates()Returns all analysis engines that have been added to the pipeline.DescriptiongetAeFlowController()List<Description>getCcDelegates()org.apache.uima.resource.ResourceCreationSpecifiergetCcDesc()Returns the CAS consumer of this pipeline or null, if none is set.DescriptiongetCcFlowController()StringgetClassPath()Stream<File>getClasspathElements()List<Description>getCmDelegates()org.apache.uima.analysis_engine.AnalysisEngineDescriptiongetCompleteAggregateDescription()Returns an aggregate including CM, AE and CC.DescriptiongetCrDescription()com.google.common.collect.Multiset<String>getExistingDescriptorNames()Returns the name of all component descriptions (not descriptors) added to this pipeline in a multiset.FilegetLoadDirectory()Stream<de.julielab.utilities.aether.MavenArtifact>getMavenComponentArtifacts()Stream<Description>getMultipliers()Stream<Description>getNonMultiplierAes()de.julielab.utilities.aether.MavenArtifactgetParentPom()JCoReUIMAPipelineload(boolean forEditing)Loads the pipeline from the file system.voidremoveComponent(Description description)Removes the given description and the maven artifacts associated with the component.voidsetAeFlowController(Description flowControllerDescription)voidsetCcFlowController(Description flowControllerDescription)voidsetCrDescription(Description crDescription)voidsetLoadDirectory(File loadDirectory)voidsetParentPom(de.julielab.utilities.aether.MavenArtifact parentPom)voidstore(File directory)voidstore(File directory, boolean populateLibDir)voidstoreArtifacts(File directory)Stores the Maven artifacts in the lib/ directory directly beneath the given pipeline directory.
-
-
-
Field Detail
-
DIR_DESC
public static final String DIR_DESC
- See Also:
- Constant Field Values
-
DIR_DESC_ALL
public static final String DIR_DESC_ALL
- See Also:
- Constant Field Values
-
DIR_LIB
public static final String DIR_LIB
- See Also:
- Constant Field Values
-
DIR_CONF
public static final String DIR_CONF
- See Also:
- Constant Field Values
-
CPE_AAE_DESC_NAME
public static final String CPE_AAE_DESC_NAME
- See Also:
- Constant Field Values
-
AGGREGATE_ANALYSIS_ENGINE_WITH_INTEGRATED_DELEGATE_DESCRIPTORS_XML
public static final String AGGREGATE_ANALYSIS_ENGINE_WITH_INTEGRATED_DELEGATE_DESCRIPTORS_XML
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JCoReUIMAPipeline
public JCoReUIMAPipeline(File baseDirectory)
Set the pipeline base directory to later load the pipeline from. It is expected that this directory has two subdirectories named "desc" and "lib", respectively. The first must contain the configured descriptors of collection reader, analysis engines (including CAS multipliers) and an optional CAS consumer. The latter must contain all the artifacts and transitive dependencies required to run the pipeline.
To actually load the pipeline, call
load(boolean)- Parameters:
baseDirectory- The base directory where to find the subdirectories "desc" and "lib".- See Also:
load(boolean)
-
JCoReUIMAPipeline
public JCoReUIMAPipeline()
Empty constructur for creating a pipeline from scratch.
-
-
Method Detail
-
getParentPom
public de.julielab.utilities.aether.MavenArtifact getParentPom()
-
setParentPom
public void setParentPom(de.julielab.utilities.aether.MavenArtifact parentPom)
-
getMultipliers
public Stream<Description> getMultipliers()
- Returns:
- Returns the multipliers from within the aeDelegates.
-
getNonMultiplierAes
public Stream<Description> getNonMultiplierAes()
-
getCrDescription
public Description getCrDescription()
-
setCrDescription
public void setCrDescription(Description crDescription)
-
getAaeDesc
public org.apache.uima.analysis_engine.AnalysisEngineDescription getAaeDesc()
The single primitive analysis engine description or the aggregate analysis engine description of this pipeline.- Returns:
- The analysis engine description.
-
getCcDelegates
public List<Description> getCcDelegates()
-
addCcDesc
public void addCcDesc(Description ccDesc)
-
store
public void store(File directory) throws PipelineIOException
- Throws:
PipelineIOException
-
store
public void store(File directory, boolean populateLibDir) throws PipelineIOException
- Throws:
PipelineIOException
-
storeArtifacts
public void storeArtifacts(File directory) throws de.julielab.utilities.aether.MavenException
Stores the Maven artifacts in the lib/ directory directly beneath the given pipeline directory.- Parameters:
directory-- Throws:
de.julielab.utilities.aether.MavenException
-
getLoadDirectory
public File getLoadDirectory()
-
setLoadDirectory
public void setLoadDirectory(File loadDirectory)
-
load
public JCoReUIMAPipeline load(boolean forEditing) throws PipelineIOException
Loads the pipeline from the file system. The directory parameter must point to the root directory of the pipeline directory structure. That is, it is expected that the given directory has two subdirectory, "desc" and "lib" with the descriptor files and the library files, respectively.- Throws:
PipelineIOException- If the pipeline cannot be loaded.
-
getAeDelegates
public List<Description> getAeDelegates()
Returns all analysis engines that have been added to the pipeline. These also include CAS multipliers which are a variant of analysis engines with the "outputs new CASes" operational parameter set to true. When storing the pipeline, all these engines are bundled into a single aggregate analysis engine.- Returns:
- The analysis engines of this pipeline, including multipliers.
-
addDelegateAe
public void addDelegateAe(Description aeDesc)
Add an analysis engine to this pipeline. The order is important: The engines are stored in a list that directly determines the order in which the components are called during processing.- Parameters:
aeDesc- The descriptor of an analysis engine.
-
getExistingDescriptorNames
public com.google.common.collect.Multiset<String> getExistingDescriptorNames()
Returns the name of all component descriptions (not descriptors) added to this pipeline in a multiset. Thus, duplicates will also be returned here for validity checks.- Returns:
- A multiset of component description names.
-
addCasMultiplier
public void addCasMultiplier(Description multiplier)
Add a CAS multiplier to this pipeline. The order is important: The multipliers are stored in a list that directly determines the order in which the components are called during processing. The CAS multiplier(s) will be arranged directly after the Collection Reader and before the analysis engines.- Parameters:
multiplier- The descriptor of a CAS multiplier.
-
getClasspathElements
public Stream<File> getClasspathElements() throws PipelineIOException
- Throws:
PipelineIOException
-
getMavenComponentArtifacts
public Stream<de.julielab.utilities.aether.MavenArtifact> getMavenComponentArtifacts()
-
removeComponent
public void removeComponent(Description description)
Removes the given description and the maven artifacts associated with the component.- Parameters:
description- The description of the component to be removed.
-
getClassPath
public String getClassPath() throws PipelineIOException
- Throws:
PipelineIOException
-
getAaeCmDesc
public org.apache.uima.analysis_engine.AnalysisEngineDescription getAaeCmDesc()
-
getCcDesc
public org.apache.uima.resource.ResourceCreationSpecifier getCcDesc()
Returns the CAS consumer of this pipeline or null, if none is set. The return value is either anAnalysisEngineDescriptionor aCasConsumerDescription. If an AnalysisEngineDescription is returned, it might be an aggregate.- Returns:
- The consumer description or null, if none is set.
-
getCmDelegates
public List<Description> getCmDelegates()
-
getCompleteAggregateDescription
public org.apache.uima.analysis_engine.AnalysisEngineDescription getCompleteAggregateDescription() throws org.apache.uima.resource.ResourceInitializationExceptionReturns an aggregate including CM, AE and CC.- Returns:
- An aggregate including CM, AE and CC.
- Throws:
org.apache.uima.resource.ResourceInitializationException
-
clear
public void clear()
-
getAeFlowController
public Description getAeFlowController()
-
setAeFlowController
public void setAeFlowController(Description flowControllerDescription)
-
getCcFlowController
public Description getCcFlowController()
-
setCcFlowController
public void setCcFlowController(Description flowControllerDescription)
-
-