[Haskell-cafe] Has anyone used Graql in Haskell?

MarLinn monkleyon at gmail.com
Fri Mar 17 19:35:44 UTC 2017


> 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 <vasiliy.l at gmail.com 
> <mailto:vasiliy.l at 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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170317/5bd8de9e/attachment.html>


More information about the Haskell-Cafe mailing list