We’re looking into possibilities of leveraging graph representation of our data. So far, we’ve done a PoC with an RDF quad store… and liked the representation a lot but less to the robustness and performance. We’re considering switching to DGraph but would like to keep a similar mindset.
In a nutshell, we now make a heavy use of context / named graph of each triple. We use that to store provenance information about the triple, meaning a document which gave us that particular information. We’re often searching information in specific subgraphs determined by the context / named graph. When an update comes for a given item, we’re simply wiping out the old named graph and replacing it with a new one.
I’m new to DGraph but would like to understand: Is this possible to do in DGraph (in DQL / GQL / both)? I noticed several things:
- This page uses “Label” in place of an RDF context / named graph. According to the document, this is different to an Attribute/Predicate but I saw no examples (or didn’t understand) of (1) setting this label for each edge during the ingestion; (2) using this label to look up data.
- According to this page, you can put facets on edges and retrieve their values at query time. The following example also mentiones the possibility of only looking up edges with a specific facet value, which is great. But can you also easily look up any edge with the given facet value, regardless of the source / target node (our equivalent to the entire graph)? Would this approach to “wiping out the old document” be efficient?
data(func: eq(name, "Alice")) {
friend @facets(eq(close, true)) {
name
}
}