-
-
Save refset/57a910e2b746332ec7a0a31886f57cfb to your computer and use it in GitHub Desktop.
better-tree-depth.clj
This file contains 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
{:find [(pull hollywood [{:tmdb/type {:person [:tmdb.person/name] | |
:movie [:tmdb.movie/title]}}])] | |
:where [[kevin :tmdb.person/name "Kevin Bacon"] | |
(related-to kevin 2 hollywood depth)] | |
:rules [[(related-to [e d] e2 d*) | |
(rrelated-to e d e2 rd*) | |
[(- d rd*) d*]] | |
[(rrelated-to [e d] e2 d*) | |
[(> d 0)] | |
[(dec d) d*] | |
[credit :tmdb.person/id e] | |
[credit :tmdb.movie/id e2]] | |
[(rrelated-to [e d] e2 d**) | |
[(> d 0)] | |
[(dec d) d*] | |
[credit :tmdb.person/id e] | |
[credit :tmdb.movie/id intermediate] | |
(rrelated-to intermediate d* e2 d**)]]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment