Skip to content

Instantly share code, notes, and snippets.

@CampingScorpion
Created March 24, 2012 01:38
Show Gist options
  • Save CampingScorpion/2177153 to your computer and use it in GitHub Desktop.
Save CampingScorpion/2177153 to your computer and use it in GitHub Desktop.
(def g
[[:a1 :rdf/type :sdx/FederationService]
[:a1 :sdx/exposesServices :a2]
[:a2 :rdf/type :sdx/ServiceCollection]
[:a2 :sdx/service :b1]
[:a2 :sdx/service :c1]
[:a2 :sdx/service :d1]
[:b1 :rdf/type :sdx/FederatedService]
[:b1 :sdx/exposesServices :b2]
[:b2 :sdx/service :b3]
[:b3 :rdf/type :sd/Service]
[:b3 :sd/endpoint "http://my/url-b"]
[:c1 :rdf/type :sdx/FederatedService]
[:c1 :sdx/exposesServices :c2]
[:c2 :sdx/service :c3]
[:c3 :rdf/type :sd/Service]
[:c3 :sd/endpoint "http://my/url-c"]
[:d1 :rdf/type :sdx/FederatedService]
[:d1 :sdx/exposesServices :d2]
[:d2 :sdx/service :d3]
[:d3 :rdf/type :sd/Service]
[:d3 :sd/endpoint "http://my/url-d"]])
(run* [q]
(fresh [a b c d e f]
(membero [a :rdf/type :sdx/FederationService] g)
(membero [a :sdx/exposesServices b] g)
(membero [b :sdx/service c] g)
(membero [c :rdf/type :sdx/FederatedService] g)
(membero [c :sdx/exposesServices d] g)
(membero [d :sdx/service e] g)
(membero [e :rdf/type :sd/Service] g)
(membero [e :sd/endpoint q] g)))
; => ("http://my/url-b" "http://my/url-c" "http://my/url-d")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment