Created
May 12, 2019 15:11
-
-
Save vladbatushkov/9d2ec2fa8287f8f18680b443380f7451 to your computer and use it in GitHub Desktop.
Similar flags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (f:Flag), (cl:Color) | |
OPTIONAL MATCH (f)-[c:CONTAINS]->(cl) | |
WITH { item:id(f), weights: collect(coalesce(c.weight, 0)) } as flagData | |
WITH collect(flagData) as data | |
CALL algo.similarity.cosine.stream(data) | |
YIELD item1, item2, count1, count2, similarity | |
RETURN algo.asNode(item1).name AS flag_of, algo.asNode(item2).name AS to_flag_fo, similarity | |
ORDER BY similarity DESC | |
LIMIT 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment