It has regular syntax, inspired by schema (lisp), making it easy to create and maintain builders and writers and to compose structures.
"()" and "[]" are interchangeable and used for visual effect. Expressions are
parsed and printed in prefix notation e.g. (+ 1 ?x)
.
RDF-star quoted triples are This mean "item.getNode"
The operations are grouped into:
parseTYPE
– parse a string to object of a specific kind.readTYPE
– Read a file and produce an object of a specific kind.write
– Write to a stream, defaultSystem.out
str
– Create human readable strings.
parse(...)
, which produces a Item
, is direct access to the syntax
parser. Builders take parser Item
and create the in-memory objects
(package org.apache.jena.sparql.sse.builders
) and writers output in-memory
objects to an IndentedWriter
(package
org.apache.jena.sparql.sse.writers
.
SSE
should not be considered part of the public, stable Jena APIs.
If you don't like lots of "()" and indentation, look away now.
Efficiency at scale is not a primary design goal, though the core parser is streaming and would scale.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PrefixMapping
static PrefixMapping
static PrefixMapping
static Item
parse
(InputStream in) Parse from an input stream and obtain an SSE item expressionstatic Item
parse
(InputStream in, PrefixMapping pmap) Parse from an input stream and obtain an SSE item expressionstatic Item
static Item
parse
(Reader reader, PrefixMapping pmap) The parser process.static Item
Parse a string and obtain an SSE item expressionstatic Item
parse
(String str, PrefixMapping pmap) Parse a string and obtain an SSE item expressionstatic BasicPattern
Parse a string and obtain a SPARQL algebra basic graph patternstatic BasicPattern
parseBGP
(String s, PrefixMapping pmap) Parse a string and obtain a SPARQL algebra basic graph pattern, given a prefix mappingstatic Binding
parseBinding
(String string) Build aBinding
static DatasetGraph
parseDatasetGraph
(String string) Parse a string, and obtain a DatasetGraphstatic DatasetGraph
parseDatasetGraph
(String string, PrefixMapping pmap) Parse a string, and obtain a graphstatic Expr
Parse a string to obtain a SPARQL expressionstatic Expr
parseExpr
(String s, PrefixMapping pmap) Parse a string to obtain a SPARQL expressionstatic ExprList
Parse a string to obtain a list of SPARQL expressionsstatic ExprList
parseExprList
(String s, PrefixMapping pmap) Parse a string to obtain a list of SPARQL expressionsstatic Graph
parseGraph
(String string) Parse a string, and obtain a graphstatic Graph
parseGraph
(String string, PrefixMapping pmap) Parse a string, and obtain a graphstatic Item
static Item
parseItem
(String str, PrefixMapping pmap) static Node
Parse a string to obtain a Node (see NodeFactory.parse()static Node
parseNode
(String str, PrefixMapping pmap) Parse a string to obtain a Nodestatic Op
Parse a string and obtain a SPARQL algebra opstatic Op
parseOp
(String s, PrefixMapping pmap) Parse a string and obtain a SPARQL algebra op, given a prefix mappingstatic Path
Parse a string to obtain a pathstatic Path
parsePath
(String str, PrefixMapping pmap) Parse a string to obtain a pathstatic Quad
Parse a string to obtain a Quadstatic Quad
parseQuad
(String s, PrefixMapping pmap) Parse a string to obtain a Quadstatic Item
Parse a string and obtain an SSE item expression (no additional prefix mappings)static ResultSet
parseResultSet
(String string) Deprecated.static RowSet
parseRowSet
(String string) Build aRowSet
static Table
parseTable
(String s) Parse a string and obtain a SPARQL algebra tablestatic Table
parseTable
(String s, PrefixMapping pmap) Parse a string and obtain a SPARQL algebra tablestatic Triple
parseTriple
(String str) Parse a string to obtain a Triplestatic Triple
parseTriple
(String str, PrefixMapping pmap) Parse a string to obtain a Triplestatic BasicPattern
Read in a file, parse, and obtain a SPARQL algebra basic graph patternstatic DatasetGraph
readDatasetGraph
(String filename) Read in a file, parse, and obtain a graphstatic DatasetGraph
readDatasetGraph
(String filename, PrefixMapping pmap) Read in a file, parse, and obtain a DatasetGraphstatic void
readDatasetGraph
(DatasetGraph dsg, String filename) Read in a file, parse, load a DatasetGraphstatic void
readDatasetGraph
(DatasetGraph dsg, String filename, PrefixMapping pmap) Read in a file, parse, load a DatasetGraphstatic Item
Read a file and obtain an SSE item expressionstatic Item
readFile
(String filename, PrefixMapping pmap) Read a file and obtain an SSE item expressionstatic Graph
Read in a file, parse, and obtain a graphstatic Graph
readGraph
(String filename, PrefixMapping pmap) Read in a file, parse, and obtain a graphstatic void
Read in a file, parse, and obtain a graphstatic void
readGraph
(Graph graph, String filename, PrefixMapping pmap) Read in a file, parse, and obtain a graphstatic Op
Read in a file, parse, and obtain a SPARQL algebra opstatic Table
Read a file and obtain a SPARQL algebra tablestatic Table
readTable
(String filename, PrefixMapping pmap) Read a file and obtain a SPARQL algebra tablestatic SerializationContext
Return a SerializationContext appropriate for the graphstatic SerializationContext
sCxt
(PrefixMapping pmap) Return a SerializationContext appropriate for the prefix mappingstatic void
static void
static void
static void
setUseResolver
(boolean flag) static String
static String
str
(Graph graph, PrefixMapping pmap) static String
static String
str
(Node node, PrefixMapping pmap) static String
static String
str
(Triple triple, PrefixMapping pmap) static String
static String
str
(Op op, PrefixMapping pmap) static String
str
(BasicPattern bgp) static String
str
(BasicPattern bgp, PrefixMapping pmap) static String
str
(DatasetGraph dsg) static String
str
(DatasetGraph dsg, PrefixMapping pmap) static String
static String
str
(Quad quad, PrefixMapping pmap) static String
static String
str
(Expr expr, PrefixMapping pmap) static String
Plain - with (), not (triple ...)static String
strPlain
(Triple triple, PrefixMapping pmap) Plain - with (), not (triple ...)static String
Plain - with (), not (quad ...)static String
strPlain
(Quad quad, PrefixMapping pmap) Plain - with (), not (quad ...)static void
write
(OutputStream out, Graph graph) static void
write
(OutputStream out, Node node) static void
write
(OutputStream out, Triple triple) static void
write
(OutputStream out, Dataset dataset) static void
write
(OutputStream out, Model model) static void
write
(OutputStream out, Op op) static void
write
(OutputStream out, DatasetGraph dataset) static void
write
(OutputStream out, Quad quad) static void
static void
static void
static void
static void
static void
static void
write
(org.apache.jena.atlas.io.IndentedWriter out, BasicPattern pattern) static void
write
(org.apache.jena.atlas.io.IndentedWriter out, BasicPattern pattern, PrefixMapping pMap) static void
write
(org.apache.jena.atlas.io.IndentedWriter out, DatasetGraph dataset) static void
static void
static void
static void
static void
static void
static void
static void
write
(BasicPattern pattern) static void
write
(DatasetGraph dataset) static void
-
Method Details
-
getPrefixMapRead
-
getPrefixMapString
-
getPrefixMapWrite
-
parseNode
Parse a string to obtain a Node (see NodeFactory.parse() -
parseQuad
Parse a string to obtain a Quad -
parseTriple
Parse a string to obtain a Triple -
parsePath
Parse a string to obtain a path -
parseExpr
Parse a string to obtain a SPARQL expression -
parseExprList
Parse a string to obtain a list of SPARQL expressions -
parseGraph
Parse a string, and obtain a graph -
readGraph
Read in a file, parse, and obtain a graph -
readGraph
Read in a file, parse, and obtain a graph -
parseDatasetGraph
Parse a string, and obtain a DatasetGraph -
readDatasetGraph
Read in a file, parse, and obtain a graph -
readDatasetGraph
Read in a file, parse, load a DatasetGraph -
parseBinding
Build aBinding
-
parseRowSet
Build aRowSet
-
parseResultSet
Deprecated.Build aResultSet
-
readOp
Read in a file, parse, and obtain a SPARQL algebra op -
parseOp
Parse a string and obtain a SPARQL algebra op -
readBGP
Read in a file, parse, and obtain a SPARQL algebra basic graph pattern -
parseBGP
Parse a string and obtain a SPARQL algebra basic graph pattern -
readTable
Read a file and obtain a SPARQL algebra table -
parseTable
Parse a string and obtain a SPARQL algebra table -
readFile
Read a file and obtain an SSE item expression -
parseRaw
Parse a string and obtain an SSE item expression (no additional prefix mappings) -
parse
Parse a string and obtain an SSE item expression -
parse
Parse from an input stream and obtain an SSE item expression -
setUseResolver
public static void setUseResolver(boolean flag) -
parseItem
-
parse
-
str
-
str
-
strPlain
Plain - with (), not (triple ...) -
str
-
strPlain
Plain - with (), not (quad ...) -
str
-
str
-
str
-
str
-
str
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
sCxt
Return a SerializationContext appropriate for the graph
-
parseRowSet(java.lang.String)