Live data from Hacker News

PathQuery, Google's Graph Query Language

arxiv.org

1–10 of 49 posts

Re: PathQuery, Google's Graph Query Language

#2
Curious that there is no mention of Datalog [^1] for graph traversal in the paper.

To support multi-locale names in Datomic or Datascript-flavoured Datalog attractions_v1.pq would be written as (where :entity/locale is of type :db.type/ref):

    (d/q [:find ?id ?name ?lang
         :in $ ?type
         :where
         [?e :entity/type ?type]
         [?e :entity/locale ?loc]
         [?loc :locale/name ?name]
         [?loc :locale/lang ?lang]
      db #{"museum" "theme_park"})
    => (["/z/38dwfnb8" "Museum of Modern Art" "en"]
        ["/z/38dwfnb8" "Museo de Arte Moderno" "es"]
        ...)
You could store the locale inside the name string, but then you can't efficiently filter on it. If you want the whole shebang, can do `(pull ?id [*])`. It's not obvious in their example if the locale filtering is post-query or part of the unification.

With only 4-tuple EAVT-style indices, you need an intermediate join to support compound values like ["Hello" "en"] if you want to query against the components, so I have been toying with making my own graph DB with 5-tuple (or more) extensible indices, e.g. EAXVT, where X would be the locale, but then index order matters.

[^1]: http://www.learndatalogtoday.org/

Re: PathQuery, Google's Graph Query Language

#3
Interesting read. I think there are some ideas in there that can be used for sparql 1.2. especially regarding external function definitions.

On the other hand the sparql in the paper is decent but not excellent. The result is subtly different from the path query one, but I think fine for example use case.

Re: PathQuery, Google's Graph Query Language

#5
post #2

Curious that there is no mention of Datalog [^1] for graph traversal in the paper. To support multi-locale names in Datomic or Datascript-flavoured Datalog attractions_v1.pq would be written as (where :entity/locale is of type :db.type/ref): (d/q [:find ?id ?name ?lang :in $ ?type :where [?e :entity/type ?type] [?e :entity/locale ?loc] [?loc :locale/name ?name] [?loc :locale/lang ?lang] db #{"museum" "theme_park"}) =…

Clojure's Datalog ("Clojurelog") basically looks a whole lot like SPARQL written using Clojure data structure literals and they do reference SPARQL in the paper.

Re: PathQuery, Google's Graph Query Language

#6

Strange that this paper doesn't even _mention_ GraphQL.

I don't think GraphQL is used to query graph databases directly, is it? I've always understood it to be an API protocol that was built to serve some specific needs Facebook had (e.g. bundling multiple HTTP requests), not a full-on graph query language. I should probably mention that I don't really have extensive experience using it, though.

Re: PathQuery, Google's Graph Query Language

#9

Strange that this paper doesn't even _mention_ GraphQL.

I don't think GraphQL is used to query graph databases directly, is it? I've always understood it to be an API protocol that was built to serve some specific needs Facebook had (e.g. bundling multiple HTTP requests), not a full-on graph query language. I should probably mention that I don't really have extensive experience using it, though.

you're right, on every point

Re: PathQuery, Google's Graph Query Language

#10

Strange that this paper doesn't even _mention_ GraphQL.

I don't think GraphQL is used to query graph databases directly, is it? I've always understood it to be an API protocol that was built to serve some specific needs Facebook had (e.g. bundling multiple HTTP requests), not a full-on graph query language. I should probably mention that I don't really have extensive experience using it, though.

I think it is used as foundation for DQL[0], the query language of Dgraph.

But in and of itself, GraphQL isn't really built to query graph databases as you said.

[0] https://dgraph.io/docs/query-language/graphql-fundamentals/

Post reply on HN