Questions tagged [dgraph]

Dgraph is a free, open source graph database that uses a customised version of graphql as a query language. DO NOT USE this tag for general graphql questions nor for other graph DBs.

Dgraph is an open source, scalable, distributed and highly available graph database. It's sharded storage and query processing were specifically designed to minimize the number of network calls. The database server and tools, written in go, are open-sourced and available under AGPL v3.0. The query language is named GraphQL+- and is based on Facebook’s GraphQL.

The clients communicate with the server using Protocol Buffers over gRPC. In the current version (v1.0.11), the available official clients are limited to the languages Go, Java, Javascript and Python.

For more information check following FAQ topics:

Useful links

Related Tags

106 questions
1
vote
1 answer

Dgraph: Is it possible to store arrays natively?

When I tried to store an array like test: []string{"hello", "bye"} using dgo and queried for test, I only get back "hello". Seems like the closest way to store an array in Dgraph is to create multiple objects and point them towards a single node. If…
sdfsdf
  • 5,052
  • 9
  • 42
  • 75
1
vote
1 answer

How to bulk load data into a dgraph/standalone:graphql container?

Assuming I've a db like the quick-start of https://graphql.dgraph.io/docs/quick-start/ i.e. type Product { productID: ID! name: String @search(by: [term]) reviews: [Review] @hasInverse(field: about) } type Customer { custID: ID! …
Flavien Volken
  • 19,196
  • 12
  • 100
  • 133
1
vote
1 answer

Writing Social media's schema in dgraph

I am beginner with dgraph and shifting from neo4j to dgraph. I am writing schema where I have different social media platforms details. Considering facebook, the schema will have basic details of the profile,groups,pages plus different relations…
Shahan Ali
  • 11
  • 1
1
vote
1 answer

Dgraph - graphql where are described the directives on schema?

With the recent support of native GraphQL, dgraph introduced the use of @hasInverse and @search directives. When I write my schema in my editor, the linter warns me about those unknown directive. (Unknown directive "search" and Unknown directive…
Flavien Volken
  • 19,196
  • 12
  • 100
  • 133
1
vote
1 answer

Not able to query for nested relations using dgraph-orm

I am using dgraph-orm for fetching nested relational values but it works for single level but not multiple level. I am getting the page details but unable to fetch the avatar of the page. Here is my snippet: let posts = await PagePost.has('page_id',…
1
vote
1 answer

How to get ' logs' of the queries in dgraph-orm

The earlier version of dgraph-orm provided logging of the queries by default but after the latest update it has been turned off. So is there any way to turn on the logging. I need to debug and find out if the queries being fired are correct. This is…
1
vote
1 answer

How to model similar named predicates or attributes for nodes in dgraph?

I am trying to use Dgraph as my primary database. I have a simple system that has two domain entities viz. User and Product. They both have certain properties represented as edges/attributes in Dgraph. They both have a common property name which is…
Harshal Patil
  • 17,838
  • 14
  • 60
  • 126
1
vote
1 answer

Graph database: get common parent node

I want to select the first common boss for two employees in draph. My model is simple: name: string boss_of: uids Lets assume the following data where each arrow denotes the boss_of edge: A -> B A -> C B -> D C -> E E -> F E -> G So, given F And D…
Sascha
  • 10,231
  • 4
  • 41
  • 65
1
vote
1 answer

Query for a node, filtering using uid of child nodes (relations)

If have a schema "Like" that has relations to User Schema (user_id) and Post Schema (object_id). How can I query for the "Like" nodes that have user_id = (some_uid) and object_id = (some_uid). I am using dgraph-io/dgraph-js. User Schema …
1
vote
1 answer

Error while mutating Uid : [X] cannot be greater than lease: [Y]

I am trying to load a 2million records in dgraph, each is structured like message_id : <> message_id_replied_to: I process them like Load all message_ids in dgraph using bulk loader Then start processing…
Aishwat Singh
  • 4,331
  • 2
  • 26
  • 48
1
vote
0 answers

Query - get_all - Multiple Inputs - Pydgraph

As stated over here link, it query for 'Alice' and it results for all the information for 'Alice'. What if I have 'n' inputs in order to get all information say n=2 'Alice', 'Bob', etc. What would be the query? I tried to define variables_1 = {'$b':…
Aman Dalmia
  • 101
  • 1
  • 8
1
vote
1 answer

How to import .rdf file in Neo4j database?

I have a .rdf file which I was used for Dgraph in order to import the data and the subsequently queries in order to get the relations in the Dgraph Ratel UI. Now I need to include in my web application for which Dgraph doesn't have support (link).…
Aman Dalmia
  • 101
  • 1
  • 8
1
vote
1 answer

is it possible to retrieve the current schema using dgo

Is there a way to retrieve the dgraph schema using the dgo client? What I want to do is compare my existing schema with the one on the server in order to avoid re-sending it as it triggers reindexing each time I send a schema which is already set.
Coyote
  • 2,454
  • 26
  • 47
1
vote
1 answer

How to delete quad in dgraph using dgo api.NQuad

Is it possible to remove all edges matching a predicate from a given node using api.NQuad from github.com/dgraph-io/dgo/protos/api? I'm trying to achieve the equivalent of delete {0x1234 * } func TestDeleteQuad(t *testing.T) { …
Coyote
  • 2,454
  • 26
  • 47
1
vote
0 answers

Example Dgraph recurse sum query

New Dgraph user wondering if anyone can provide me with an example recursive count and sum query to help get me going. The data looks like this (there are more predicates, but left out for simplicity): { "uid" : <0x1>, "url" :…
six7zero9
  • 313
  • 1
  • 4
  • 15