Package eu.admire.registry.pe

Examples of eu.admire.registry.pe.ProcessingElementOutputDescriptor


    inputs.add(peInDescr4);
    inputs.add(peInDescr5);
    inputs.add(peInDescr6);
    inputs.add(peInDescr7);

    ProcessingElementOutputDescriptor peOutDescr1 = new ProcessingElementOutputDescriptor(
        "result");

    SType sTypeIn2 = new PrimitiveSType("String");
    peOutDescr1.setSType(sTypeIn2);
    ProcessingElementOutputDescriptor peOutDescr2 = new ProcessingElementOutputDescriptor(
        "result2");
    ProcessingElementOutputDescriptor peOutDescr3 = new ProcessingElementOutputDescriptor(
        "result3");
    ProcessingElementOutputDescriptor peOutDescr4 = new ProcessingElementOutputDescriptor(
        "result4");
    ProcessingElementOutputDescriptor peOutDescr5 = new ProcessingElementOutputDescriptor(
        "result5");
    ProcessingElementOutputDescriptor peOutDescr6 = new ProcessingElementOutputDescriptor(
        "result6");
    ProcessingElementOutputDescriptor peOutDescr7 = new ProcessingElementOutputDescriptor(
        "result7");

    DType dtype4 = new SimpleDType("ColumnIndex4",
        "http://www.admire-project.eu/ontologies/DataMiningOntology#",
        null);
    peOutDescr3.setDType(dtype4);
   
    // inserting output array SType of primitive SType
    peOutDescr6.setSType(sTypeIn5);

    // inserting output list SType of primitive SType
    peOutDescr7.setSType(sTypeIn6);

    TupleSType tuple3 = new TupleSType();
    // tuple3.addElement("s2", new PrimitiveSType("String"));
    // tuple3.addElement("i2", new PrimitiveSType("Integer"));
    tuple3.setRest(true);
View Full Code Here


    peInDescr2.setSType(sTypeIn3);

    inputs.add(peInDescr1);
    inputs.add(peInDescr2);

    ProcessingElementOutputDescriptor peOutDescr1 = new ProcessingElementOutputDescriptor(
        "data");
    SType sTypeOut1 = new AnySType();
    // SType sTypeOut2 = new PrimitiveSType("DummyOutputST2");
    DType dtypeOut1 = new SimpleDType("DummyOutputDType1");
    // DType dtypeOut2 = new SimpleDType("DummyOutputDType2");
    peOutDescr1.setSType(sTypeOut1);
    peOutDescr1.setDType(dtypeOut1);

    outputs.add(peOutDescr1);

    descriptor = new SimpleProcessingElementDescriptor(peName, inputs,
        outputs);
View Full Code Here

    private boolean compareOutputs(
            Collection<ProcessingElementOutputDescriptor> other)
    {
        for (ProcessingElementOutputDescriptor output : other)
        {
            ProcessingElementOutputDescriptor myInput =
                mDescriptor.getOutput(output.getName());
            if (myInput == null || output.isArray() != myInput.isArray())
            {
                return false;
            }
            if (myInput.getSType() != null &&
                    !myInput.getSType().equals(output.getSType()))
            {
                return false;
            }
        }
        return true;
View Full Code Here

        if (newInput.getSType().equals(stype)) {
          i++;
        }
      }
      if (object instanceof ProcessingElementOutputDescriptor) {
        ProcessingElementOutputDescriptor output = (ProcessingElementOutputDescriptor) object;
        if (output.getSType().equals(stype)) {
          i++;
        }
      }
    }
    return i;
View Full Code Here

                }
                output = output.substring(0, index);
            }
            outputSet.add(output);
            mEntryDescriptor.put(name, outputSet);
            mOutputs.add(new ProcessingElementOutputDescriptor(output));
        }

        try {
      mURI = new URI(location[0]);
    } catch (URISyntaxException e) {
View Full Code Here

        String dtype = resultset.getString(3);
        if (dtype != null) {
          dtype = dtype.substring(dtype.indexOf('#') + 1, dtype
              .length());
        }
        ProcessingElementOutputDescriptor outputDesc = new ProcessingElementOutputDescriptor(
            val.substring(val.indexOf('#') + 1, val.length()));
        outputDesc.setSType(new PrimitiveSType(stype));
        outputDesc.setDType(new SimpleDType(dtype));
        output = new SimpleRDFParameter(outputDesc);
        String location = resultset.getString(4);
        if (location != null) {
          functionLocation = new URI(location);
        }
View Full Code Here

    }
    // ?pe ?name ?input ?output ?dsInput ?STypeIn ?typeIn ?DTypeIn
    // ?TupleElementIn ?TupleTypeIn ?ListTypeIn ?STypeOut ?typeOut ?DTypeOut
    // ?TupleElementOut ?TupleTypeOut ?ListTypeOut
    ProcessingElementInputDescriptor peInputDescriptor = null;
    ProcessingElementOutputDescriptor peOutputDescriptor = null;

    // Input name and is data source
    if (tokens[2] != null) {
      if (tokens[4] != null) {
        if (tokens[4].equals("true")) {
          peInputDescriptor = new ProcessingElementInputDescriptor(
              tokens[2], true);
        } else {
          peInputDescriptor = new ProcessingElementInputDescriptor(
              tokens[2], false);
        }
      } else {
        peInputDescriptor = new ProcessingElementInputDescriptor(
            tokens[2], false);
      }
    }
    // Output name
    if (tokens[3] != null) {
      peOutputDescriptor = new ProcessingElementOutputDescriptor(
          tokens[3]);
    }

    // input STypeIn
    if (tokens[5] != null) {
      // checking for TupleSType, ListSType, etc.
      getInputSType(tokens, 5, peInputDescriptor);
    }
    // input DTypeIn
    if (tokens[6] != null) {
      peInputDescriptor.setDType(new SimpleDType(tokens[6]));
    }

    // output STypeOut
    if (tokens[17] != null) {
      // checking for TupleSType, ListSType, etc.
      getOutputSType(tokens, 17, peOutputDescriptor);
    }
    // output DTypeOut
    if (tokens[19] != null) {
      peOutputDescriptor.setDType(new SimpleDType(tokens[19]));
    }

    if (peInputDescriptor != null) {
      input.put(peInputDescriptor.getName(), peInputDescriptor);
    }
    if (peOutputDescriptor != null) {
      output.put(peOutputDescriptor.getName(), peOutputDescriptor);
    }

    List<String> keyList = new ArrayList<String>();
    keyList.add(tokens[0]);
    if (peName.contains("?name")) {
      keyList.add(tokens[1]);
      name = tokens[1];
    } else {
      keyList.add(name);
    }

    peInputs.put(keyList, input.values());
    peOutputs.put(keyList, output.values());

    Map<String, String> metadataMap = null;
    metadataMap = new HashMap<String, String>();
    if (tokens[29] != null) {
      metadataMap.put("author", tokens[29]);
    }
    if (tokens[30] != null) {
      metadataMap.put("organisation", tokens[30]);
    }
    if (tokens[31] != null) {
      metadataMap.put("description", tokens[31]);
    }
    if (tokens[32] != null) {
      metadataMap.put("version", tokens[32]);
    }

    peMetadata.put(keyList, metadataMap);

    // ?pe ?name ?input ?output ?dsInput ?STypeIn ?typeIn ?DTypeIn
    // ?TupleElementIn ?TupleTypeIn ?ListTypeIn ?STypeOut ?typeOut ?DTypeOut
    // ?TupleElementOut ?TupleTypeOut ?ListTypeOut
    while (queryResultsIt.hasNext()) {
      result = queryResultsIt.next();
      try {
//        System.out.println(result);
        i = 0;
        for (String s : result) {
          if (s != null) {
            if (i == 19 | i == 6) {
              tokens[i++] = s;
            } else {
              tokens[i++] = s.substring(s.indexOf('#') + 1, s
                  .length());
            }
          } else {
            tokens[i++] = null;
          }
        }
        keyList = new ArrayList<String>();
        keyList.add(tokens[0]);
        if (peName.contains("?name")) {
          keyList.add(tokens[1]);
          name = tokens[1];
        } else {
          keyList.add(name);
        }

        if (peInputs.keySet().contains(keyList)) {
          if (tokens[2] != null) {
            // input.containsKey(tokens[2]) means that we previously
            // found this input, so we have to update it with new
            // information. This may happen when we have several
            // elements in a tuple
            if (!input.containsKey(tokens[2])) {
              ProcessingElementInputDescriptor peInputDescriptor2 = null;
              if (tokens[4] != null) {
                if (tokens[4].equals("true")) {
                  peInputDescriptor2 = new ProcessingElementInputDescriptor(
                      tokens[2], true);
                } else {
                  peInputDescriptor2 = new ProcessingElementInputDescriptor(
                      tokens[2], false);
                }
                // output DTypeIn
                if (tokens[6] != null) {
                  peInputDescriptor2
                      .setDType(new SimpleDType(tokens[6]));
                }
                input.put(peInputDescriptor2.getName(),
                    peInputDescriptor2);
              } else {
                peInputDescriptor2 = new ProcessingElementInputDescriptor(
                    tokens[2], false);
                // output DTypeIn
                if (tokens[6] != null) {
                  peInputDescriptor2
                      .setDType(new SimpleDType(tokens[6]));
                }
                input.put(peInputDescriptor2.getName(),
                    peInputDescriptor2);
              }
              // input STypeIn
              if (tokens[5] != null) {
                getInputSType(tokens, 5, peInputDescriptor2);
              }
            } else {
              // the input already exists. We have to add new
              // information. We do not have to create a new
              // descriptor.
              ProcessingElementInputDescriptor peInputDescriptor2 = null;
              peInputDescriptor2 = input.get(tokens[2]);
              if (peInputDescriptor2.getSType() instanceof TupleSType) {
                TupleSType tuple = (TupleSType) peInputDescriptor2
                    .getSType();
                if (tokens[8] != null & tokens[9] != null) {
                  if (tokens[9].equals("rest")) {
                    tuple.setRest(true);
                  } else {
                    tuple.addElement(tokens[8],
                        new PrimitiveSType(tokens[9]));
                  }
                }
                input.remove(tokens[2]);
                peInputDescriptor2.setSType(tuple);
                input.put(tokens[2], peInputDescriptor2);
              }
              if (peInputDescriptor2.getSType() instanceof ArraySType) {
                ArraySType array = (ArraySType) peInputDescriptor2
                    .getSType();
                if (array.getType() instanceof TupleSType) {
                  TupleSType tuple = (TupleSType) array
                      .getType();
                  if (tokens[12] != null & tokens[13] != null) {
                    if (tokens[13].equals("rest")) {
                      tuple.setRest(true);
                    } else {
                      tuple.addElement(tokens[12],
                          new PrimitiveSType(
                              tokens[13]));
                    }
                  }
                  input.remove(tokens[2]);
                  ArraySType array2 = new ArraySType(tuple,
                      array.getSize());
                  peInputDescriptor2.setSType(array2);
                  input.put(tokens[2], peInputDescriptor2);
                }
              }
              if (peInputDescriptor2.getSType() instanceof ListSType) {
                ListSType list = (ListSType) peInputDescriptor2
                    .getSType();
                if (list.getChildType() instanceof TupleSType) {
                  TupleSType tuple = (TupleSType) list
                      .getChildType();
                  if (tokens[15] != null & tokens[16] != null) {
                    if (tokens[16].equals("rest")) {
                      tuple.setRest(true);
                    } else {
                      tuple.addElement(tokens[15],
                          new PrimitiveSType(
                              tokens[16]));
                    }
                  }
                  input.remove(tokens[2]);
                  ListSType list2 = new ListSType(tuple);
                  peInputDescriptor2.setSType(list2);
                  input.put(tokens[2], peInputDescriptor2);
                }
              }
            }
          }
        } else {
          input = new HashMap<String, ProcessingElementInputDescriptor>();
          if (tokens[2] != null) {
            ProcessingElementInputDescriptor peInputDescriptor2 = null;
            // check for data source input
            if (tokens[4] != null) {
              if (tokens[4].equals("true")) {
                peInputDescriptor2 = new ProcessingElementInputDescriptor(
                    tokens[2], true);
              }
            }
            peInputDescriptor2 = new ProcessingElementInputDescriptor(
                tokens[2]);
            // check for input SType
            if (tokens[5] != null) {
              getInputSType(tokens, 5, peInputDescriptor2);
            }
            // check for input DType
            if (tokens[6] != null) {
              peInputDescriptor2.setDType(new SimpleDType(
                  tokens[6]));
            }
            input.put(peInputDescriptor2.getName(),
                peInputDescriptor2);
          }
          peInputs.put(keyList, input.values());
        }

        // getting PE outputs
        if (peOutputs.keySet().contains(keyList)) {
          if (tokens[3] != null) {
            if (!output.containsKey(tokens[3])) {
              ProcessingElementOutputDescriptor peOutputDescriptor2 = new ProcessingElementOutputDescriptor(
                  tokens[3]);
              // output STypeOut
              if (tokens[17] != null) {
                getOutputSType(tokens, 17, peOutputDescriptor2);
              }
              // output DTypeOut
              if (tokens[19] != null) {
                peOutputDescriptor2.setDType(new SimpleDType(
                    tokens[19]));
              }
              output.put(peOutputDescriptor2.getName(),
                  peOutputDescriptor2);
              peOutputs.put(keyList, output.values());
            } else {
              // the output already exists. We have to add new
              // information. We do not have to create a new
              // descriptor.
              ProcessingElementOutputDescriptor peOutputDescriptor2 = null;
              peOutputDescriptor2 = output.get(tokens[3]);
              if (peOutputDescriptor2.getSType() instanceof TupleSType) {
                TupleSType tuple = (TupleSType) peOutputDescriptor2
                    .getSType();
                if (tokens[20] != null & tokens[21] != null) {
                  if (tokens[21].equals("rest")) {
                    tuple.setRest(true);
                  } else {
                    tuple.addElement(tokens[20],
                        new PrimitiveSType(tokens[21]));
                  }
                }
                output.remove(tokens[3]);
                peOutputDescriptor2.setSType(tuple);
                output.put(tokens[3], peOutputDescriptor2);
              }
              if (peOutputDescriptor2.getSType() instanceof ArraySType) {
                ArraySType array = (ArraySType) peOutputDescriptor2
                    .getSType();
                if (array.getType() instanceof TupleSType) {
                  TupleSType tuple = (TupleSType) array
                      .getType();
                  if (tokens[24] != null & tokens[25] != null) {
                    if (tokens[25].equals("rest")) {
                      tuple.setRest(true);
                    } else {
                      tuple.addElement(tokens[24],
                          new PrimitiveSType(
                              tokens[25]));
                    }
                    tuple.addElement(tokens[24],
                        new PrimitiveSType(tokens[25]));
                  }
                  input.remove(tokens[3]);
                  ArraySType array2 = new ArraySType(tuple,
                      array.getSize());
                  peOutputDescriptor2.setSType(array2);
                  output.put(tokens[3], peOutputDescriptor2);
                }
              }
              if (peOutputDescriptor2.getSType() instanceof ListSType) {
                ListSType list = (ListSType) peOutputDescriptor2
                    .getSType();
                if (list.getChildType() instanceof TupleSType) {
                  TupleSType tuple = (TupleSType) list
                      .getChildType();
                  if (tokens[27] != null & tokens[28] != null) {
                    if (tokens[28].equals("rest")) {
                      tuple.setRest(true);
                    } else {
                      tuple.addElement(tokens[27],
                          new PrimitiveSType(
                              tokens[28]));
                    }
                    // tuple.addElement(tokens[27],
                    // new PrimitiveSType(tokens[28]));
                  }
                  input.remove(tokens[3]);
                  ListSType list2 = new ListSType(tuple);
                  peOutputDescriptor2.setSType(list2);
                  output.put(tokens[3], peOutputDescriptor2);
                }
              }
            }
          }
        } else {
          output = new HashMap<String, ProcessingElementOutputDescriptor>();
          if (tokens[3] != null) {
            ProcessingElementOutputDescriptor peOutputDescriptor2 = new ProcessingElementOutputDescriptor(
                tokens[3]);
            getOutputSType(tokens, 17, peOutputDescriptor2);
            // output DTypeOut
            if (tokens[19] != null) {
              peOutputDescriptor2.setDType(new SimpleDType(
                  tokens[19]));
            }
            output.put(peOutputDescriptor2.getName(),
                peOutputDescriptor2);

          }
          peOutputs.put(keyList, output.values());
        }
View Full Code Here

        mOutput = new TeeConnection();
        Map<Integer, Connection> map = new ConcurrentHashMap<Integer, Connection>();
        map.put(0, mOutput);
        mOutputs.put(OUTPUT_NAME, map);
        mOutput.setSource(this, OUTPUT_NAME, 0);
        mOutputDescriptor = new ProcessingElementOutputDescriptor(OUTPUT_NAME);
    }
View Full Code Here

    peInDescr2.setDType(dtypeIn2);

    inputsPE.add(peInDescr1);
    inputsPE.add(peInDescr2);

    ProcessingElementOutputDescriptor peOutDescr1 = new ProcessingElementOutputDescriptor(
        "dummyOutput");
    ProcessingElementOutputDescriptor peOutDescr2 = new ProcessingElementOutputDescriptor(
        "dummyOutput2");
    SType sTypeOut1 = new PrimitiveSType("DummyOutputST1");
    DType dtypeOut1 = new SimpleDType("DummyOutputDType1");
    peOutDescr1.setSType(sTypeOut1);
    peOutDescr1.setDType(dtypeOut1);
View Full Code Here

TOP

Related Classes of eu.admire.registry.pe.ProcessingElementOutputDescriptor

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.