Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-26-2021 05:07 PM
Using Neo4J 4.3.2 Enterprise
Before creating a graph projection, I transformed several node categorical properties into embeddings using one-hot encoding. One of these node properties was n.tier consisting of several levels (gold, silver, red, etc., ). A sample from the in memory graph where i filter on a particular tier looks like:
MATCH (g:Guest) where g.tierEmbedding[1] = 1.0
RETURN g.tierEmbedding, g.tier limit 3
And this returns:
g.tierEmbedding g.tier
[0.0, 1.0, 0.0, 0.0, 0.0] "Red"
[0.0, 1.0, 0.0, 0.0, 0.0] "Red"
[0.0, 1.0, 0.0, 0.0, 0.0] "Red"
Ensuring that the embeddings exist in the graph projection:
CALL gds.graph.streamNodeProperties('tableguests-complete', ['tierEmbedding'])
Results in (result is truncated):
nodeId nodeProperty propertyValue
0 "tierEmbedding" [1.0, 0.0, 0.0, 0.0, 0.0]
1 "tierEmbedding" [0.0, 1.0, 0.0, 0.0, 0.0]
All is good. Now from the graph projection, i want to create a subgraph of just "Red" Guests:
CALL gds.beta.graph.create.subgraph('tableguests-subgraph', 'tableguests-complete', 'n:Table OR (n:Guest AND n.tierEmbedding[1] = 1.0)', '*')
YIELD graphName, fromGraphName, nodeCount, relationshipCount
Gives the following error:
Failed to invoke procedure `gds.beta.graph.create.subgraph`: Caused by: java.lang.UnsupportedOperationException
Am i correct in assuming that the nodeFilter containing the n.tierEmbedding[1] = 1.0 is not allowed? This seems to be an appropriate cypher predicate for filtering nodes in the input graph.
07-27-2021 07:17 AM
A this point, graph.subgraph
does not support filtering on list properties (only floats, integers, and booleans). I've added your post to our feature request backlog, and we'll let you know once list support is added!
04-14-2022 01:59 PM
Hi @alicia.frame1
Can we also please add filtering based on string properties ? Currently I get the same unsupported error when attempting to filter based on a string value.
All the sessions of the conference are now available online