Closed kevinkle closed 5 years ago
Add re-running the mutation gives us new nodes in the db, so ya.
{
"extensions": {
"server_latency": {
"parsing_ns": 18856,
"processing_ns": 2261523,
"encoding_ns": 1030873
},
"txn": {
"start_ts": 40
}
},
"data": {
"class": [
{
"km": "ATCG",
"uid": "0x3"
},
{
"km": "ATCC",
"uid": "0x4"
},
{
"km": "ATCG",
"uid": "0x5"
},
{
"km": "ATCC",
"uid": "0x6"
}
]
}
}
I wonder how this works with bulk load
Looks like we might be fine with blank nodes split into multiple rdf files per Sharded UID Map
section in https://blog.dgraph.io/post/bulkloader/
{
q(func: eq(km, "ATCG")){
fd @facets(eq(type, "a") AND eq(value, 1)){
uid
}
}
}
{
q(func: eq(km, "ATCG")){
fd @facets(eq(type, "a") AND eq(value, 1))
@filter(eq(km, "ATCC"))
{
uid
}
}
}
{
set{
_:a <km> "AAAA" .
_:b <km> "BBBB" .
_:c <km> "CCCC" .
_:a <fd> _:b (type="a", value=1) .
_:b <fd> _:c (type="a", value=2) .
}
}
{
set{
_:a <km> "AAAA" .
_:b <km> "BBBB" .
_:c <km> "CCCC" .
_:a <fd> _:b (type="a", value=1) .
_:b <fd> _:c (type="a", value=2) .
}
}
{
path as shortest(from: 0x4e22, to:0x4e21){
fd
}
path(func: uid(path)) {
km
}
}
{
set{
_:a <km> "XXXX" .
<0x4e22> <fd> _:a (type="b", value=1) .
_:a <fd> <0x4e21> (type="b", value=2) .
}
}
{
path as shortest(from: 0x4e22, to:0x4e21){
fd @facets(eq(type, "a"))
}
path(func: uid(path)) {
km
}
}
returns
{
"extensions": {
"server_latency": {
"parsing_ns": 22227,
"processing_ns": 2627869,
"encoding_ns": 1228573
},
"txn": {
"start_ts": 20063
}
},
"data": {
"path": [
{
"km": "AAAA"
},
{
"km": "BBBB"
},
{
"km": "CCCC"
}
],
"_path_": [
{
"fd": [
{
"fd": [
{
"uid": "0x4e21"
}
],
"uid": "0x4e23"
}
],
"uid": "0x4e22"
}
]
}
}
{
path as shortest(from: 0x4e22, to:0x4e21){
fd
}
path(func: uid(path)) {
km
fd @facets(type, value){
km
}
}
}
{
"extensions": {
"server_latency": {
"parsing_ns": 23603,
"processing_ns": 3462913,
"encoding_ns": 1161420
},
"txn": {
"start_ts": 20078
}
},
"data": {
"path": [
{
"km": "AAAA",
"fd": [
{
"km": "BBBB",
"fd|type": "a",
"fd|value": 1
},
{
"km": "XXXX",
"fd|type": "b",
"fd|value": 1
}
]
},
{
"km": "BBBB",
"fd": [
{
"km": "CCCC",
"fd|type": "a",
"fd|value": 2
}
]
},
{
"km": "CCCC"
}
],
"_path_": [
{
"fd": [
{
"fd": [
{
"uid": "0x4e21"
}
],
"uid": "0x4e23"
}
],
"uid": "0x4e22"
}
]
}
}
{
path as shortest(from: 0x4e22, to:0x4e21, numpaths:100){
fd
}
path(func: uid(path)) {
km
}
}
{
"extensions": {
"server_latency": {
"parsing_ns": 17427,
"processing_ns": 2585440,
"encoding_ns": 994625
},
"txn": {
"start_ts": 20088
}
},
"data": {
"path": [
{
"km": "AAAA"
},
{
"km": "BBBB"
},
{
"km": "CCCC"
}
],
"_path_": [
{
"fd": [
{
"fd": [
{
"uid": "0x4e21"
}
],
"uid": "0x4e23"
}
],
"uid": "0x4e22"
},
{
"fd": [
{
"fd": [
{
"uid": "0x4e21"
}
],
"uid": "0x4e24"
}
],
"uid": "0x4e22"
}
]
}
}
{
q(func: eq(km, "AAAA")){
fd @facets(eq(type, "a")) @facets(value)
}
}
{
q(func: has(km))@filter(uid_in(fd, 0x4e21)){
uid
km
fd @facets(type, value) {
expand(_all_)
}
}
}
returns
{
"extensions": {
"server_latency": {
"parsing_ns": 22424,
"processing_ns": 2967667,
"encoding_ns": 1094799
},
"txn": {
"start_ts": 20169
}
},
"data": {
"q": [
{
"uid": "0x4e23",
"km": "BBBB",
"fd": [
{
"km": "CCCC",
"~fd": [
{
"~fd|type": "a",
"~fd|value": 2
},
{
"~fd|type": "b",
"~fd|value": 2
}
],
"fd|type": "a",
"fd|value": 2
}
]
},
{
"uid": "0x4e24",
"km": "XXXX",
"fd": [
{
"km": "CCCC",
"~fd": [
{
"~fd|type": "a",
"~fd|value": 2
},
{
"~fd|type": "b",
"~fd|value": 2
}
],
"fd|type": "b",
"fd|value": 2
}
]
}
]
}
}
returns
so we need to prefetch uids