Package edu.neu.ccs.task

Examples of edu.neu.ccs.task.TaskModel


    for (String name : c.parameters())
      if (name.startsWith("dtask.top-input."))
        topInputs.put(name.substring(16), c.getString(name));
   
    for (String model : c.getStrings("dtask.models")) {
      TaskModel tm;
      if (XMLUtil.isURI(model))
        tm = models.load(model, null);
      else
        tm = models.load(c.findResource(model), null);
      System.out.println("loaded " + tm.getURI());
    }
  }
View Full Code Here


   
    speechConfig = new SpeechServerConfig(c);
    filterFactories = Collections.emptyList();
   
    for (String model : c.getStrings("dtask.models")) {
      TaskModel tm;
      if (XMLUtil.isURI(model))
        tm = models.load(model, null);
      else
        tm = models.load(c.findResource(model), null);
      System.out.println("loaded " + tm.getURI());
    }
  }
View Full Code Here

    if (parts.length == 2) {
      prefix = parts[0].trim();
      model = parts[1].trim();
    }
   
    TaskModel m = getEngine().loadAndInit(model, prefix);
    if (m.getLoadCount() > 1)
      out.printf("Reloaded %s=%s\n", m.getPrefix(), m.getURI());
    else
      out.printf("Loaded %s=%s\n", m.getPrefix(), m.getURI());
  }
View Full Code Here

      "created")
  public void _unload(String prefix) {
    if ("".equals(prefix))
      prefix = getModelSet().getDefaultPrefix();
   
    TaskModel model = getModelSet().getModelForPrefix(prefix);
    if (model == null)
      throw new IllegalArgumentException("unknown model: " + prefix);
   
    getModelSet().unload(model.getURI());
    out.printf("Unloaded %s=%s\n", prefix, model.getURI());
  }
View Full Code Here

      "will continue to refer to the previous copy of the model.")
  public void _reload(String prefix) throws IOException, XMLStreamException {
    if ("".equals(prefix))
      prefix = getModelSet().getDefaultPrefix();
   
    TaskModel model = getModelSet().getModelForPrefix(prefix);
    if (model == null)
      throw new IllegalArgumentException("unknown model: " + prefix);
   
    _load(model.getLocation());
  }
View Full Code Here

      "The model bound to PREFIX becomes the default model.\n" +
      "This means that the tasks contained in this model may\n" +
      "be used in commands such as 'run' without specifying a\n" +
      "prefix.")
  public void _model(String prefix) {
    TaskModel model = getModelSet().getModelForPrefix(prefix);
    if (model == null)
      throw new IllegalArgumentException("unknown model: " + prefix);
   
    getModelSet().setDefaultPrefix(prefix);
    out.printf("Using %s=%s\n", prefix, model.getURI());
  }
View Full Code Here

  }

  @Override
  protected TaskModel load(TaskModelXmlReader r, String prefix)
      throws XMLStreamException {
    TaskModel model = super.load(r, prefix);
   
    prefix = model.getPrefix();
    String uri = model.getURI() + "#";
    rdf.setNsPrefix(prefix, uri);
   
    return model;
  }
View Full Code Here

    return model;
  }

  @Override
  public void unload(String modelURI) {
    TaskModel model = getModelForURI(modelURI);
    if (model != null)
      rdf.removeNsPrefix(model.getPrefix());
    super.unload(modelURI);
  }
View Full Code Here

    try {
      List<TaskModel> models = new ArrayList<TaskModel>();
      ResultSet rs = qexec.execSelect();
      while (rs.hasNext()) {
        String uri = rs.next().getResource(var).getURI();
        TaskModel model = getModelForURI(uri);
        if (model != null)
          models.add(model);
      }

      return models;
View Full Code Here

TOP

Related Classes of edu.neu.ccs.task.TaskModel

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.