N-Quad output format should use beaks instead quotes in subject and predicate.


Quoting https://www.w3.org/TR/n-quads/#sec-grammar

[1] nquadsDoc ::= statement? (EOL statement)* EOL?
[2] statement ::= subject predicate object graphLabel? '.'
[3] subject ::= IRIREF | BLANK_NODE_LABEL
[4] predicate ::= IRIREF
[5] object ::= IRIREF | BLANK_NODE_LABEL | literal
[6] graphLabel ::= IRIREF | BLANK_NODE_LABEL


[10] IRIREF ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>'

Now Kythe's triplets tool produces statements where fields are enclosed by quotation marks "". The graph database Cayley is happy about this, but DGraph is not.

It seems

  • the subject and predicate should be enclosed in <> instead of quotes (let's not discuss the blank node, which is of form _:whatever).
  • the object can either be a quote-enclosed literal (for node facts) or a beak-enclosed ref (for edge targets).

Note: when data is in the proper format, the Cayley Gremlin queries also need to contain the beaks (just like in the Cayley doc, for example:

g.V().Has("</kythe/node/kind>", "anchor").Out("</kythe/edge/defines/binding>").All()
robinp created this task.Via WebFeb 5 2017, 12:19 AM
robinp added a subscriber: robinp.
fromberger triaged this task as "Wishlist" priority.Via WebFeb 26 2017, 11:44 PM
fromberger added a subscriber: fromberger.

Add Comment