@Test public void notResolveMatchQueryWithIris() { String cypher = "MATCH (n{iri:'http: assertThat( util.resolveNodeIris(cypher), IsEqual .equalTo("MATCH (n{iri:'http: }
public String resolveNodeIris(String cypher) { String resolvedCypher = cypher; Pattern p = Pattern.compile("\\{\\s*iri\\s*:\\s*['|\"]([\\w:/\\?=]+)['|\"]\\s*\\}"); Matcher m = p.matcher(cypher); while (m.find()) { String curie = m.group(1); String iri = curieUtil.getIri(curie).orElse(curie); resolvedCypher = resolvedCypher.replace(curie, iri); } return resolvedCypher; }
CypherUtil { public String resolveNodeIris(String cypher) { String resolvedCypher = cypher; Pattern p = Pattern.compile("\\{\\s*iri\\s*:\\s*['|\"]([\\w:/\\?=]+)['|\"]\\s*\\}"); Matcher m = p.matcher(cypher); while (m.find()) { String curie = m.group(1); String iri = curieUtil.getIri(curie).orElse(curie); resolvedCypher = resolvedCypher.replace(curie, iri); } return resolvedCypher; } }
CypherUtil { public String resolveNodeIris(String cypher) { String resolvedCypher = cypher; Pattern p = Pattern.compile("\\{\\s*iri\\s*:\\s*['|\"]([\\w:/\\?=]+)['|\"]\\s*\\}"); Matcher m = p.matcher(cypher); while (m.find()) { String curie = m.group(1); String iri = curieUtil.getIri(curie).orElse(curie); resolvedCypher = resolvedCypher.replace(curie, iri); } return resolvedCypher; } @Inject  CypherUtil(GraphDatabaseService graphDb, CurieUtil curieUtil); }
CypherUtil { public String resolveNodeIris(String cypher) { String resolvedCypher = cypher; Pattern p = Pattern.compile("\\{\\s*iri\\s*:\\s*['|\"]([\\w:/\\?=]+)['|\"]\\s*\\}"); Matcher m = p.matcher(cypher); while (m.find()) { String curie = m.group(1); String iri = curieUtil.getIri(curie).orElse(curie); resolvedCypher = resolvedCypher.replace(curie, iri); } return resolvedCypher; } @Inject  CypherUtil(GraphDatabaseService graphDb, CurieUtil curieUtil); Result execute(String query, Multimap<String, Object> params, long timeout, TimeUnit unit); Result execute(String query, long timeout, TimeUnit unit); Result execute(String query, Multimap<String, Object> params); Result execute(String query); Set<RelationshipType> getEntailedRelationshipTypes(Collection<String> parents); @Deprecated String resolveStartQuery(String cypher); String resolveNodeIris(String cypher); String resolveRelationships(String cypher); Map<String, String> getCurieMap(); }
CypherUtil { public String resolveNodeIris(String cypher) { String resolvedCypher = cypher; Pattern p = Pattern.compile("\\{\\s*iri\\s*:\\s*['|\"]([\\w:/\\?=]+)['|\"]\\s*\\}"); Matcher m = p.matcher(cypher); while (m.find()) { String curie = m.group(1); String iri = curieUtil.getIri(curie).orElse(curie); resolvedCypher = resolvedCypher.replace(curie, iri); } return resolvedCypher; } @Inject  CypherUtil(GraphDatabaseService graphDb, CurieUtil curieUtil); Result execute(String query, Multimap<String, Object> params, long timeout, TimeUnit unit); Result execute(String query, long timeout, TimeUnit unit); Result execute(String query, Multimap<String, Object> params); Result execute(String query); Set<RelationshipType> getEntailedRelationshipTypes(Collection<String> parents); @Deprecated String resolveStartQuery(String cypher); String resolveNodeIris(String cypher); String resolveRelationships(String cypher); Map<String, String> getCurieMap();  }