Package uk.org.ogsadai.activity.io

Examples of uk.org.ogsadai.activity.io.BlockReader


            throws InvalidActivityInputsException
    {
        List<ActivityInput> inputs = new ArrayList<ActivityInput>();
       
        // set up block reader for data input
        BlockReader data = getInput(INPUT_DATA);
        if (data == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_DATA);
        }  
        ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
        dataInput.setBlockReader(data);
        inputs.add(dataInput);
       
        // set up block reader for class index input
        BlockReader classIndex = getInput(INPUT_CLASS_INDEX);
        if (classIndex == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_CLASS_INDEX);
        }  
        ActivityInput classIndexInput = new TypedActivityInput(INPUT_CLASS_INDEX, Object.class);
        classIndexInput.setBlockReader(classIndex);
        inputs.add(classIndexInput);
       
        // set up block reader for options  input

        BlockReader options = getInput(INPUT_OPTIONS);
        TypedOptionalActivityInput optionsInput = new TypedOptionalActivityInput(INPUT_OPTIONS, Object.class);
        optionsInput.setBlockReader(options);
        inputs.add(optionsInput);
       
        // set up block reader for indexes of nominal values columns
        BlockReader indexes = getInput(INPUT_COLUMN_INDICES);
        if (indexes == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_COLUMN_INDICES);
        }  
        ActivityInput nomValIndexesInput = new TypedListActivityInput(INPUT_COLUMN_INDICES, Object.class);
View Full Code Here


            ActivityUserException, ActivityProcessingException,
            ActivityTerminatedException
    {

        String sparqlQuery = "SELECT * WHERE {?s ?p ?o}";
        BlockReader input = new LiteralBlockReader(new SimpleLiteral(
                sparqlQuery));
        MockOutputPipe output = new MockOutputPipe(new Object[] {});

        mActivity.addInput("expression", input);
        mActivity.addOutput("rdfdata", output);
View Full Code Here

        String sparqlQuery = "PREFIX dmi: <http://www.admire-project.eu/ontologies/CRISP-DMIOntology.owl#> "
                + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "
                + "SELECT ?x ?y "
                + "WHERE {     ?x dmi:hasStructuralType ?y .  "
                + "}";
        BlockReader input = new LiteralBlockReader(new SimpleLiteral(
                sparqlQuery));
        MockOutputPipe output = new MockOutputPipe(new Object[] {});

        mActivity.addInput("expression", input);
        mActivity.addOutput("rdfdata", output);
View Full Code Here

    // ListLiteral listLiteral = new ListLiteral();

    String ouputPE = NAMESPACE + "SQLQueryStatement";
    String inputPE = NAMESPACE + "SQLStatement";

    BlockReader input1 = new LiteralBlockReader(new SimpleLiteral(ouputPE));
    BlockReader input2 = new LiteralBlockReader(new SimpleLiteral(inputPE));
    MockOutputPipe output = new MockOutputPipe(new Object[] {});

    mActivity.addInput("ontologyElement1", input1);
    mActivity.addInput("ontologyElement2", input2);
    mActivity.addOutput("inferenceResults", output);
View Full Code Here

      ActivityTerminatedException {

    String ouputPE = NAMESPACE + "SystemElement";
    String inputPE = NAMESPACE + "DbElement";

    BlockReader input1 = new LiteralBlockReader(new SimpleLiteral(ouputPE));
    BlockReader input2 = new LiteralBlockReader(new SimpleLiteral(inputPE));
    MockOutputPipe output = new MockOutputPipe(new Object[] {});

    mActivity.addInput("ontologyElement1", input1);
    mActivity.addInput("ontologyElement2", input2);
    mActivity.addOutput("inferenceResults", output);
View Full Code Here

      ActivityTerminatedException {

    String ouputPE = NAMESPACE + "SQLStatement";
    String inputPE = NAMESPACE + "XQueryStatement";

    BlockReader input1 = new LiteralBlockReader(new SimpleLiteral(ouputPE));
    BlockReader input2 = new LiteralBlockReader(new SimpleLiteral(inputPE));
    MockOutputPipe output = new MockOutputPipe(new Object[] {});

    mActivity.addInput("ontologyElement1", input1);
    mActivity.addInput("ontologyElement2", input2);
    mActivity.addOutput("inferenceResults", output);
View Full Code Here

      ActivityTerminatedException {

    String ouputPE = NAMESPACE + "FahrenheitDegrees";
    String inputPE = NAMESPACE + "CelsiusDegrees";

    BlockReader input1 = new LiteralBlockReader(new SimpleLiteral(ouputPE));
    BlockReader input2 = new LiteralBlockReader(new SimpleLiteral(inputPE));
    MockOutputPipe output = new MockOutputPipe(new Object[] {});

    mActivity.addInput("ontologyElement1", input1);
    mActivity.addInput("ontologyElement2", input2);
    mActivity.addOutput("inferenceResults", output);
View Full Code Here

        try
        {
           validateInput(INPUT);
           validateInput(PASSTHROUGH);
            
           BlockReader input1 = getInput(PASSTHROUGH);
             while (input1.read() != ControlBlock.NO_MORE_DATA)
                 {
                     // do nothing
                 }
            
          
            BlockReader inputReader = getInput(INPUT);
            mBlockNumber=0;
            while ((block = inputReader.read()) !=
                ControlBlock.NO_MORE_DATA)
            {
                if (mBlockNumber == errorAt)
                {
                    throwError();
View Full Code Here

    protected int getErrorAt() throws ActivityUserException,
        ActivityProcessingException, ActivityTerminatedException
    {
        if (mErrorAt == null) {
            mErrorAt = new Integer(NEVER);
            BlockReader inputErrorReader = getInput(ERROR_AT);
            if (inputErrorReader != null)
            {
                Object block = null;
                try
                {
                    if ((block = inputErrorReader.read())
                            != ControlBlock.NO_MORE_DATA)
                    {
                        mErrorAt = ((Integer)block);
                    }
                }
View Full Code Here

  protected ActivityInput[] getIterationInputs()
      throws InvalidActivityInputsException {
        List<ActivityInput> inputs = new ArrayList<ActivityInput>();
       
        // set up block reader for data input
        BlockReader data = getInput(INPUT_DATA);
        if (data == null)
        {
            throw new InvalidActivityInputsException(1, INPUT_DATA);
        }  
        ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
        dataInput.setBlockReader(data);
        inputs.add(dataInput);

        // set up block reader for options input
        BlockReader options = getInput(INPUT_OPTIONS);

        TypedOptionalActivityInput optionsInput =
            new TypedOptionalActivityInput(INPUT_OPTIONS, Object.class, DEFAULT_OPTIONS);
        optionsInput.setBlockReader(options);
        inputs.add(optionsInput);
       

       
       
       
        BlockReader outputFreq = getInput(INPUT_OUTPUT_FREQUENCY);

        TypedOptionalActivityInput outputFreqInput =
            new TypedOptionalActivityInput(INPUT_OUTPUT_FREQUENCY, Object.class, 100000);
        outputFreqInput.setBlockReader(outputFreq);
        inputs.add(outputFreqInput);
       
        BlockReader algorithm = getInput(INPUT_ALGORITHM);
        TypedOptionalActivityInput algorithmInput =
            new TypedOptionalActivityInput(INPUT_ALGORITHM, Object.class, DEFAULT_ALGORITHM);
        algorithmInput.setBlockReader(algorithm);
        inputs.add(algorithmInput);
        // set up block reader for indexes of nominal values columns
        BlockReader indexes = getInput(INPUT_COLUMN_INDICES);
        TypedOptionalListActivityInput nomValIndexesInput = new TypedOptionalListActivityInput(INPUT_COLUMN_INDICES, Number.class);
        if(nomValIndexesInput != null && indexes != null)
          nomValIndexesInput.setBlockReader(indexes);
        inputs.add(nomValIndexesInput);
       
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.activity.io.BlockReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.