Has anyone used Graql in Haskell?

Graql[1] is a (and stands for) graph query language. It is unusually expressive, allowing relationships to be members of other relationships[2] -- effectively, allowing one edge to be an endpoint of another edge. Someone named Felix posted a Haskell library for generating Graql queries[3]. Does anyone have a Haskell program that not only generates but uses such a query? [1] https://hackage.haskell.org/package/graql [2] https://discuss.grakn.ai/t/nested-relationships/ [3] https://discuss.grakn.ai/t/graql-haskell-how-to-run-the-test-program/ -- Jeff Brown | Jeffrey Benjamin Brown Website https://msu.edu/~brown202/ | Facebook https://www.facebook.com/mejeff.younotjeff | LinkedIn https://www.linkedin.com/in/jeffreybenjaminbrown(spammy, so I often miss messages here) | Github https://github.com/jeffreybenjaminbrown

Hi Jeffrey, at least two of the pages you link to reference the github of the package, which has a very short example. That alone is not very useful, but the magic seems to happen in the runMatchfunction. That function obviously comes from is the package you linked to, so we know where to find the source code. There you can see that runMatch basically just callsrunGraql. (And it also presents the results in a somewhat nicer form than pure json, but that's not relevant.) The runGraql function in turn is just a few lines below in the source code and exposes thatit does nothing more than call the graql.sh shell script. So all the library does is to add a bit of Haskell type checking on top of the Java+JavaScript+Bash proprietary behemoth. That means even if someone has a Haskell program, the core question is how to use the graql.sh script – which is outside the scope of a Haskell mailing list I suppose, but I hope the Grakn project has some documentation about that. The Grakn approach to modeling a knowledge graph looks good, but I'm not even sure if we have something equivalent Haskell-side. We do have the necessary hypergraph libraries and all, and it's a fun area, so we probably do. But I highly doubt whatever we do have supports Graql. After all, why use an extra language if you can use functions directly? Sorry I have to disappoint you there. Cheers, MarLinn On 2017-03-14 04:53, Jeffrey Brown wrote:
Graql[1] is a (and stands for) graph query language. It is unusually expressive, allowing relationships to be members of other relationships[2] -- effectively, allowing one edge to be an endpoint of another edge.
Someone named Felix posted a Haskell library for generating Graql queries[3].
Does anyone have a Haskell program that not only generates but uses such a query?
[1] https://hackage.haskell.org/package/graql [2] https://discuss.grakn.ai/t/nested-relationships/ [3] https://discuss.grakn.ai/t/graql-haskell-how-to-run-the-test-program/
-- Jeff Brown | Jeffrey Benjamin Brown Website https://msu.edu/%7Ebrown202/ | Facebook https://www.facebook.com/mejeff.younotjeff | LinkedIn https://www.linkedin.com/in/jeffreybenjaminbrown(spammy, so I often miss messages here) |Github https://github.com/jeffreybenjaminbrown
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Hi Grakn.ai data model looks very much like RDF[1] with SPARQL[2] as a query language. There are quite a few data stores, owl reasoners and various libraries to work with rdf. There are haskell packages as well: rdf4h[3] for data representation, hsparql[4] to create and submit queries to sparql stores, swish[5] is a semantic web toolkit. Hope that would be helpful for you. [1] https://www.w3.org/TR/rdf11-concepts/ [2] https://www.w3.org/TR/sparql11-query/ [3] https://hackage.haskell.org/package/rdf4h [4] https://hackage.haskell.org/package/hsparql [5] https://hackage.haskell.org/package/swish -- Best Regards Vasiliy On 03/14/2017 06:53 AM, Jeffrey Brown wrote:
Graql[1] is a (and stands for) graph query language. It is unusually expressive, allowing relationships to be members of other relationships[2] -- effectively, allowing one edge to be an endpoint of another edge.
Someone named Felix posted a Haskell library for generating Graql queries[3].
Does anyone have a Haskell program that not only generates but uses such a query?
[1] https://hackage.haskell.org/package/graql [2] https://discuss.grakn.ai/t/nested-relationships/ [3] https://discuss.grakn.ai/t/graql-haskell-how-to-run-the-test-program/
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Thanks, Vasiliy and MarLinn! I didn't realize the underlying behemoth was proprietary. That's a deal-killer for me. I was excited about Graql because they say it makes nested relationships easy to represent. I once wrote a toolkit in Haskell for that[1], using the Functional Graph Library. Below I've included a demo of it, in case anyone is interested. I would like to integrate it with Sparql and other semweb tools. [1] https://github.com/JeffreyBenjaminBrown/digraphs-with-text/ -- make an empty graph
let g = empty :: RSLT
-- add three words to it
g <- pure $ foldl (flip insWord) g ["the cat","water","living organism"]
-- add three relationship templates. -- Templates resemble edge labels, but with arbitrary arity and nesting.
g <- pure $ foldl (flip insTplt) g ["_ needs _", "_ is a _","_ because _"]
-- view the graph so far
view g $ nodes g (0,"the cat") -- Expressions 0, 1 and 2 are "Words" (1,"water") (2,"living organism") (3,"_ #needs _") -- Expressions 3, 4 and 5 are "Tplts" (relationship templates) (4,"_ #(is a) _") (5,"_ #because _")
-- use the relationship templates to create two relationships
g <- pure $ fromRight $ insRel 3 [0,1] g g <- pure $ fromRight $ insRel 4 [0,2] g
view g $ nodes g (0,"the cat") (1,"water") (2,"living organism") (3,"_ #needs _") (4,"_ #(is a) _") (5,"_ #because _") (6,"the cat ##needs water") -- nodes 6 and 7 are the new relationships (7,"the cat ##(is a) living organism")
-- nesting! create a "because" relationship between relationships 6 and 7
g <- pure $ fromRight $ insRel 5 [6,7] g
view g $ nodes g (0,"the cat") (1,"water") (2,"living organism") (3,"_ #needs _") (4,"_ #(is a) _") (5,"_ #because _") (6,"the cat ##needs water") (7,"the cat ##(is a) living organism") (8,"the cat ##needs water ####because the cat ##(is a) living organism")
On Fri, Mar 17, 2017 at 10:14 AM, Vasiliy
Hi
Grakn.ai data model looks very much like RDF[1] with SPARQL[2] as a query language. There are quite a few data stores, owl reasoners and various libraries to work with rdf. There are haskell packages as well: rdf4h[3] for data representation, hsparql[4] to create and submit queries to sparql stores, swish[5] is a semantic web toolkit.
Hope that would be helpful for you.
[1] https://www.w3.org/TR/rdf11-concepts/ [2] https://www.w3.org/TR/sparql11-query/ [3] https://hackage.haskell.org/package/rdf4h [4] https://hackage.haskell.org/package/hsparql [5] https://hackage.haskell.org/package/swish
-- Best Regards Vasiliy
On 03/14/2017 06:53 AM, Jeffrey Brown wrote:
Graql[1] is a (and stands for) graph query language. It is unusually expressive, allowing relationships to be members of other relationships[2] -- effectively, allowing one edge to be an endpoint of another edge.
Someone named Felix posted a Haskell library for generating Graql queries[3].
Does anyone have a Haskell program that not only generates but uses such a query?
[1] https://hackage.haskell.org/package/graql [2] https://discuss.grakn.ai/t/nested-relationships/ [3] https://discuss.grakn.ai/t/graql-haskell-how-to-run-the-test-program/
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- Jeff Brown | Jeffrey Benjamin Brown Website https://msu.edu/~brown202/ | Facebook https://www.facebook.com/mejeff.younotjeff | LinkedIn https://www.linkedin.com/in/jeffreybenjaminbrown(spammy, so I often miss messages here) | Github https://github.com/jeffreybenjaminbrown

Thanks, Vasiliy and MarLinn! I didn't realize the underlying behemoth was proprietary. That's a deal-killer for me.
Don't just take my word for it. I didn't look at licensing terms or anything. The thing is, it seems to be a startup company, but nowhere did I find what they actually sell. No company can survive without income and there's no mention of support contracts, so I just assumed it must be the software itself, somehow. I just called it "proprietary" because for me there would be no difference: a company that doesn't tell me where the catch is is trying to catch me off guard, so they're working on the level of thugs. Ergo, without me, no matter how interesting the product looks. But I'm a harsh customer and it might be an unintentional blunder seeing how they're a startup, so YMMV. That being said, I don't see a problem representing nested relationships in RDF. And with how simple Graql is, even if Sparql shouldn't fit your needs you might be able to adapt something Graql-like? Sounds like an interesting project in any case! Cheers, MarLinn
I was excited about Graql because they say it makes nested relationships easy to represent. I once wrote a toolkit in Haskell for that[1], using the Functional Graph Library. Below I've included a demo of it, in case anyone is interested. I would like to integrate it with Sparql and other semweb tools.
[1] https://github.com/JeffreyBenjaminBrown/digraphs-with-text/
-- make an empty graph
let g = empty :: RSLT
-- add three words to it
g <- pure $ foldl (flip insWord) g ["the cat","water","living organism"]
-- add three relationship templates. -- Templates resemble edge labels, but with arbitrary arity and nesting.
g <- pure $ foldl (flip insTplt) g ["_ needs _", "_ is a _","_ because _"]
-- view the graph so far
view g $ nodes g (0,"the cat") -- Expressions 0, 1 and 2 are "Words" (1,"water") (2,"living organism") (3,"_ #needs _") -- Expressions 3, 4 and 5 are "Tplts" (relationship templates) (4,"_ #(is a) _") (5,"_ #because _")
-- use the relationship templates to create two relationships
g <- pure $ fromRight $ insRel 3 [0,1] g g <- pure $ fromRight $ insRel 4 [0,2] g
view g $ nodes g (0,"the cat") (1,"water") (2,"living organism") (3,"_ #needs _") (4,"_ #(is a) _") (5,"_ #because _") (6,"the cat ##needs water") -- nodes 6 and 7 are the new relationships (7,"the cat ##(is a) living organism")
-- nesting! create a "because" relationship between relationships 6 and 7
g <- pure $ fromRight $ insRel 5 [6,7] g
view g $ nodes g (0,"the cat") (1,"water") (2,"living organism") (3,"_ #needs _") (4,"_ #(is a) _") (5,"_ #because _") (6,"the cat ##needs water") (7,"the cat ##(is a) living organism") (8,"the cat ##needs water ####because the cat ##(is a) living organism")
On Fri, Mar 17, 2017 at 10:14 AM, Vasiliy
mailto:vasiliy.l@gmail.com> wrote: Hi
Grakn.ai data model looks very much like RDF[1] with SPARQL[2] as a query language. There are quite a few data stores, owl reasoners and various libraries to work with rdf. There are haskell packages as well: rdf4h[3] for data representation, hsparql[4] to create and submit queries to sparql stores, swish[5] is a semantic web toolkit.
Hope that would be helpful for you.
[1] https://www.w3.org/TR/rdf11-concepts/ https://www.w3.org/TR/rdf11-concepts/ [2] https://www.w3.org/TR/sparql11-query/ https://www.w3.org/TR/sparql11-query/ [3] https://hackage.haskell.org/package/rdf4h https://hackage.haskell.org/package/rdf4h [4] https://hackage.haskell.org/package/hsparql https://hackage.haskell.org/package/hsparql [5] https://hackage.haskell.org/package/swish https://hackage.haskell.org/package/swish
-- Best Regards Vasiliy
On 03/14/2017 06:53 AM, Jeffrey Brown wrote:
Graql[1] is a (and stands for) graph query language. It is unusually expressive, allowing relationships to be members of other relationships[2] -- effectively, allowing one edge to be an endpoint of another edge.
Someone named Felix posted a Haskell library for generating Graql queries[3].
Does anyone have a Haskell program that not only generates but uses such a query?
[1] https://hackage.haskell.org/package/graql https://hackage.haskell.org/package/graql [2] https://discuss.grakn.ai/t/nested-relationships/ https://discuss.grakn.ai/t/nested-relationships/ [3] https://discuss.grakn.ai/t/graql-haskell-how-to-run-the-test-program/ https://discuss.grakn.ai/t/graql-haskell-how-to-run-the-test-program/
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- Jeff Brown | Jeffrey Benjamin Brown Website https://msu.edu/%7Ebrown202/ | Facebook https://www.facebook.com/mejeff.younotjeff | LinkedIn https://www.linkedin.com/in/jeffreybenjaminbrown(spammy, so I often miss messages here) |Github https://github.com/jeffreybenjaminbrown
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Thanks, Vasiliy and MarLinn! I didn't realize the underlying behemoth was proprietary. That's a deal-killer for me.
Colour me surprised. https://github.com/graknlabs/grakn says that the source code is under GPL-3.0. Any RDF kit, like ClioPatria, should be able to do the kind of thing you want. Scaling and reliability will vary.
participants (4)
-
Jeffrey Brown
-
MarLinn
-
ok@cs.otago.ac.nz
-
Vasiliy