rdflib library

Classes

BNode
Represents a blank node in an RDF graph.
EvaluatorDefinition
This class focuses on interpreting and formatting the raw parsed data into a more structured and meaningful format.
ExpressionDefinition
An implementation of a parser using a grammar definition framework, presumably for parsing structured text formats like Turtle or SPARQL.
FOAF
Friend of a Friend (FOAF) RDF vocabulary, described using W3C RDF Schema and the Web Ontology Language.
Graph
Literal
Namespace
OWL
OWL vocabulary
RDF
RDF Schema for the RDF vocabulary terms in the RDF Namespace, defined in RDF 1.1 Concepts.
RDFS
RDFS Schema
Triple
URIRef
XSD
W3C XML Schema Definition Language (XSD) 1.1

Constants

turtleGrammar → const String
RDF doc for complete turtle grammar can be found at https://www.w3.org/TR/turtle/#sec-grammar-grammar

Properties

a URIRef
This constant a is a shorthand predicate for rdf:type.
final
ANON → Parser<List>
162s ANON ::= '' WS* ''
final
base → Parser<List>
5 base ::= '@base' IRIREF '.'
final
BLANK_NODE_LABEL → Parser<List>
141s BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | 0-9) ((PN_CHARS | '.')* PN_CHARS)?
final
BlankNode → ChoiceParser
137s BlankNode ::= BLANK_NODE_LABEL | ANON
final
blankNodePropertyList → Parser
final
BooleanLiteral → ChoiceParser
133s BooleanLiteral ::= 'true' | 'false'
final
collection → Parser
final
DECIMAL → Parser<List>
20 DECIMAL ::= +-? 0-9* '.' 0-9+
final
directive → ChoiceParser
3 directive ::= prefixID | base | sparqlPrefix | sparqlBase
final
DOUBLE → Parser<List>
21 DOUBLE ::= +-? (0-9+ '.' 0-9* EXPONENT | '.' 0-9+ EXPONENT | 0-9+ EXPONENT)
final
ECHAR → Parser<List>
159s ECHAR ::= '' [tbnrf"']
final
EXPONENT → Parser<List>
154s EXPONENT ::= eE +-? 0-9+
final
HEX → ChoiceParser
171s HEX ::= 0-9 | A-F | a-f
final
INTEGER → Parser<List>
19 INTEGER ::= +-? 0-9+
final
iri → ChoiceParser
135s iri ::= IRIREF | PrefixedName
final
IRIREF → Parser<List>
18 IRIREF ::= '<' ([^#x00-#x20<>"{}|^`] | UCHAR)* '>' /* #x00=NULL #01-#x1F=control codes #x20=space */
final
LANGTAG → Parser<List>
144s LANGTAG ::= '@' a-zA-Z+ ('-' a-zA-Z0-9+)*
final
literal → ChoiceParser
13 literal ::= RDFLiteral | NumericLiteral | BooleanLiteral
final
logger ↔ Logger
getter/setter pair
nonSpecialChar → Parser<String>
extra non special chars
final
NumericalLiteral → ChoiceParser
16 NumericLiteral ::= INTEGER | DECIMAL | DOUBLE
final
objColMap Map<String, Parser>
final
object → Parser
final
objectList → Parser
final
PERCENT → Parser<List>
170s PERCENT ::= '%' HEX HEX
final
PLX → ChoiceParser
169s PLX ::= PERCENT | PN_LOCAL_ESC
final
PN_CHARS → ChoiceParser
166s PN_CHARS ::= PN_CHARS_U | '-' | 0-9 | #x00B7 | #x0300-#x036F | #x203F-#x2040
final
PN_CHARS_BASE → Parser<String>
163s PN_CHARS_BASE ::= A-Z | a-z | #x00C0-#x00D6 | #x00D8-#x00F6 | #x00F8-#x02FF | #x0370-#x037D | #x037F-#x1FFF | #x200C-#x200D | #x2070-#x218F | #x2C00-#x2FEF | #x3001-#xD7FF | #xF900-#xFDCF | #xFDF0-#xFFFD | #x10000-#xEFFFF
final
PN_CHARS_U → ChoiceParser
164s PN_CHARS_U ::= PN_CHARS_BASE | '_'
final
PN_LOCAL → Parser<List>
168s PN_LOCAL ::= (PN_CHARS_U | ':' | 0-9 | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))?
final
PN_LOCAL_ESC → Parser<List>
172s PN_LOCAL_ESC ::= '' ('_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%') put '-' at last to avoid 'Invalid range' error
final
PN_PREFIX → Parser<List>
167s PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)?
final
PNAME_LN → Parser<List>
140s PNAME_LN ::= PNAME_NS PN_LOCAL
final
PNAME_NS → Parser<List>
139s PNAME_NS ::= PN_PREFIX? ':'
final
predicate → ChoiceParser
11 predicate ::= iri
final
predicateObjectList → Parser
final
PrefixedName → ChoiceParser
136s PrefixedName ::= PNAME_LN | PNAME_NS
final
prefixID → Parser<List>
4 prefixID ::= '@prefix' PNAME_NS IRIREF '.'
final
RDFLiteral → Parser<List>
128s RDFLiteral ::= STRING (LANGTAG | '^^' iri)?
final
sparqlBase → Parser<List>
5s sparqlBase ::= "BASE" IRIREF
final
sparqlPrefix → Parser<List>
6s sparqlPrefix ::= "PREFIX" PNAME_NS IRIREF
final
standardPrefixes Map<String, String>
Includes standard prefixes for namespace checking and shortening to export to other formats.
final
statement → ChoiceParser
2 statement ::= directive | triples '.'
final
STRING → ChoiceParser
17 STRING ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE | STRING_LITERAL_LONG_SINGLE_QUOTE | STRING_LITERAL_LONG_QUOTE
final
STRING_LITERAL_LONG_QUOTE → Parser<List>
25 STRING_LITERAL_LONG_QUOTE ::= '"""' (('"' | '""')? ([^"] | ECHAR | UCHAR))* '"""'
final
STRING_LITERAL_LONG_SINGLE_QUOTE → Parser<List>
24 STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" (("'" | "''")? ([^'] | ECHAR | UCHAR))* "'''"
final
STRING_LITERAL_QUOTE → Parser<List>
22 STRING_LITERAL_QUOTE ::= '"' (^#x22#x5C#xA#xD | ECHAR | UCHAR)* '"' /* #x22=" #x5C=\ #xA=new line #xD=carriage return */
final
STRING_LITERAL_SINGLE_QUOTE → Parser<List>
23 STRING_LITERAL_SINGLE_QUOTE ::= "'" (^#x27#x5C#xA#xD | ECHAR | UCHAR)* "'" /* #x27=' #x5C=\ #xA=new line #xD=carriage return */
final
subject → ChoiceParser
10 subject ::= iri | BlankNode | collection
final
triples → ChoiceParser
6 triples ::= subject predicateObjectList | blankNodePropertyList predicateObjectList?
final
turtleDoc → Parser<List>
1 turtleDoc ::= statement*
final
UCHAR → ChoiceParser
26 UCHAR ::= '\u' HEX HEX HEX HEX | '\U' HEX HEX HEX HEX HEX HEX HEX HEX
final
verb → ChoiceParser
9 verb ::= predicate | 'a'
final
WS → Parser<String>
161s WS ::= #x20 | #x9 | #xD | #xA /* #x20=space #x9=character tabulation #xD=carriage return #xA=new line */
final

Functions

flattenList(List list) List
genObjCol() Map<String, Parser>
Helper function to generate inter-dependent parsers.