Skip to content

Commit 09f5061

Browse files
feat: Add RDF response capability to Pydgraph
2 parents 208e1ec + 1abc2fe commit 09f5061

File tree

5 files changed

+410
-298
lines changed

5 files changed

+410
-298
lines changed

pydgraph/client_stub.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
from pydgraph.meta import VERSION
2020
from pydgraph.proto import api_pb2_grpc as api_grpc
2121

22-
from urllib.parse import urlparse
22+
try:
23+
from urllib.parse import urlparse
24+
except ImportError:
25+
from urlparse import urlparse
2326

2427
__author__ = 'Garvit Pahal <[email protected]>'
2528
__maintainer__ = 'Martin Martinez Rivera <[email protected]>'

pydgraph/proto/api.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,21 @@ message Request {
5252

5353
repeated Mutation mutations = 12;
5454
bool commit_now = 13;
55+
enum RespFormat {
56+
JSON = 0;
57+
RDF = 1;
58+
}
59+
RespFormat resp_format = 14;
5560
}
5661

5762
message Uids {
5863
repeated string uids = 1;
5964
}
6065

66+
message ListOfString {
67+
repeated string value = 1;
68+
}
69+
6170
message Response {
6271
bytes json = 1;
6372
TxnContext txn = 2;
@@ -67,6 +76,8 @@ message Response {
6776
// uids contains a mapping of blank_node => uid for the node. It only returns uids
6877
// that were created as part of a mutation.
6978
map<string, string> uids = 12;
79+
bytes rdf = 13;
80+
map<string, ListOfString> hdrs = 14;
7081
}
7182

7283
message Mutation {

0 commit comments

Comments
 (0)