# name TABs path (intepreted as if it were in perl ""s) TABs example # IRI IRI subject //triples/subject//IRIREF . . IRI predicate //triples//predicate//IRIREF . . IRI object //triples//object//IRIREF . . IRI with four digit numeric escape (\u) //IRIREF[contains(text(), '\\u')] . . IRI with eight digit numeric escape (\U) //IRIREF[contains(text(), '\\U')] . . IRI with all punctuation //IRIREF[contains(text(), '!') and contains(text(), '$') and contains(text(), '%') and contains(text(), '&') and contains(text(), \"'\") and contains(text(), '(') and contains(text(), ')') and contains(text(), '*') and contains(text(), '+') and contains(text(), ',') and contains(text(), '-') and contains(text(), '@') and contains(text(), '~') and contains(text(), '?')] . . bareword a predicate //RDF_TYPE a . . # Prefix old-style prefix //prefixID @prefix p: .\np:s . . SPARQL-style prefix //sparqlPrefix PREFIX p: \np:s . . no prefix /turtleDoc[not(statement/directive/prefixID) and not(statement/directive/sparqlPrefix)] . . prefixed IRI subject //triples/subject//PrefixedName @prefix p: .\np:s . . prefixed IRI predicate //triples//predicate//PrefixedName @prefix p: .\n p:p . . prefixed IRI object //triples//object//PrefixedName @prefix p: .\n p:o . . prefix-only IRI (p:) //triples//PrefixedName/PNAME_NS @prefix p: .\np: . . default namespace IRI (:ln) //triples//PrefixedName/PNAME_LN[substring-after(text(), ':')] @prefix : .\n:s . . prefix and localname IRI (p:ln) //triples//PrefixedName/PNAME_LN[substring-before(text(), ':')] @prefix p: .\np:s . . prefix reassigned and used //statement[//PNAME_NS/text() = following-sibling::statement//PNAME_NS/text() and contains(following-sibling::statement/triples//PNAME_LN/text(), //PNAME_NS/text())] @prefix p: .\n@prefix p: .\np:s . . reserved-escaped local name //triples//PNAME_LN[contains(text(), '\\')] @prefix p: .\np:\\%00 . . percent-escaped local name //triples//PNAME_LN[contains(text(), '%')] @prefix p: .\np:%25 . . HYPHEN-MINUS in local name //triples//PNAME_LN[contains(text(), '-')] @prefix p: .\np:s- . . underscore in local name //triples//PNAME_LN[contains(text(), '_')] @prefix p: .\np:s_ . . localname with COLON //triples//PNAME_LN[contains(substring(text(), 2, string-length(text())-1), ':')] @prefix p: .\np:s: . . # Base old-style base //base @base .\n . . SPARQL-style base //sparqlBase BASE \n . . no base /turtleDoc[not(statement/directive/base) and not(statement/directive/sparqlBase)] . . # blank node labeled blank node subject //triples/subject//BLANK_NODE_LABEL _:s . _:b1 . labeled blank node object //triples//object//BLANK_NODE_LABEL _:o . _:b1 . anonymous blank node subject //triples/subject//ANON [] . _:b1 . anonymous blank node object //triples//object//ANON [] . _:b1 . sole blankNodePropertyList [

] . //blankNodePropertyList[not(following-sibling::*[1])] [ ] . _:b1 . blankNodePropertyList as subject [ … ]

. //blankNodePropertyList[following-sibling::*[1]] [ ] . _:b1 .\n_:b1 . blankNodePropertyList as object

[ … ] . //triples//object/blankNodePropertyList [ ] . _:b1 .\n_:b1 . blankNodePropertyList with sole triple [

] //triples/blankNodePropertyList/predicateObjectList[verb[1] and not(verb[2])] [ ] . _:b1 . blankNodePropertyList with multiple triples [

; ] //triples/blankNodePropertyList/predicateObjectList[verb[2]] [ ; ] . _:b1 .\n_:b1 \n._:b1 . nested blankNodePropertyLists [ [ ] ; ] //triples/blankNodePropertyList/predicateObjectList/objectList[object/blankNodePropertyList and following-sibling::verb] [ [ ] ; ]. _:b1 _:b2 .\n_:b2 .\n_:b1 . blankNodePropertyList containing collection [ ( … ) ] //triples/blankNodePropertyList//collection [ (1) ] . _:b1 _:el1 .\n_:el1 \"1\"^^ .\n_:el1 . # collection collection subject //triples/subject/collection (1) . _:el1 \"1\"^^ .\n_:el1 .\n_:el1 . collection object //triples//object/collection (1) . _:el1 .\n_:el1 \"1\"^^ .\n_:el1 . empty collection () //triples//collection[not(object)] () . . non-empty collection (1) //triples//collection[object] (1) . _:el1 .\n_:el1 \"1\"^^ .\n_:el1 . nested collection (()) //triples//collection//collection ((1)) . _:outerEl1 .\n_:outerEl1 _:innerEl1 .\n_:innerEl1 \"1\"^^ .\n_:innerEl1 .\n_:outerEl1 . first, not last, non-empty nested collection //triples//collection[object[1]/collection//object and not(object[last()]/collection)] ((1) 2) . _:outerEl1 .\n_:outerEl1 _:innerEl1 .\n_:innerEl1 \"1\"^^ .\n_:innerEl1 .\n_:outerEl1 _:outerEl2 .\n_:outerEl2 \"2\"^^ .\n_:outerEl2 . last, not first, non-empty nested collection //triples//collection[not(object[1]/collection//object) and object[last()]/collection//object] (1 (2)) . _:outerEl1 .\n_:outerEl1 \"1\"^^ .\n_:outerEl1 _:outerEl2 .\n_:outerEl2 _:innerEl1 .\n_:innerEl1 \"2\"^^ .\n_:innerEl1 .\n_:outerEl2 . # literal LITERAL1 'x' //triples//STRING_LITERAL1 'x' . \"x\" . LITERAL_LONG1 '''x''' //triples//STRING_LITERAL_LONG1 '''x''' . \"x\" . LITERAL_LONG1 with 1 squote '''a'b''' //triples//STRING_LITERAL_LONG1[contains(substring(text(), 4, string-length(text())-6), \"'\")] '''x'y''' . \"x'y\" . LITERAL_LONG1 with 2 squotes '''a''b''' //triples//STRING_LITERAL_LONG1[contains(substring(text(), 4, string-length(text())-6), \"''\")] '''x''y''' . \"x''y\" . LITERAL2 "x" //triples//STRING_LITERAL2 \"x\" . \"x\" . LITERAL_LONG2 """x""" //triples//STRING_LITERAL_LONG2 \"\"\"x\"\"\" . \"x\" . LITERAL_LONG2 with 1 squote """a"b""" //triples//STRING_LITERAL_LONG2[contains(substring(text(), 4, string-length(text())-6), '\"')] \"\"\"x\"y\"\"\" . \"x\\\"y\" . LITERAL_LONG2 with 2 squotes """a""b""" //triples//STRING_LITERAL_LONG2[contains(substring(text(), 4, string-length(text())-6), '\"\"')] \"\"\"x\"\"y\"\"\" . \"x\\\"\\\"y\" . # ECHAR: tbnrf\"' literal with CHARACTER TABULATION //String/*[contains(text(), '回09')] '\t' . \"\\t\" . literal with BACKSPACE //String/*[contains(text(), '回08')] '\b' . \"\\u0008\" . literal with LINE FEED //String/*[contains(text(), '\n')] '''\n''' . \"\\n\" . literal with CARRIAGE RETURN //String/*[contains(text(), '回0d')] '''\r''' . \"\\r\" . literal with FORM FEED //String/*[contains(text(), '回0c')] '\f' . \"\\u000C\" . literal with REVERSE SOLIDUS //String/*[contains(text(), '\\')] '\\\\' . \"\\\\\" . literal with escaped CHARACTER TABULATION //String/*[contains(text(), '\\t')] '\\t' . \"\\t\" . literal with escaped BACKSPACE //String/*[contains(text(), '\\b')] '\\b' . \"\\u0008\" . literal with escaped LINE FEED //String/*[contains(text(), '\\n')] '\\n' . \"\\n\" . literal with escaped CARRIAGE RETURN //String/*[contains(text(), '\\r')] '\\r' . \"\\r\" . literal with escaped FORM FEED //String/*[contains(text(), '\\f')] '\\f' . \"\\u000C\" . literal with escaped REVERSE SOLIDUS //String/*[contains(text(), '\\\\')] '\\\\' . \"\\\\\" . # UCHAR: \uxxxx \Uxxxxxxxx literal with numeric escape4 \u //String/*[contains(text(), '\\u')] '\\u006F' . \"o\" . literal with numeric escape8 \U //String/*[contains(text(), '\\U')] '\\U0000006F' . \"o\" . # datatypes IRIREF datatype ""^^ //RDFLiteral/iri/IRIREF \"1\"^^ . \"1\"^^ . prefixed name datatype ""^^p:t //RDFLiteral/iri/PrefixedName @prefix xsd: .\n \"1\"^^xsd:integer . \"1\"^^ . # bareword literals bareword integer //triples//INTEGER 1 . \"1\"^^ . bareword decimal //triples//DECIMAL 1.0 . \"1.0\"^^ . bareword double //triples//DOUBLE 1E0 . \"1E0\"^^ . double upper case E //triples//DOUBLE[contains(text(), 'E')] 1E0 . \"1E0\"^^ . double lower case e //triples//DOUBLE[contains(text(), 'e')] 1e0 . \"1e0\"^^ . negative numeric //triples//NumericLiteral/*[contains(text(), '-')] -1 . \"-1\"^^ . positive numeric //triples//NumericLiteral/*[contains(text(), '+')] +1 . \"+1\"^^ . numeric with leading 0 //triples//NumericLiteral/*[substring(text(), 1, 1)='0'] 01 . \"01\"^^ . literal true //triples//BooleanLiteral/*[text()='true'] true . \"true\"^^ . literal false //triples//BooleanLiteral/*[text()='false'] false . \"false\"^^ . # language tag langtagged non-LONG "x"@en //RDFLiteral[String/*[not(contains(name(), 'LONG'))] and LANGTAG] \"chat\"@en . \"chat\"@en . langtagged LONG """x"""@en //RDFLiteral[String/*[contains(name(), 'LONG')] and LANGTAG] \"\"\"chat\"\"\"@en . \"chat\"@en . lantag with subtag "x"@en-us //RDFLiteral/LANGTAG[contains(text(), '-')] \"chat\"@en-us . \"chat\"@en-us . # comma and semicolon structures objectList with two objects … , //predicateObjectList[objectList/object[2]] , . .\n . predicateObjectList with two objectLists … , //predicateObjectList[objectList[2]] ; . .\n . repeated semis at end

;; . //predicateObjectList//implicit-terminal[text()=\"SEMI\" and following-sibling::*[1][text()=\"SEMI\" and following-sibling::verb]] ;; . .\n . repeated semis not at end

;;. //predicateObjectList//implicit-terminal[text()=\"SEMI\" and following-sibling::*[1][text()=\"SEMI\" and not(following-sibling::verb)]] ;; . . # junk #predicateObjectList, exactly two objectLists //predicateObjectList[objectList[2] and not(objectList[3])]