neo4j / graph-data-science

Source code for the Neo4j Graph Data Science library of graph algorithms.
https://neo4j.com/docs/graph-data-science/current/
Other
635 stars 161 forks source link

gds.alpha.similarity.overlap and gds.alpha.ml.ann are not working #18

Closed headsrooms closed 4 years ago

headsrooms commented 4 years ago

Hi, everyone! I'm running the examples of both algorithms in the docs. For instance, this tests gds.alpha.similarity.overlap (https://neo4j.com/docs/graph-algorithms/current/labs-algorithms/overlap/):

CREATE
 (fahrenheit451:Book {title:'Fahrenheit 451'}),
 (dune:Book {title:'Dune'}),
 (hungerGames:Book {title:'The Hunger Games'}),
 (nineteen84:Book {title:'1984'}),
 (gatsby:Book {title:'The Great Gatsby'}),

 (scienceFiction:Genre {name: "Science Fiction"}),
 (fantasy:Genre {name: "Fantasy"}),
 (dystopia:Genre {name: "Dystopia"}),
 (classics:Genre {name: "Classics"}),

 (fahrenheit451)-[:HAS_GENRE]->(dystopia),
 (fahrenheit451)-[:HAS_GENRE]->(scienceFiction),
 (fahrenheit451)-[:HAS_GENRE]->(fantasy),
 (fahrenheit451)-[:HAS_GENRE]->(classics),

 (hungerGames)-[:HAS_GENRE]->(scienceFiction),
 (hungerGames)-[:HAS_GENRE]->(fantasy),

 (nineteen84)-[:HAS_GENRE]->(scienceFiction),
 (nineteen84)-[:HAS_GENRE]->(dystopia),
 (nineteen84)-[:HAS_GENRE]->(classics),

 (dune)-[:HAS_GENRE]->(scienceFiction),
 (dune)-[:HAS_GENRE]->(fantasy),
 (dune)-[:HAS_GENRE]->(classics),

  (gatsby)-[:HAS_GENRE]->(classics)
MATCH (book:Book)-[:HAS_GENRE]->(genre)
 WITH {item:id(genre), categories: collect(id(book))} as userData
 WITH collect(userData) as data
 CALL gds.alpha.similarity.overlap.stream({data: data})
 YIELD item1, item2, count1, count2, intersection, similarity
 RETURN gds.util.asNode(item1).name AS from, gds.util.asNode(item2).name AS to,
        count1, count2, intersection, similarity
 ORDER BY similarity DESC

Both algorithms raise the same error:

Failed to invoke procedure `gds.alpha.ml.ann.write`: Caused by: java.lang.IllegalArgumentException: Missing information for implicit graph creation. Specify either `nodeProjection` and `relationshipProjection` or `nodeQuery` and `relationshipQuery

I'm using GDS version 1.0.0, Neo4j Desktop 1.2.5, Neo4j Browser 4.0.5, Neo4j version 3.5.16 or Neo4j version 3.5.15 and Windows 10.

Thank you.

tomasonjo commented 4 years ago

You are looking at graph algorithms documentation and trying to reproduce it with GDS, when you should be looking at Graph Data science documentation at https://neo4j.com/docs/graph-data-science/1.0/alpha-algorithms/overlap/

headsrooms commented 4 years ago

Oh, I'm sorry and thank you, now I have #19 .