Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/embl/ebi/escience/scuflworkers/rdfgenerator/RDFGeneratorProcessor.java


1   /**
2    * This file is a component of the Taverna project,
3    * and is licensed under the GNU LGPL.
4    * Copyright Tom Oinn, EMBL-EBI
5    */
6   package org.embl.ebi.escience.scuflworkers.rdfgenerator;
7   
8   import org.embl.ebi.escience.scufl.*;
9   
10  // Utility Imports
11  import java.util.Properties;
12  
13  
14  
15  
16  /**
17   * A processor to generate rdf statements
18   * @author Tom Oinn
19   */
20  public class RDFGeneratorProcessor extends Processor implements java.io.Serializable {
21  
22      /**
23       * Construct a new processor with the given model and
24       * name, delegates to the superclass.
25       */
26      public RDFGeneratorProcessor(ScuflModel model, String name)
27    throws ProcessorCreationException,
28           DuplicateProcessorNameException {
29    super(model, name);
30    // Create the subject, verb, object ports
31    try {
32        Port newSubjectPort = new InputPort(this, "subject");
33        Port newVerbPort = new InputPort(this, "verb");
34        Port newObjectPort = new InputPort(this, "object");
35        newSubjectPort.setSyntacticType("'text/plain'");
36        newVerbPort.setSyntacticType("'text/plain'");
37        newObjectPort.setSyntacticType("'text/plain'");
38        this.addPort(newSubjectPort);
39        this.addPort(newVerbPort);
40        this.addPort(newObjectPort);
41        Port newPort = new OutputPort(this, "statement");
42        newPort.setSyntacticType("'text/xml'");
43        this.addPort(newPort);
44    }
45    catch (Exception ex) {
46        // should never happen
47    }
48      }
49  
50      /**
51       * Override the toString method
52       */
53      public String toString() {
54    return "RDF : "+getName();
55      }
56  
57      /**
58       * Get the properties for this processor for display purposes
59       */
60      public Properties getProperties() {
61    Properties props = new Properties();
62    return props;
63      }
64  
65  }