Class JCoReUIMAPipeline


  • public class JCoReUIMAPipeline
    extends Object
    • 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.
      • 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.
      • addCcDesc

        public void addCcDesc​(Description ccDesc)
      • 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.
      • 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.
      • 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 an AnalysisEngineDescription or a CasConsumerDescription. If an AnalysisEngineDescription is returned, it might be an aggregate.
        Returns:
        The consumer description or null, if none is set.
      • getCompleteAggregateDescription

        public org.apache.uima.analysis_engine.AnalysisEngineDescription getCompleteAggregateDescription()
                                                                                                  throws org.apache.uima.resource.ResourceInitializationException
        Returns 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)