Exemplo n.º 1
0
  public static UpdateObject.Response updateObject(UpdateObject.Request req) {

    UpdateObject.Response res = new UpdateObject.Response();
    res.success = false;

    if (req.apiKey != null && req.apiKey.length() > 0) {

      REInterface con = getREConnection(req.apiKey);
      OWLOntology ont = OWLIO.loadOntologyFromString(req.object);
      if (ont != null) {
        res.success = con.updateObject(req.uid, ont, req.description);
      } else {
        res.success = false;
      }
    }

    return res;
  }
Exemplo n.º 2
0
  public static SetObject.Response setObject(SetObject.Request req) {

    SetObject.Response res = new SetObject.Response();
    res.success = false;

    if (req.apiKey != null && req.apiKey.length() > 0) {
      REInterface con = getREConnection(req.apiKey);
      OWLOntology ont = OWLIO.loadOntologyFromString(req.object);
      ArrayList<String> filenames = new ArrayList<String>();
      ArrayList<byte[]> dataArray = new ArrayList<byte[]>();
      for (ros.pkg.re_msgs.msg.File file : req.files) {
        filenames.add(file.name);
        dataArray.add(file.data);
      }
      res.success = con.submitObject(ont, req.cls, req.id, req.description, dataArray, filenames);
    }

    return res;
  }