# $Id: facets.ttl,v 1.18 2007/12/04 18:56:18 eric Exp $

# Maintenance: test:order properties can be updated with emacs replace-regexp.
# 	       replace regexp: test:order [0-9]+;
#	       with regexp: test:order \#;

# Every test has N facets, N >= 0.
# Every facet belongs to 1 feature. (Every feature has M facets.)
# Every facet has one canonical test (selected automatically based on smallest number of other facets)
# Every failing test can count against 1 or more facets:
#   Failing test T that has facets f1, f2, ..., fN will count against facet fi
#    if the same implementation failed fi's canonical test. (This rule tries to explain the cause of the failure.)
#   Every failing test must count against at least one facet - if the above rule does not find an explanation,
#    then manual intervention examines the case and picks a facet (or if appropriate, creates a new facet) to count against.
#     

@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dawgt:   <http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#> .

@prefix rdfs:	<http://www.w3.org/2000/01/rdf-schema#> .
@prefix mf:     <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
@prefix :     <http://www.w3.org/2001/sw/DataAccess/tests/facets#> .
@prefix test: <http://www.w3.org/2001/sw/DataAccess/tests/#> .
@prefix sparql: <http://www.w3.org/2001/sw/DataAccess/rq23/rq24#> .


:CoreSPARQL a test:DAWGfeature ; rdfs:comment "Core bits of SPARQL. Prefixed names, variables, blank nodes, graph terms" .
:BasicGraphPatterns a test:DAWGfeature ; rdfs:comment "Basic graph pattern matching. Triple pattern constructs. Blank node scoping" .
:Optionals a test:DAWGfeature ; rdfs:comment "OPTIONAL pattern matching" .
:Unions a test:DAWGfeature ; rdfs:comment "UNION pattern matching" .
:Filters a test:DAWGfeature ; rdfs:comment "FILTER clauses and expressions" .
:Datasets a test:DAWGfeature ; rdfs:comment "RDF datasets. Default and named graphs. GRAPH keyword" .
:SolutionSequence a test:DAWGfeature ; rdfs:comment "Sorting (ORDER BY) and slicing (LIMIT, OFFSET)" .
:SelectQueries a test:DAWGfeature ; rdfs:comment "SELECT query form" .
:ConstructQueries a test:DAWGfeature ; rdfs:comment "CONSTRUCT query form" .
:AskQueries a test:DAWGfeature ; rdfs:comment "ASK query form" .


# rProlog
:BaseDecl a test:DAWGfacet; test:order 0;
	rdfs:comment "BASE <...>";
    test:feature :CoreSPARQL;
	test:xpath "//BaseDecl";
	test:production "BaseDecl";
	test:productionURI sparql:rBaseDecl .
:PrefixDecl-default a test:DAWGfacet; test:order 1;
	rdfs:comment "PREFIX : <...>";
    test:feature :CoreSPARQL;
	test:xpath "//Prologue/PrefixDecl/PNAME_NS[text()=':'";
	test:production "PrefixDecl";
	test:productionURI sparql:rPrefixDecl .
:PrefixDecl-nonDefault a test:DAWGfacet; test:order 2;
	rdfs:comment "PREFIX foo: <...>";
    test:feature :CoreSPARQL;
	test:xpath "//Prologue/PrefixDecl/PNAME_NS[text()!=':'";
	test:production "PrefixDecl";
	test:productionURI sparql:rPrefixDecl .
:PrefixDecl-n a test:DAWGfacet; test:order 3;
	rdfs:comment "PREFIX foo: <...> PREFIX bar: <...>";
    test:feature :CoreSPARQL;
	test:xpath "//Prologue[count(PrefixDecl) > 1]";
	test:production "PrefixDecl";
	test:productionURI sparql:rPrefixDecl .


# <SELECT>
# rSelectQuery
:SelectQuery-Distinct-Var a test:DAWGfacet; test:order 4;
	rdfs:comment "SELECT DISTINCT ?x";
    test:feature :SelectQueries;
	test:xpath "//SelectQuery[yacker:implicit-terminal[text()='DISTINCT'] and Var]";
	test:production "SelectQuery";
	test:productionURI sparql:rSelectQuery;
	test:regexp "^ +[Dd][Ii][Ss][Tt][Ii][Nn][Cc][Tt] " .
:SelectQuery-Distinct-star a test:DAWGfacet; test:order 5;
	rdfs:comment "SELECT DISTINCT *";
    test:feature :SelectQueries;
	test:xpath "//SelectQuery[yacker:implicit-terminal[text()='DISTINCT'] and yacker:implicit-terminal[text()='TIMES']]";
	test:production "SelectQuery";
	test:productionURI sparql:rSelectQuery .
:SelectQuery-Reduced-Var a test:DAWGfacet; test:order 4;
	rdfs:comment "SELECT REDUCED ?x";
    test:feature :SelectQueries;
	test:xpath "//SelectQuery[yacker:implicit-terminal[text()='REDUCED'] and Var]";
	test:production "SelectQuery";
	test:productionURI sparql:rSelectQuery;
	test:regexp "^ +[Dd][Ii][Ss][Tt][Ii][Nn][Cc][Tt] " .
:SelectQuery-Reduced-star a test:DAWGfacet; test:order 5;
	rdfs:comment "SELECT REDUCED *";
    test:feature :SelectQueries;
	test:xpath "//SelectQuery[yacker:implicit-terminal[text()='REDUCED'] and yacker:implicit-terminal[text()='TIMES']]";
	test:production "SelectQuery";
	test:productionURI sparql:rSelectQuery .
:SelectQuery-noDistinct-Var a test:DAWGfacet; test:order 6;
	rdfs:comment "SELECT ?x";
    test:feature :SelectQueries;
	test:xpath "//SelectQuery[not(yacker:implicit-terminal[text()='DISTINCT']) and not(yacker:implicit-terminal[text()='REDUCED']) and Var]";
	test:production "SelectQuery";
	test:productionURI sparql:rSelectQuery;
	test:yaccProduction "( Var+ | '*' )";
	test:regexp "DOUBLE_BACKSLASH?" .
:SelectQuery-noDistinct-star a test:DAWGfacet; test:order 7;
	rdfs:comment "SELECT *";
    test:feature :SelectQueries;
	test:xpath "//SelectQuery[not(yacker:implicit-terminal[text()='DISTINCT']) and not(yacker:implicit-terminal[text()='REDUCED']) and yacker:implicit-terminal[text()='TIMES']]";
	test:production "SelectQuery";
	test:productionURI sparql:rSelectQuery;
	test:yaccProduction "( Var+ | '*' )";
	test:regexp "DOUBLE_BACKSLASH*" .
:SelectQuery-Var-n a test:DAWGfacet; test:order 8;
	rdfs:comment "SELECT $x ?y";
    test:feature :SelectQueries;
	test:xpath "//SelectQuery[count(Var) > 1]";
	test:production "SelectQuery";
	test:productionURI sparql:rSelectQuery;
	test:regexp "DOUBLE_BACKSLASH$" .


# rDatasetClause
:DefaultGraphClause a test:DAWGfacet; test:order 9;
	rdfs:comment "FROM <...>";
    test:feature :Datasets;
	test:xpath "//DefaultGraphClause";
	test:production "DefaultGraphClause";
	test:productionURI sparql:rDefaultGraphClause .
:DefaultGraphClause-n a test:DAWGfacet; test:order 10;
	rdfs:comment "FROM <...> FROM <...>";
    test:feature :Datasets;
	test:xpath "//SelectQuery[count(DatasetClause/DefaultGraphClause) > 1]";
	test:production "DefaultGraphClause";
	test:productionURI sparql:rDefaultGraphClause .

:NamedGraphClause a test:DAWGfacet; test:order 11;
	rdfs:comment "FROM NAMED <...>";
    test:feature :Datasets;
	test:xpath "//NamedGraphClause";
	test:production "NamedGraphClause";
	test:productionURI sparql:rNamedGraphClause;
	test:rule "'NAMED'" .
:NamedGraphClause-n a test:DAWGfacet; test:order 12;
	rdfs:comment "FROM NAMED <...> FROM NAMED <...>";
    test:feature :Datasets;
	test:xpath "//SelectQuery[count(DatasetClause/NamedGraphClause) > 1]";
	test:production "NamedGraphClause";
	test:productionURI sparql:rNamedGraphClause;
	test:rule "'NAMED'" .

# rWhereClause
:GroupOrUnionGraphPattern-union a test:DAWGfacet; test:order 13;
	rdfs:comment "UNION { ... }";
    test:feature :Unions;
	test:xpath "//GroupOrUnionGraphPattern/yacker:implicit-terminal[text()='UNION']";
	test:production "GroupOrUnionGraphPattern";
	test:productionURI sparql:rGroupOrUnionGraphPattern .
:OptionalGraphPattern a test:DAWGfacet; test:order 14;
	rdfs:comment "OPTIONAL { ... }";
    test:feature :Optionals;
	test:xpath "//OptionalGraphPattern";
	test:production "OptionalGraphPattern";
	test:productionURI sparql:rOptionalGraphPattern .
:GraphGraphPattern a test:DAWGfacet; test:order 15;
	rdfs:comment "GRAPH ?x { ... }";
    test:feature :Datasets;
	test:xpath "//GraphGraphPattern";
	test:production "GraphGraphPattern";
	test:productionURI sparql:rGraphGraphPattern .
:WhereClause-where a test:DAWGfacet; test:order 16;
	rdfs:comment "WHERE { ... }";
    test:feature :CoreSPARQL;
	test:xpath "//WhereClause/yacker:implicit-terminal[text()='WHERE']";
	test:production "WhereClause";
	test:productionURI sparql:rWhereClause;
	test:rule "'WHERE'?";
	test:regexp "^$" . #"#"
:WhereClause-noWhere a test:DAWGfacet; test:order 17;
	rdfs:comment "WHERE^H^H^H { ... }";
    test:feature :CoreSPARQL;
	test:xpath "//WhereClause[count(yacker:implicit-terminal[text()='WHERE']) = 0]";
	test:production "WhereClause";
	test:productionURI sparql:rWhereClause;
	test:rule "'WHERE'?";
	test:regexp "^$" . #"#"

# rGraphPattern
# 	patterns
:GroupGraphPattern-empty a test:DAWGfacet; test:order 18;
	rdfs:comment "{}";
    test:feature :BasicGraphPatterns; # Lee: ???
	test:xpath "//GroupGraphPattern[not(TriplesBlock) and not(GraphPatternNotTriples)]";
	test:production "GraphPatternElement";
	test:productionURI sparql:rGraphPattern;
	test:rule "BasicGraphPattern?" ;
	test:regexp "^$" . #"#"
:BasicGraphPattern-spo a test:DAWGfacet; test:order 19;
	rdfs:comment "{ ?s ?p ?o ... }";
    test:feature :BasicGraphPatterns; # Lee: ???
	test:xpath "//TriplesBlock[TriplesSameSubject/PropertyListNotEmpty[count(Verb)=1 and ObjectList[count(Object)=1]] and not(yacker:implicit-terminal[position()=last() and text()='DOT'])]";
	test:production "GraphPatternElement";
	test:productionURI sparql:rGraphPattern;
	test:rule "BasicGraphPattern?" ;
	test:regexp "." .
:BasicGraphPattern-spoDOT a test:DAWGfacet; test:order 20;
	rdfs:comment "{ ... ?s ?p ?o . }";
    test:feature :BasicGraphPatterns; # Lee: ???
	test:xpath "//TriplesBlock[TriplesSameSubject/PropertyListNotEmpty[count(Verb)=1 and ObjectList[count(Object)=1]] and yacker:implicit-terminal[position()=last() and text()='DOT']]";
	test:production "GraphPatternElement";
	test:productionURI sparql:rGraphPattern;
	test:yaccProduction "( '.' BasicGraphPattern? )";
	test:rule "BasicGraphPattern?" ;
	test:regexp "^$" . #"#"
:BasicGraphPattern-spoo a test:DAWGfacet; test:order 21;
	rdfs:comment "{ ... ?s ?p ?o1, ?o2 ... }";
    test:feature :BasicGraphPatterns; # Lee: ???
	test:xpath "//TriplesSameSubject/PropertyListNotEmpty[count(Verb)=1 and ObjectList[count(Object)>1]";
	test:production "GraphPatternElement";
	test:productionURI sparql:rGraphPattern;
	test:yaccProduction "( ',' ObjectList )";
	test:rule "','" .
:BasicGraphPattern-spopo a test:DAWGfacet; test:order 22;
	rdfs:comment "{ ... ?s ?p1 ?o1 ; ?p2 ?o2 ... }";
    test:feature :BasicGraphPatterns; # Lee: ???
	test:xpath "//TriplesSameSubject/PropertyListNotEmpty[count(Verb)>1 and ObjectList[count(Object)=1]";
	test:production "GraphPatternElement";
	test:productionURI sparql:rGraphPattern;
	test:yaccProduction "';' PropertyList";
	test:rule "';'" .
:BasicGraphPattern-spospo a test:DAWGfacet; test:order 23;
	rdfs:comment "{ ... ?s1 ?p1 ?o1 . ?s2 ?p2 ?o2 ... }";
    test:feature :BasicGraphPatterns; # Lee: ???
	test:xpath "//TriplesBlock/TriplesBlock";
	test:production "GraphPatternElement";
	test:productionURI sparql:rGraphPattern;
	test:yaccProduction "( '.' BasicGraphPattern? )";
	test:rule "BasicGraphPattern?" ;
	test:regexp "." .

# 	terms
:Var-rVAR1 a test:DAWGfacet; test:order 24;
	rdfs:comment ":s :p ?o";
    test:feature :CoreSPARQL;
	test:xpath "//Var/VAR1";
	test:production "Var";
	test:productionURI sparql:rVar;
	test:rule "VAR1" .
:Var-rVAR2 a test:DAWGfacet; test:order 25;
	rdfs:comment ":s :p $o";
    test:feature :CoreSPARQL;
	test:xpath "//Var/VAR2";
	test:production "Var";
	test:productionURI sparql:rVar;
	test:rule "VAR2" .
:IRIref-rQ_IRI_REF a test:DAWGfacet; test:order 26;
	rdfs:comment "<...>";
    test:feature :CoreSPARQL;
	test:xpath "//IRIref/IRI_REF";
	test:production "IRIref";
	test:productionURI sparql:rIRIref;
	test:rule "Q_IRI_REF" .
:PrefixedName-prefix a test:DAWGfacet; test:order 27;
	rdfs:comment "prefix:";
    test:feature :CoreSPARQL;
	test:xpath "//PrefixedName/PNAME_NS";
	test:production "PrefixedName";
	test:productionURI sparql:rPrefixedName;
	test:rule "QNAME_NS" .
:PrefixedName-localname a test:DAWGfacet; test:order 28;
	rdfs:comment ":localName";
    test:feature :CoreSPARQL;
	test:xpath "//PrefixedName/PNAME_LN[starts-with(text(), ':')]";
	test:production "PrefixedName";
	test:productionURI sparql:rPrefixedName;
	test:rule "QNAME_LN";
	test:regexp "^:" .
:PrefixedName-prefix-localname a test:DAWGfacet; test:order 29;
	rdfs:comment "prefix:localName";
    test:feature :CoreSPARQL;
	test:xpath "//PrefixedName/PNAME_LN[not(starts-with(text(), ':'))]";
	test:production "PrefixedName";
	test:productionURI sparql:rPrefixedName;
	test:rule "QNAME_LN";
	test:regexp "^[^:]" .
:String-singleQuote a test:DAWGfacet; test:order 30;
	rdfs:comment "?s ?p 'asdf'";
    test:feature :CoreSPARQL;
	test:xpath "//String/STRING_LITERAL1";
	test:production "String";
	test:productionURI sparql:rString;
	test:rule "STRING_LITERAL1" .
:String-doubleQuote a test:DAWGfacet; test:order 31;
	rdfs:comment "?s ?p \"asdf\"";
    test:feature :CoreSPARQL;
	test:xpath "//String/STRING_LITERAL2";
	test:production "String";
	test:productionURI sparql:rString;
	test:rule "STRING_LITERAL2" .
:String-triple-singleQuote a test:DAWGfacet; test:order 32;
	rdfs:comment "?s ?p '''asdf'''";
    test:feature :CoreSPARQL;
	test:xpath "//String/STRING_LITERAL_LONG1";
	test:production "String";
	test:productionURI sparql:rString;
	test:rule "STRING_LITERAL_LONG1" .
:String-triple-doubleQuote a test:DAWGfacet; test:order 33;
	rdfs:comment "?s ?p \"\"\"asdf\"\"\"";
    test:feature :CoreSPARQL;
	test:xpath "//String/STRING_LITERAL_LONG2";
	test:production "String";
	test:productionURI sparql:rString;
	test:rule "STRING_LITERAL_LONG2" .
:RDFLiteral-plain a test:DAWGfacet; test:order 34;
	rdfs:comment "?s ?p 'chat'";
    test:feature :CoreSPARQL;
	test:xpath "//RDFLiteral[count(LANGTAG)=0]";
	test:production "GraphTerm"; # "RDFLiteral";
	test:productionURI sparql:rRDFLiteral;
	test:rule "RDFLiteral"; # "( LANGTAG | ( '^^' IRIref ) )?";
	test:regexp "[^@^]" . # "^$" . #"#"
:RDFLiteral-rLANGTAG a test:DAWGfacet; test:order 35;
	rdfs:comment "?s ?p 'chat'@fr-fr";
    test:feature :CoreSPARQL;
	test:xpath "//RDFLiteral[count(LANGTAG)=0]";
	test:production "GraphTerm"; # "RDFLiteral";
	test:productionURI sparql:rRDFLiteral;
	test:yaccProduction "RDFLiteral"; # "( LANGTAG | ( '^^' IRIref ) )?";
	test:regexp "@" .
#	test:rule "LANGTAG" .
:RDFLiteral-datatype a test:DAWGfacet; test:order 36;
	rdfs:comment "?s ?p '123'^^xsd:integer";
    test:feature :CoreSPARQL;
	test:xpath "//RDFLiteral/IRIref";
	test:production "GraphTerm"; # "RDFLiteral";
	test:productionURI sparql:rRDFLiteral;
	test:yaccProduction "RDFLiteral"; # "LANGTAG | '^^' IRIref";
	test:regexp "^^" .
#	test:rule "'^^' IRIref" .
:NumericLiteral-rINTEGER a test:DAWGfacet; test:order 37;
	rdfs:comment "?s ?p 5";
    test:feature :CoreSPARQL;
	test:xpath "//NumericLiteralUnsigned/INTEGER";
	test:production "NumericLiteral";
	test:productionURI sparql:rNumericLiteral;
	test:rule "INTEGER" .
:NumericLiteral-rDECIMAL a test:DAWGfacet; test:order 38;
	rdfs:comment "?s ?p 8.3";
    test:feature :CoreSPARQL;
	test:xpath "//NumericLiteralUnsigned/DECIMAL";
	test:production "NumericLiteral";
	test:productionURI sparql:rNumericLiteral;
	test:rule "DECIMAL" .
:NumericLiteral-rDOUBLE a test:DAWGfacet; test:order 39;
	rdfs:comment "?s ?p 8.3E0";
    test:feature :CoreSPARQL;
	test:xpath "//NumericLiteralUnsigned/DOUBLE";
	test:production "NumericLiteral";
	test:productionURI sparql:rNumericLiteral;
	test:rule "DOUBLE" .
:GraphTerm-plus a test:DAWGfacet; test:order 40;
	rdfs:comment "?s ?p +5";
    test:feature :CoreSPARQL;
	test:xpath "//NumericLiteralPositive";
	test:production "GraphTerm";
	test:productionURI sparql:rGraphTerm;
	test:yaccProduction "'-' | '+'";
	test:rule "'+'" .
:GraphTerm-minus a test:DAWGfacet; test:order 41;
	rdfs:comment "?s ?p -5";
    test:feature :CoreSPARQL;
	test:xpath "//NumericLiteralNegative";
	test:production "GraphTerm";
	test:productionURI sparql:rGraphTerm;
	test:yaccProduction "'-' | '+'";
	test:rule "'-'" .
:GraphTerm-BooleanLiteral-true a test:DAWGfacet; test:order 42;
	rdfs:comment "?s ?p true";
    test:feature :CoreSPARQL;
	test:xpath "//BooleanLiteral/yacker:implicit-terminal[translate(text(), 'TRUE', 'true')='true']";
	test:production "GraphTerm";	test:productionURI sparql:rGraphTerm;
	test:rule "BooleanLiteral";
	test:regexp "[Tt][Rr][Uu][Ee]" .
:GraphTerm-BooleanLiteral-false a test:DAWGfacet; test:order 43;
	rdfs:comment "?s ?p false";
    test:feature :CoreSPARQL;
	test:xpath "//BooleanLiteral/yacker:implicit-terminal[translate(text(), 'FALSE', 'false')='false']";
	test:production "GraphTerm";
	test:productionURI sparql:rGraphTerm;
	test:rule "BooleanLiteral";
	test:regexp "[Ff][Aa][Ll][Ss][Es]" .
:BlankNode-rBLANK_NODE_LABEL a test:DAWGfacet; test:order 44;
	rdfs:comment "... _:a ...";
    test:feature :CoreSPARQL;
	test:xpath "//BLANK_NODE_LABEL";
	test:production "BlankNode";
	test:productionURI sparql:rBlankNode;
	test:rule "BLANK_NODE_LABEL" .
:BlankNode-rANON a test:DAWGfacet; test:order 45;
	rdfs:comment "... [] ...";
    test:feature :CoreSPARQL;
	test:xpath "//ANON";
	test:production "BlankNode";
	test:productionURI sparql:rBlankNode;
	test:rule "ANON" .
:Collection-0 a test:DAWGfacet; test:order 46;
	rdfs:comment "?s ?p ()";
    test:feature :CoreSPARQL;
	test:xpath "//GraphTerm/NIL";
	test:production "Collection";
	test:productionURI sparql:rCollection;
	test:yaccProduction "GraphNode+";
	test:rule "GraphNode" .
:Collection-1 a test:DAWGfacet; test:order 47;
	rdfs:comment "?s ?p (1)";
    test:feature :CoreSPARQL;
	test:xpath "//Collection[count(GraphNode)=1]";
	test:production "Collection";
	test:productionURI sparql:rCollection;
	test:yaccProduction "GraphNode+";
	test:rule "GraphNode" .
:Collection-n a test:DAWGfacet; test:order 48;
	rdfs:comment "?s ?p (1 2)";
    test:feature :CoreSPARQL;
	test:xpath "//Collection[count(GraphNode)>1]";
	test:production "Collection";
	test:productionURI sparql:rCollection;
	test:yaccProduction "GraphNode+";
	test:rule "GraphNode+" .
:BlankNodePropertyList a test:DAWGfacet; test:order 49;
	rdfs:comment "[ ?p2 ?o2 ]";
    test:feature :CoreSPARQL;
	test:xpath "//BlankNodePropertyList";
	test:production "BlankNodePropertyList";
	test:productionURI sparql:rBlankNodePropertyList;
	test:rule "'['" . # "']'"
:Verb-a a test:DAWGfacet; test:order 50;
	rdfs:comment "?s a ?o";
    test:feature :CoreSPARQL;
	test:xpath "//Verb/yacker:implicit-terminal[text()='a']";
	test:production "Verb";
	test:productionURI sparql:rVerb;
	test:rule "a" .


# rConstraint -- FILTER expressions
# 	builtin functions
:BuiltInCall-str a test:DAWGfacet; test:order 51;
	rdfs:comment "FILTER STR(?x)";
    test:feature :Filters;
	test:xpath "//BuiltInCall/yacker:implicit-terminal[text()='STR']";
	test:production "BuiltInCall";
	test:productionURI sparql:rBuiltInCall;
	test:rule "'STR'" .
:BuiltInCall-lang a test:DAWGfacet; test:order 52;
	rdfs:comment "FILTER LANG(?x)";
    test:feature :Filters;
	test:xpath "//BuiltInCall/yacker:implicit-terminal[text()='LANG']";
	test:production "BuiltInCall";
	test:productionURI sparql:rBuiltInCall;
	test:rule "'LANG'" .
:BuiltInCall-langMatches a test:DAWGfacet; test:order 53;
	rdfs:comment "FILTER LANGMATCHES(?x)";
    test:feature :Filters;
	test:xpath "//BuiltInCall/yacker:implicit-terminal[text()='LANGMATCHES']";
	test:production "BuiltInCall";
	test:productionURI sparql:rBuiltInCall;
	test:rule "'LANGMATCHES'" .
:BuiltInCall-datatype a test:DAWGfacet; test:order 54;
	rdfs:comment "FILTER DATATYPE(?x)";
    test:feature :Filters;
	test:xpath "//BuiltInCall/yacker:implicit-terminal[text()='DATATYPE']";
	test:production "BuiltInCall";
	test:productionURI sparql:rBuiltInCall;
	test:rule "'DATATYPE'" .
:BuiltInCall-bound a test:DAWGfacet; test:order 55;
	rdfs:comment "FILTER BOUND(?x)";
    test:feature :Filters;
	test:xpath "//BuiltInCall/yacker:implicit-terminal[text()='BOUND']";
	test:production "BuiltInCall";
	test:productionURI sparql:rBuiltInCall;
	test:rule "'BOUND'" .
:BuiltInCall-sameTerm a test:DAWGfacet; test:order 56;
	rdfs:comment "FILTER SAMETERM(?x)";
    test:feature :Filters;
	test:xpath "//BuiltInCall/yacker:implicit-terminal[text()='sameTerm']";
	test:production "BuiltInCall";
	test:productionURI sparql:rBuiltInCall;
	test:rule "'SAMETERM'" .
:BuiltInCall-isIRI a test:DAWGfacet; test:order 57;
	rdfs:comment "FILTER ISIRI(?x)";
    test:feature :Filters;
	test:xpath "//BuiltInCall/yacker:implicit-terminal[text()='isIRI']";
	test:production "BuiltInCall";
	test:productionURI sparql:rBuiltInCall;
	test:rule "'ISIRI'" .
:BuiltInCall-isBlank a test:DAWGfacet; test:order 58;
	rdfs:comment "FILTER ISBLANK(?x)";
    test:feature :Filters;
	test:xpath "//BuiltInCall/yacker:implicit-terminal[text()='isBLANK']";
	test:production "BuiltInCall";
	test:productionURI sparql:rBuiltInCall;
	test:rule "'ISBLANK'" .
:BuiltInCall-isLiteral a test:DAWGfacet; test:order 59;
	rdfs:comment "FILTER ISLITERAL(?x)";
    test:feature :Filters;
	test:xpath "//BuiltInCall/yacker:implicit-terminal[text()='isLITERAL']";
	test:production "BuiltInCall";
	test:productionURI sparql:rBuiltInCall;
	test:rule "'ISLITERAL'" .
:RegexExpression a test:DAWGfacet; test:order 60;
	rdfs:comment "FILTER REGEX(?x, 'asdf')";
    test:feature :Filters;
	test:xpath "//RegexExpression[count(Expression)=2]";
	test:production "RegexExpression";
	test:productionURI sparql:rRegexExpression;
	test:rule "( ',' Expression )?";
	test:regexp "." .
:RegexExpression-flags a test:DAWGfacet; test:order 61;
	rdfs:comment "FILTER REGEX(?x, 'asdf', 'i')";
    test:feature :Filters;
	test:xpath "//RegexExpression[count(Expression)=3]";
	test:production "RegexExpression";
	test:productionURI sparql:rRegexExpression;
	test:rule "( ',' Expression )?";
	test:regexp "^$" . #"#"
:IRIrefOrFunction-iri a test:DAWGfacet; test:order 62;
	rdfs:comment "?x = <...>";
    test:feature :Filters;
	test:xpath "//IRIrefOrFunction";
	test:production "IRIrefOrFunction";
	test:productionURI sparql:rIRIrefOrFunction;
	test:rule "ArgList+";
	test:regexp "^$" . #"#"

# 	rFunctionCall
# :IRIrefOrFunction-func0 -- nothing in standard 
# :IRIrefOrFunction-func-parm-parm -- nothing in standard 
:IRIrefOrFunction-cast-str a test:lameDAWGfacet; test:order 63;
	rdfs:comment "xsd:string(?x)";
    test:feature :Filters;
	test:xpath "//IRIrefOrFunction[IRIref/PrefixedName/PNAME_LN[text()='xsd:string'] and ArgList]";
	test:production "IRIrefOrFunction";
	test:productionURI sparql:rIRIrefOrFunction;
	test:rule "ArgList+";
	test:regexp "DOUBLE_BACKSLASHbstringDOUBLE_BACKSLASHb" .
:IRIrefOrFunction-cast-flt a test:lameDAWGfacet; test:order 64;
	rdfs:comment "xsd:float(?x)";
    test:feature :Filters;
	test:xpath "//IRIrefOrFunction[IRIref/PrefixedName/PNAME_LN[text()='xsd:float'] and ArgList]";
	test:production "IRIrefOrFunction";
	test:productionURI sparql:rIRIrefOrFunction;
	test:rule "ArgList+";
	test:regexp "DOUBLE_BACKSLASHbfloatDOUBLE_BACKSLASHb" .
:IRIrefOrFunction-cast-dbl a test:lameDAWGfacet; test:order 65;
	rdfs:comment "xsd:double(?x)";
    test:feature :Filters;
	test:xpath "//IRIrefOrFunction[IRIref/PrefixedName/PNAME_LN[text()='xsd:double'] and ArgList]";
	test:production "IRIrefOrFunction";
	test:productionURI sparql:rIRIrefOrFunction;
	test:rule "ArgList+";
	test:regexp "DOUBLE_BACKSLASHbdoubleDOUBLE_BACKSLASHb" .
:IRIrefOrFunction-cast-dec a test:lameDAWGfacet; test:order 66;
	rdfs:comment "xsd:decimal(?x)";
    test:feature :Filters;
	test:xpath "//IRIrefOrFunction[IRIref/PrefixedName/PNAME_LN[text()='xsd:decimal'] and ArgList]";
	test:production "IRIrefOrFunction";
	test:productionURI sparql:rIRIrefOrFunction;
	test:rule "ArgList+";
	test:regexp "DOUBLE_BACKSLASHbdecimalDOUBLE_BACKSLASHb" .
:IRIrefOrFunction-cast-int a test:lameDAWGfacet; test:order 67;
	rdfs:comment "xsd:integer(?x)";
    test:feature :Filters;
	test:xpath "//IRIrefOrFunction[IRIref/PrefixedName/PNAME_LN[text()='xsd:integer'] and ArgList]";
	test:production "fIRIrefOrFunction";
	test:productionURI sparql:rIRIrefOrFunction;
	test:rule "ArgList+";
	test:regexp "DOUBLE_BACKSLASHbintegerDOUBLE_BACKSLASHb" .
:IRIrefOrFunction-cast-dT a test:lameDAWGfacet; test:order 68;
	rdfs:comment "xsd:datetime(?x)";
    test:feature :Filters;
	test:xpath "//IRIrefOrFunction[IRIref/PrefixedName/PNAME_LN[text()='xsd:dateTime'] and ArgList]";
	test:production "IRIrefOrFunction";
	test:productionURI sparql:rIRIrefOrFunction;
	test:rule "ArgList+";
	test:regexp "DOUBLE_BACKSLASHbdatetimeDOUBLE_BACKSLASHb" .
:IRIrefOrFunction-cast-bool a test:lameDAWGfacet; test:order 69;
	rdfs:comment "xsd:boolean(?x)";
    test:feature :Filters;
	test:xpath "//IRIrefOrFunction[IRIref/PrefixedName/PNAME_LN[text()='xsd:boolean'] and ArgList]";
	test:production "IRIrefOrFunction";
	test:productionURI sparql:rIRIrefOrFunction;
	test:rule "ArgList+";
	test:regexp "DOUBLE_BACKSLASHbbooleanDOUBLE_BACKSLASHb" .

# Expression
:ConditionalOrExpression-n a test:DAWGfacet; test:order 71;
	rdfs:comment "A || B";
    test:feature :Filters;
	test:xpath "//ConditionalOrExpression[count(ConditionalAndExpression)>1]";
	test:production "@@@";
	test:productionURI sparql:rConditionalOrExpression.
:ConditionalAndExpression-n a test:DAWGfacet; test:order 73;
	rdfs:comment "A && B";
    test:feature :Filters;
	test:xpath "//ConditionalAndExpression[count(ValueLogical)>1]";
	test:production "@@@";
	test:productionURI sparql:rConditionalAndExpression.

:RelationalExpression-eq a test:DAWGfacet; test:order 75;
	rdfs:comment "A = B";
    test:feature :Filters;
	test:xpath "//RelationalExpression/yacker:implicit-terminal[text()='EQUAL']";
	test:production "@@@";
	test:productionURI sparql:rRelationalExpression.
:RelationalExpression-ne a test:DAWGfacet; test:order 76;
	rdfs:comment "A != B";
    test:feature :Filters;
	test:xpath "//RelationalExpression/yacker:implicit-terminal[text()='NEQUAL']";
	test:production "@@@";
	test:productionURI sparql:rRelationalExpression.
:RelationalExpression-lt a test:DAWGfacet; test:order 77;
	rdfs:comment "A < B";
    test:feature :Filters;
	test:xpath "//RelationalExpression/yacker:implicit-terminal[text()='LT']";
	test:production "@@@";
	test:productionURI sparql:rRelationalExpression.
:RelationalExpression-gt a test:DAWGfacet; test:order 78;
	rdfs:comment "A > B";
    test:feature :Filters;
	test:xpath "//RelationalExpression/yacker:implicit-terminal[text()='GT']";
	test:production "@@@";
	test:productionURI sparql:rRelationalExpression.
:RelationalExpression-le a test:DAWGfacet; test:order 79;
	rdfs:comment "A <= B";
    test:feature :Filters;
	test:xpath "//RelationalExpression/yacker:implicit-terminal[text()='LE']";
	test:production "@@@";
	test:productionURI sparql:rRelationalExpression.
:RelationalExpression-ge a test:DAWGfacet; test:order 80;
	rdfs:comment "A >= B";
    test:feature :Filters;
	test:xpath "//RelationalExpression/yacker:implicit-terminal[text()='GE']";
	test:production "@@@";
	test:productionURI sparql:rRelationalExpression.

:AdditiveExpression-n a test:DAWGfacet; test:order 82;
	rdfs:comment "A + B";
    test:feature :Filters;
	test:xpath "//AdditiveExpression[count(MultiplicativeExpression)>1]";
	test:production "@@@";
	test:productionURI sparql:rAdditiveExpression.
:MultiplicativeExpression-n a test:DAWGfacet; test:order 84;
	rdfs:comment "A * B";
    test:feature :Filters;
	test:xpath "//MultiplicativeExpression[count(UnaryExpression)>1]";
	test:production "@@@";
	test:productionURI sparql:rMultiplicativeExpression.

:UnaryExpression-NOT a test:DAWGfacet; test:order 86;
	rdfs:comment "!A";
    test:feature :Filters;
	test:xpath "//UnaryExpression/yacker:implicit-terminal[text()='NOT']";
	test:production "@@@";
	test:productionURI sparql:rUnaryExpression.
:UnaryExpression-PLUS a test:DAWGfacet; test:order 87;
	rdfs:comment "+A";
    test:feature :Filters;
	test:xpath "//UnaryExpression//INTEGER_POSITIVE";
	test:production "@@@";
	test:productionURI sparql:rUnaryExpression.
:UnaryExpression-MINUS a test:DAWGfacet; test:order 88;
	rdfs:comment "-A";
    test:feature :Filters;
	test:xpath "//UnaryExpression//INTEGER_NEGATIVE";
	test:production "@@@";
	test:productionURI sparql:rUnaryExpression.

:PrimaryExpression-rBrackettedExpression a test:DAWGfacet; test:order 89;
	rdfs:comment "FILTER (... (...) ...)";
    test:feature :Filters;
	test:xpath "//PrimaryExpression/BrackettedExpression";
	test:production "@@@";
	test:productionURI sparql:rPrimaryExpression.
:PrimaryExpression-rBuiltInCall a test:DAWGfacet; test:order 90;
	rdfs:comment "FILTER (... STR(?x) ...)";
    test:feature :Filters;
	test:xpath "//PrimaryExpression/BuiltInCall";
	test:production "@@@";
	test:productionURI sparql:rPrimaryExpression.
:PrimaryExpression-IRIref a test:DAWGfacet; test:order 91;
	rdfs:comment "FILTER (... <x> ...)";
    test:feature :Filters;
	test:xpath "//PrimaryExpression/IRIrefOrFunction[IRIref and not(ArgList)]";
	test:production "@@@";
	test:productionURI sparql:rPrimaryExpression.
:PrimaryExpression-function a test:DAWGfacet; test:order 92;
	rdfs:comment "FILTER (... <x>(...) ...)";
    test:feature :Filters;
	test:xpath "//PrimaryExpression/IRIrefOrFunction[IRIref and ArgList]";
	test:production "@@@";
	test:productionURI sparql:rPrimaryExpression.
:PrimaryExpression-rRDFLiteral a test:DAWGfacet; test:order 93;
	rdfs:comment "FILTER (... 'asdf' ...)";
    test:feature :Filters;
	test:xpath "//PrimaryExpression/RDFLiteral";
	test:production "@@@";
	test:productionURI sparql:rPrimaryExpression.
:PrimaryExpression-rNumericLiteral a test:DAWGfacet; test:order 94;
	rdfs:comment "FILTER (... 123 ...)";
    test:feature :Filters;
	test:xpath "//PrimaryExpression/NumericLiteral";
	test:production "@@@";
	test:productionURI sparql:rPrimaryExpression.
:PrimaryExpression-rBooleanLiteral a test:DAWGfacet; test:order 95;
	rdfs:comment "FILTER (... true ...)";
    test:feature :Filters;
	test:xpath "//PrimaryExpression/BooleanLiteral";
	test:production "@@@";
	test:productionURI sparql:rPrimaryExpression.
:PrimaryExpression-rVar a test:DAWGfacet; test:order 96;
	rdfs:comment "FILTER (... ?x ...)";
    test:feature :Filters;
	test:xpath "//PrimaryExpression/Var";
	test:production "@@@";
	test:productionURI sparql:rPrimaryExpression.


# rOrderClause -- ORDER BY clauses
:OrderClause-1 a test:DAWGfacet; test:order 97;
	rdfs:comment "ORDER BY ?x";
    test:feature :SolutionSequence;
	test:xpath "//OrderClause[count(OrderCondition) = 1]";
	test:production "OrderClause";
	test:productionURI sparql:rOrderClause .
:OrderClause-n a test:DAWGfacet; test:order 98;
	rdfs:comment "ORDER BY ?x ?y";
    test:feature :SolutionSequence;
	test:xpath "//OrderClause[count(OrderCondition) > 1]";
	test:production "OrderClause";
	test:productionURI sparql:rOrderClause .
:OrderCondition-noSC a test:DAWGfacet; test:order 99;
	rdfs:comment "no ASC or DESC";
    test:feature :SolutionSequence;
	test:xpath "//OrderCondition[not(yacker:implicit-terminal)]";
	test:production "OrderCondition";
	test:productionURI sparql:rOrderCondition;
	test:yaccProduction "'ASC' | 'DESC'";
	test:rule "'ASC'" .
:OrderCondition-ASC a test:DAWGfacet; test:order 100;
	rdfs:comment "ORDER BY ASC ...";
    test:feature :SolutionSequence;
	test:xpath "//OrderCondition/yacker:implicit-terminal[text()='ASC']";
	test:production "OrderCondition";
	test:productionURI sparql:rOrderCondition;
	test:yaccProduction "'ASC' | 'DESC'";
	test:rule "'ASC'" .
:OrderCondition-DESC a test:DAWGfacet; test:order 101;
	rdfs:comment "ORDER BY DESC ...";
    test:feature :SolutionSequence;
	test:xpath "//OrderCondition/yacker:implicit-terminal[text()='ASC']";
	test:production "OrderCondition";
	test:productionURI sparql:rOrderCondition;
	test:yaccProduction "'ASC' | 'DESC'";
	test:rule "'DESC'" .
:OrderCondition-rBrackettedExpression a test:DAWGfacet; test:order 102;
	rdfs:comment "ORDER BY (?x+?y)";
    test:feature :SolutionSequence;
	test:xpath "//OrderCondition/Constraint/BrackettedExpression";
	test:production "OrderCondition";
	test:productionURI sparql:rOrderCondition;
	test:yaccProduction "( FunctionCall | BuiltInCall | Var | BrackettedExpression )";
	test:rule "BrackettedExpression" .
:OrderCondition-rBuiltInCall a test:DAWGfacet; test:order 103;
	rdfs:comment "ORDER BY STR(?x)";
    test:feature :SolutionSequence;
	test:xpath "//OrderCondition/Constraint/BuiltInCall";
	test:production "OrderCondition";
	test:productionURI sparql:rOrderCondition;
	test:yaccProduction "( FunctionCall | BuiltInCall | Var | BrackettedExpression )";
	test:rule "BuiltInCall" .
:OrderCondition-rFunctionCall a test:DAWGfacet; test:order 104;
	rdfs:comment "ORDER BY xsd:integer(?x)";
    test:feature :SolutionSequence;
	test:xpath "//OrderCondition/Constraint/FunctionCall";
	test:production "OrderCondition";
	test:productionURI sparql:rOrderCondition;
	test:yaccProduction "( FunctionCall | BuiltInCall | Var | BrackettedExpression )";
	test:rule "FunctionCall" .
:OrderCondition-rVar a test:DAWGfacet; test:order 105;
	rdfs:comment "ORDER BY ?x";
    test:feature :SolutionSequence;
	test:xpath "//OrderCondition/Var";
	test:production "OrderCondition";
	test:productionURI sparql:rOrderCondition;
	test:yaccProduction "( FunctionCall | BuiltInCall | Var | BrackettedExpression )";
	test:rule "Var" .


# rLimitOffsetClauses
:LimitOffsetClauses-limit a test:DAWGfacet; test:order 107;
	rdfs:comment "LIMIT 5";
    test:feature :SolutionSequence;
	test:xpath "//LimitOffsetClauses[LimitClause and not(OffsetClause)]";
	test:production "LimitOffsetClauses";
	test:productionURI sparql:rLimitOffsetClauses;
	test:yaccProduction "( LimitClause OffsetClause? | OffsetClause LimitClause? )";
	test:rule "LimitClause" .
:LimitOffsetClauses-limit-offset a test:DAWGfacet; test:order 108;
	rdfs:comment "LIMIT 5 OFFSET 3";
    test:feature :SolutionSequence;
	test:xpath "//LimitOffsetClauses[LimitClause and OffsetClause[position()=1]]";
	test:production "LimitOffsetClauses";
	test:productionURI sparql:rLimitOffsetClauses;
	test:yaccProduction "( LimitClause OffsetClause? | OffsetClause LimitClause? )";
	test:rule "OffsetClause?";
	test:regexp "^$" . #"#"
:LimitOffsetClauses-offset a test:DAWGfacet; test:order 109;
	rdfs:comment "OFFSET 3";
    test:feature :SolutionSequence;
	test:xpath "//LimitOffsetClauses[OffsetClause and not(LimitClause)]";
	test:production "LimitOffsetClauses";
	test:productionURI sparql:rLimitOffsetClauses;
	test:yaccProduction "( LimitClause OffsetClause? | OffsetClause LimitClause? )";
	test:rule "OffsetClause" .
:LimitOffsetClauses-offset-limit a test:DAWGfacet; test:order 110;
	rdfs:comment "OFFSET 3 LIMIT 5";
    test:feature :SolutionSequence;
	test:xpath "//LimitOffsetClauses[OffsetClause and LimitClause[position()=1]]";
	test:production "LimitOffsetClauses";
	test:productionURI sparql:rLimitOffsetClauses;
	test:yaccProduction "( LimitClause OffsetClause? | OffsetClause LimitClause? )";
	test:rule "LimitClause?";
	test:regexp "^$" . #"#"



# </SELECT>

# <ASK>
:AskQuery a test:DAWGfacet; test:order 111;
	rdfs:comment "ASK";
    test:feature :AskQueries;
	test:xpath "//AskQuery";
	test:production "AskQuery";
	test:productionURI sparql:rAskQuery;
	test:rule "'ASK'" .
:AskQuery-yes a test:xDAWGfacet; test:order 112;
	rdfs:comment " => TRUE";
    test:feature :AskQueries;
	test:xpath "//AskQuery";
	test:production "AskQuery";
	test:productionURI sparql:rAskQuery .
:AskQuery-no a test:xDAWGfacet; test:order 113;
	rdfs:comment " => FALSE";
    test:feature :AskQueries;
	test:xpath "//AskQuery";
	test:production "AskQuery";
	test:productionURI sparql:rAskQuery .

# </ASK>

# <DESCRIBE>
# :DescribeQuery -- nothing in standard
# </DESCRIBE>

# <CONSTRUCT>
:ConstructTriples a test:DAWGfacet; test:order 114;
	rdfs:comment "CONSTRUCT { :s :p ?o }";
    test:feature :ConstructQueries;
	test:xpath "//ConstructQuery";
	test:production "ConstructQuery";
	test:productionURI sparql:rConstructTriples;
	test:rule "'CONSTRUCT'" .
:ConstructTriples-bound a test:DAWGfacet; test:order 115;
	rdfs:comment "CONSTRUCT { :s :p ?known }";
    test:feature :ConstructQueries;
	test:xpath "//ConstructTriples";
	test:production "ConstructTriples";
	test:productionURI sparql:rConstructTriples .
:ConstructTriples-unbound a test:DAWGfacet; test:order 116;
	rdfs:comment "CONSTRUCT { :s :p ?unknown }";
    test:feature :ConstructQueries;
	test:xpath "//ConstructTriples";
	test:production "ConstructTriples";
	test:productionURI sparql:rConstructTriples .
# </CONSTRUCT>
