DOCUMENT START NON-TERMINALS // --- Entry point parse := ( Statement )* Statement := ( Directive | TriplesSameSubject ) Directive := Q_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 | BlankNode | // ---- Basic terms NumericLiteral := | | // >>>>> SPARQL extract // Langtag oddity. RDFLiteral := String ( Langtag | ( IRIref ) )? Langtag := ( | ) // >>>>> SPARQL extract // Node BooleanLiteral() : {} // { // { return XSD_TRUE ; } // | // { return XSD_FALSE ; } // } // <<<<< SPARQL extract String := ( | | | ) IRIref := Q_IRI_REF | QName QName := ( | ) BlankNode := | Q_IRI_REF := DOCUMENT END