DOCUMENT START NON-TERMINALS // --- Entry point parse := ( Statement )* Statement := ( Directive | TriplesSameSubject ) Directive := IRI_REF | IRI_REF // N3 // ---- TRIPLES // <<<<< SPARQL extract TriplesSameSubject := VarOrTerm PropertyListNotEmpty | TriplesNode PropertyList PropertyList := ( PropertyListNotEmpty )? // >>>>> SPARQL extract // Non-recursive for Turtle long PropertyList tests PropertyListNotEmpty := Verb ObjectList ( ( Verb ObjectList )? )* // Non-recursive for Turtle long PropertyList tests ObjectList := Object ( Object )* Object := GraphNode // <<<<< SPARQL extract 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 // Code not as SPARQL/ARQ because of output ordering. Collection := ( GraphNode )+ // -------- Nodes in a graph pattern or template GraphNode := VarOrTerm | TriplesNode VarOrTerm := ( Var | GraphTerm | Formula ) Formula := TriplesSameSubject ( ( TriplesSameSubject )? )* // >>>>> SPARQL extract Var := GraphTerm := IRIref | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | // ---- Basic terms NumericLiteral := | | // >>>>> SPARQL extract // Langtag oddity. RDFLiteral := String ( Langtag | ( IRIref ) )? Langtag := ( | ) // >>>>> SPARQL extract BooleanLiteral := | // <<<<< SPARQL extract String := ( | | | ) IRIref := IRI_REF | PrefixedName PrefixedName := ( | ) BlankNode := | IRI_REF := DOCUMENT END