You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If one is working with a graph where properties and labels contain characters that might normally need to be escaped, including characters such as the special filter qualifiers, then the library does not function as expected.
For example, suppose a node has both the label http://www.w3.org/2002/07/owl#Class and (for the sake of demonstrating this issue), the label OwlClass.
I would expect that
MATCH (v1:`http://example.com/abc#Object`) where v1.uri = "node1e0g5tmg9x4628" call apoc.path.expand(v1, '>|<', '/OwlClass', 0, 2) yield path return distinct nodes(path)
Hi there! This is due to how labels filters are created. In this case, the colon : represents a compound label. So in your second example, the termination node filter is actually looking for the node with 2 labels: /http and `://www.w3.org/2002/07/owl#Class'. This is fixed by adding an escape before the colon:
MATCH (v1:`http://example.com/abc#Object`)
WHERE v1.uri = "node1e0g5tmg9x4628"
CALL apoc.path.expand(v1, '>|<', '/http\://www.w3.org/2002/07/owl#Class', 0, 2)
YIELD path RETURN distinct nodes(path)
Issue by mdw00d
Friday Feb 07, 2020 at 18:37 GMT
Originally opened as neo4j-contrib/neo4j-apoc-procedures#1407
Expected Behavior
If one is working with a graph where properties and labels contain characters that might normally need to be escaped, including characters such as the special filter qualifiers, then the library does not function as expected.
For example, suppose a node has both the label http://www.w3.org/2002/07/owl#Class and (for the sake of demonstrating this issue), the label OwlClass.
I would expect that
MATCH (v1:`http://example.com/abc#Object`) where v1.uri = "node1e0g5tmg9x4628" call apoc.path.expand(v1, '>|<', '/OwlClass', 0, 2) yield path return distinct nodes(path)
and
MATCH (v1:`http://example.com/abc#Object`) where v1.uri = "node1e0g5tmg9x4628" call apoc.path.expand(v1, '>|<', '/http://www.w3.org/2002/07/owl#Class', 0, 2) yield path return distinct nodes(path)
to return the same results, but the later returns no response while the former returns content.
Versions
The text was updated successfully, but these errors were encountered: