I have dumped data from large json file, now I want to traverse all the nodes one by one, can anyone help me with the query for it. current queries I found in documentation are restricted to any type or key/entry of it’s object
Hi @hbarve1,
Welcome to the dgraph community!
Assuming you meant “I have imported data taken from a large json file”, you might try querying for the schema (doc) that was created when you imported.
Then you could use the returned values to iterate through the predicates that were imported.
data is quite random, it has generated around 500 predicates.
data is round 1TB
Yeah, that’s an unwieldy amount. Can you describe your project and what result you’re trying to achieve? Maybe that’ll reveal some other options.
Here is a way to explore your data.
Get all your predicates and add into a type.
type Dummy {
predicate1
predicate2...
498xpredicates...
}
Go to Bulk Edit in Ratel https://dgraph.io/docs/ratel/schema/#bulk-edit-schema--drop-data
Delete all there(it is fine, nothing will be deleted for real) and paste your Dummy type.
Now grab any node or a bunch of them with this query.
{
q(func: has(predicate1), first:50 ) @recurse {
expand(Dummy)
}
}
From there you can be creative based in what you already know about your data.
PS. Pay attention that a schema of that size will create an impact in latency. But this will help you out to have a better plan for future queries based in your dataset.