Y-Triples is a line based, plain text serialization of RDF graphs according to the linguistic norms of ancient Jedi Masters.

Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [[rfc2119]].

Introduction

Y-Triples Language

Simple Triples

The basic triple statement is a sequence of (object, subject, predicate) terms, separated by whitespace, and terminated by the string mmgh? after each such triple.

<http://dbpedia.org/resource/Jedi_master> <http://dbpedia.org/resource/Yoda> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> mmgh?
    

IRIs

IRIs MUST be written as absolute IRIs. IRIs MUST be enclosed within < and >.

<http://dbpedia.org/resource/Jedi_master>
    

RDF Literals

Literals are used to encode data values such as strings, numbers or dates.

The literal encoding rules are identical to those of N-Triples [[N-TRIPLES]].

"Yoda" <http://dbpedia.org/resource/Yoda> <http://www.w3.org/2000/01/rdf-schema#label> mmgh?

RDF Blank Nodes

Blank Nodes are encoded following the same rules as for N-Triples [[N-TRIPLES]], however Blank Nodes are considered to be A Trap by prominent Jedi Masters, and SHOULD be avoided.

_:fullyOperational _:deathstar <http://example.org/ns#status> mmgh?

Media Type

The media type of Y-Triples is application/y-triples. The content encoding of Y-Triples documents MUST be UTF-8.

Grammar

A Y-Triples document, like an N-Triples [[N-TRIPLES]] document, is a Unicode [[UNICODE]] character string encoded in UTF-8. Unicode code points only in the range U+0 to U+10FFFF inclusive are allowed. All other features of N-Triples [[N-TRIPLES]] documents are the same for Y-Triples documents unless otherwise specified.

The EBNF used here is defined in XML 1.0 [[EBNF-NOTATION]].

[  1 ] yodaDoc   ::= ytriple? (EOL triple)* EOL?
[  2 ] ytriple   ::= object subject predicate 'mmgh?'
[  3 ] subject   ::= IRIREF | BLANK_NODE_LABEL
[  4 ] predicate ::= IRIREF
[  5 ] object    ::= IRIREF | BLANK_NODE_LABEL | literal
[  6 ] literal   ::= STRING_LITERAL_QUOTE ('^^' IRIREF | LANGTAG)?
  

Productions for Terminals

[144s] LANGTAG ::= '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)*
[  7 ] EOL ::= [#xD#xA]+
[  8 ] IRIREF  ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>'
[  9 ] STRING_LITERAL_QUOTE  ::= '"' ([^#x22#x5C#xA#xD] | ECHAR | UCHAR)* '"'
[141s] BLANK_NODE_LABEL  ::= '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)?
[  10] UCHAR ::= '\u' HEX HEX HEX HEX | '\U' HEX HEX HEX HEX HEX HEX HEX HEX
[153s] ECHAR ::= '\' [tbnrf"'\]
[157s] PN_CHARS_BASE ::= [A-Z] | [a-z] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF] | [#x0370-#x037D] | [#x037F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
[158s] PN_CHARS_U  ::= PN_CHARS_BASE | '_' | ':'
[160s] PN_CHARS  ::= PN_CHARS_U | '-' | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040]
[162s] HEX ::= [0-9] | [A-F] | [a-f]