edu.isi.karma.rep.Node.getId()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中edu.isi.karma.rep.Node.getId()方法的一些代码示例,展示了Node.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getId()方法的具体详情如下:
包路径:edu.isi.karma.rep.Node
类名称:Node
方法名:getId

Node.getId介绍

暂无

代码示例

代码示例来源:origin: usc-isi-i2/Web-Karma

public String toString() {
  StringBuffer b = new StringBuffer();
  b.append("N(");
  b.append(getId() + ",");
  b.append(hNodeId + ",");
  if (nestedTable != null) {
    b.append("*" + nestedTable.getId() + "/"
        + nestedTable.getHTableId() + ")");
  } else {
    b.append(value.asString() + ")");
  }
  return b.toString();
}

代码示例来源:origin: usc-isi-i2/Web-Karma

private boolean evaluatePythonExpression(Row r, PyCode code, PythonInterpreter interpreter) {
  evalColumns.clear();
  try {
    ArrayList<Node> nodes = new ArrayList<>(r.getNodes());
    Node node = nodes.get(0);
    interpreter.getLocals().__setitem__("nodeid", new PyString(node.getId()));
    PyObject output = interpreter.eval(code);
    return PythonTransformationHelper.getPyObjectValueAsBoolean(output);
  }catch(Exception e) {
    return onError;
  }
}

代码示例来源:origin: usc-isi-i2/Web-Karma

@Override
public UpdateContainer undoIt(Workspace workspace) {
  RepFactory factory = workspace.getFactory();
  for (Map.Entry<String, String> stringStringEntry : oldRowValueMap.entrySet()) {
    Row row = factory.getRow(stringStringEntry.getKey());
    
    Node existingNode = row.getNode(hNodeID);
    if (existingNode.hasNestedTable()) {
      logger.error("Existing node has a nested table. Cannot overwrite such node with new value. NodeID: " + existingNode.getId());
      continue;
    }
    String oldCellValue = stringStringEntry.getValue();
    row.setValue(hNodeID, oldCellValue, factory);
  }
  return WorksheetUpdateFactory.createRegenerateWorksheetUpdates(worksheetId, SuperSelectionManager.DEFAULT_SELECTION, workspace.getContextId());
}

代码示例来源:origin: usc-isi-i2/Web-Karma

@Override
public UpdateContainer doIt(Workspace workspace) throws CommandException {
  RepFactory factory = workspace.getFactory();
  for (Map.Entry<String, String> stringStringEntry : newRowValueMap.entrySet()) {
    Row row = factory.getRow(stringStringEntry.getKey());
    Node existingNode = row.getNode(hNodeID);
    if (existingNode.hasNestedTable()) {
      logger.error("Existing node has a nested table. Cannot overwrite such node with new value. NodeID: " + existingNode.getId());
      continue;
    }
    String existingCellValue = existingNode.getValue().asString();
    oldRowValueMap.put(stringStringEntry.getKey(), existingCellValue);
    String newCellValue = stringStringEntry.getValue();
    row.setValue(hNodeID, newCellValue, factory);
  }
  return WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(this.worksheetId, SuperSelectionManager.DEFAULT_SELECTION, workspace.getContextId());
}

代码示例来源:origin: usc-isi-i2/Web-Karma

allNodeIds.add(node.getId());
  if (!predictedLabel.equalsIgnoreCase(predictedType)) {
    outlierCounter++;
    outlierNodeIds.add(node.getId());

代码示例来源:origin: usc-isi-i2/Web-Karma

private static String getHashValueRecurse(Row row, List<String> HNodeIds) {
  List<String> hashString = new ArrayList<>();
  for (String HNodeid : HNodeIds) {
    Node n = row.getNode(HNodeid);
    if (n.hasNestedTable()) {
      Table nestedTable = n.getNestedTable();
      for (Row nestedRow : nestedTable.getRows(0, nestedTable.getNumRows(), SuperSelectionManager.DEFAULT_SELECTION)) {
        List<String> ids = new ArrayList<>();
        for (Node node : nestedRow.getNodes()) {
          ids.add(node.getHNodeId());
        }
        hashString.add(getHashValue(nestedRow, ids));                
      }
    }
    else {
      Map<String, String> tmp = hashTable.get(row.getId());
      
      hashString.add(tmp.get(n.getId()));
    }
  }
  Collections.sort(hashString);
  String hash = "";
  for (String t : hashString) {
    hash += t; 
  }
  return hash;
}

代码示例来源:origin: usc-isi-i2/Web-Karma

private static void computeHashValue(Row row, List<String> HNodeIds) {
  for (String HNodeid : HNodeIds) {
    Node n = row.getNode(HNodeid);
    if (n.hasNestedTable()) {
      Table nestedTable = n.getNestedTable();
      for (Row nestedRow : nestedTable.getRows(0, nestedTable.getNumRows(), SuperSelectionManager.DEFAULT_SELECTION)) {
        List<String> ids = new ArrayList<>();
        for (Node node : nestedRow.getNodes()) {
          ids.add(node.getHNodeId());
        }
        computeHashValue(nestedRow, ids);
      }
    }
    else {
      Map<String, String> tmp = hashTable.get(row.getId());
      if (tmp == null) 
        tmp = new ConcurrentHashMap<>();
      String value = n.getValue().asString();
      value = DigestUtils.shaHex(value);
      tmp.put(n.getId(), value);
      hashTable.put(row.getId(), tmp);
    }
  }
  
}

代码示例来源:origin: usc-isi-i2/Web-Karma

value = DigestUtils.shaHex(value);
uri.append(value);
uri.append("_" + n.getId());

代码示例来源:origin: usc-isi-i2/Web-Karma

for (Node node : nodes) {
  JSONObject jsonRecord = new JSONObject();
  jsonRecord.put(JsonKeys.id.name(), node.getId());
  String originalVal = node.getValue().asString();
  originalVal = originalVal == null ? "" : originalVal;
  Node node = nodes.get(r);
  JSONObject jsonRecord = new JSONObject();
  jsonRecord.put(JsonKeys.id.name(), node.getId());
  String originalVal = node.getValue().asString();
  originalVal = originalVal == null ? "" : originalVal;

代码示例来源:origin: usc-isi-i2/Web-Karma

nodeObj.put(JsonKeys.columnClass.name(), 
    WorksheetHeadersUpdate.getColumnClass(vNode.getId()));
nodeObj.put(JsonKeys.nodeId.name(), rowNode.getId());

代码示例来源:origin: usc-isi-i2/Web-Karma

for (Row row : rows) {
  Node n = row.getNode(key.getId());
  keyMapping.put(HashValueManager.getHashValue(oldws, n.getId(), factory), n.getValue().asString());

代码示例来源:origin: usc-isi-i2/Web-Karma

for (Row row : rows) {
  Node n = row.getNode(key.getId());
  keyMapping.put(HashValueManager.getHashValue(oldws, n.getId(), factory), n.getValue().asString());

代码示例来源:origin: usc-isi-i2/Web-Karma

Row row = node.getBelongsToRow();
locals.__setitem__("nodeid", new PyString(node.getId()));

代码示例来源:origin: usc-isi-i2/Web-Karma

Set<String> nodeIds = new HashSet<>();
for (edu.isi.karma.rep.Node node : nodes) {
  nodeIds.add(node.getId());

代码示例来源:origin: usc-isi-i2/Web-Karma

for (Table parentTable : parentTables) {
  for (Row parentRow : parentTable.getRows(0, parentTable.getNumRows(), selection)) {
    interpreter.getLocals().__setitem__("nodeid", new PyString(parentRow.getNode(hTable.getParentHNode().getId()).getId()));
    Table nestedTable = parentRow.getNode(hTable.getParentHNode().getId()).getNestedTable();
    String instanceName = "aggregation" + System.currentTimeMillis();
    if (nestedTable != null) {
      for (Row nestedRow : nestedTable.getRows(0, nestedTable.getNumRows(), selection)) {
        interpreter.getLocals().__setitem__("nodeid", new PyString(nestedRow.getNode(hNodeId).getId()));
        interpreter.exec(String.format("%s.accumulate(%s.transform())", instanceName, instanceName));
    interpreter.getLocals().__setitem__("nodeid", new PyString(parentRow.getNode(hTable.getParentHNode().getId()).getId()));
    PyObject returnVal = interpreter.eval(String.format("%s.getResult()", instanceName));
    parentRow.getNode(newHNodeId).setValue(PythonTransformationHelper.getPyObjectValueAsString(returnVal), Node.NodeStatus.original, factory);

相关文章