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

Description

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
[7] literal ::= STRING_LITERAL_QUOTE ('^^' IRIREF | LANGTAG)?

and

[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 WebSun, Feb 5, 12:19 AM
robinp added a subscriber: robinp.

Add Comment