コード例 #1
0
 String replaceIndex(String query) {
   Matcher matcher = INDEX_PATTERN.matcher(query);
   if (!matcher.find()) return query;
   StringBuffer sb = new StringBuffer();
   do {
     matcher.appendReplacement(sb, "$1:$1_auto_index(");
   } while (matcher.find());
   matcher.appendTail(sb);
   return sb.toString();
 }
コード例 #2
0
ファイル: BulkImport.java プロジェクト: Mamun/pworkshop
  public static void exportFromDB(GraphDatabaseService graphDatabaseService) {

    GlobalGraphOperations graphOperations = GlobalGraphOperations.at(graphDatabaseService);
    Node refNode = graphDatabaseService.getReferenceNode();
    for (Node node : graphOperations.getAllNodes()) {

      StringBuffer stringBuffer = new StringBuffer();
      stringBuffer.append("{");
      for (String key : node.getPropertyKeys()) {
        String value = (String) node.getProperty(key);
        stringBuffer.append(String.format("%s : %s", key, value));
      }
      for (Relationship rel : node.getRelationships(Direction.OUTGOING)) {}

      stringBuffer.append("}");
    }
  }