cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Already installed Graph Data Science Library on the platform, but didn't work

jayxu688
Node Link

I want to use GDS on my graph, and I already installed the library.

The graph is like this.

MATCH (a:Artifact{gav:'org.slf4j:slf4j-api:1.6.1'})
WITH id(a) AS startNode
CALL gds.alpha.dfs.stream('myGraph', {startNode: startNode})
YIELD path
UNWIND [ n in nodes(path) | n.gav ] AS tags
RETURN tags
ORDER BY tags

CALL gds.graph.create('myGraph', 'Artifact', 'DEPEND_ON', { relationshipProperties: 'scope' })

3 REPLIES 3

Could you try both of these commands and let us know what you see?

----- Reference: https://neo4j.com/docs/graph-data-science/current/installation/

To verify your installation, the library version can be printed by entering into the browser in Neo4j Desktop and calling the gds.version() function:

RETURN gds.version()

To list all installed algorithms, run the gds.list() procedure:

CALL gds.list()

Thanks for your reply. It worked.

A further question about this cypher:
Can I set the direction of the relationship in this cypher?
What I want to know is all the project depend on this particular artifact (e.g. Artifact{gav:'org.slf4j:slf4j-api:1.6.1'}) using DFS algorithm. After I got the result, I want to see the does the result include the released project belong to our company( for exmaple, project A, B are directly or indirectly depending on 'org.slf4j:slf4j-api:1.6.1', but project C doesn't ). Finding all the released projects (as parameters) depending on this artifact as the termination condition , return project A and B's GAV information.

MATCH (a:Artifact {gav:'org.slf4j:slf4j-api:1.6.1'})
WITH id(a) AS startNode
CALL gds.alpha.dfs.stream('myGraph', {endNode: startNode})
YIELD path
UNWIND [ n in nodes(path) | n.gav ] AS tags
RETURN tags
ORDER BY tags

I tried this cypher but the performance is too bad when the result subgraph is too big
match (sss) -[:DEPEND_ON]->(a:Artifact{gav:"org.slf4j:slf4j-api:1.6.1"}) where sss<>a return distinct sss

I also tried this cypher:
MATCH (a:Artifact{gav:'org.slf4j:slf4j-api:1.6.1'}), (d:Artifact{gav:'org.wso2.carbon.identity.framework:org.wso2.carbon.identity.core:5.12.150'}) WITH id(a) AS startNode, id(d) AS targetNode CALL gds.alpha.dfs.stream('myGraph', {startNode: startNode, targetNode: targetNode}) YIELD path UNWIND [ n in nodes(path)] AS tags RETURN tags ORDER BY tags
It only showed the node itself.

But in fact, this node does depend on it.

As for what gds.alpha.dfs.stream supports, the documentation is here

https://neo4j.com/docs/graph-data-science/current/algorithms/dfs/

I'd also mention that you are using an "Alpha" version, there might be bugs (e.g. one bug found earlier, Data science DFS returns nonsense)