DOCUMENT START NON-TERMINALS // --- Entry point parse := ( ( Directive | Triples1 ) )* Directive := Q_IRI_REF // N3 // ---- TRIPLES // -------- Triple lists with property and object lists // void Triples() : { } // { // // Triples1() // // ( (Triples())?)? // } Triples1 := VarOrTerm PropertyListNotEmpty | TriplesNode PropertyList PropertyList := ( PropertyListNotEmpty )? PropertyListNotEmpty := Verb ObjectList ( ( Verb ObjectList )? )* // At least one thing. ObjectList := Object ( Object )* Object := GraphNode Verb := ( IRIref | ) // -------- Triple expansions // Anything that can stand in a node slot and which is // a number of triples TriplesNode := Collection | BlankNodePropertyList BlankNodePropertyList := PropertyListNotEmpty // ------- RDF collections Collection := ( GraphNode )+ // -------- Nodes in a graph pattern or template GraphNode := VarOrTerm | TriplesNode VarOrTerm := ( Var | GraphTerm ) // // Property (if no bNodes) + DESCRIBE // Node VarOrIRIref() : {Node n = null ; } // { // ( n = Var() | n = IRIref() ) // { return n ; } // } // // GRAPH and property if including blank nodes are properties. // Node VarOrBlankNodeOrIRIref() : {Node n = null ; } // { // ( n = Var() | n = BlankNode() | n = IRIref() ) // { return n ; } // } Var := ( | ) GraphTerm := IRIref | RDFLiteral | ( | )? NumericLiteral | BooleanLiteral | BlankNode | // ---- Basic terms NumericLiteral := | | RDFLiteral := String ( Langtag | ( IRIref ) )? Langtag := ( | ) BooleanLiteral := | String := ( | | | ) IRIref := Q_IRI_REF | QName QName := ( | ) BlankNode := | Q_IRI_REF := DOCUMENT END