PathQuery, Google's Graph Query Language
1–10 of 49 posts
Re: PathQuery, Google's Graph Query Language
#2To 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.
Re: PathQuery, Google's Graph Query Language
#3On 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
#4Re: PathQuery, Google's Graph Query Language
#5Curious 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"}) =…
Re: PathQuery, Google's Graph Query Language
#6Strange that this paper doesn't even _mention_ GraphQL.
Re: PathQuery, Google's Graph Query Language
#7Strange that this paper doesn't even _mention_ GraphQL.
Re: PathQuery, Google's Graph Query Language
#8Strange that this paper doesn't even _mention_ GraphQL.
Re: PathQuery, Google's Graph Query Language
#9Strange 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
#10Strange 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.
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/