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 org.apache.jena.shared.PrefixMapping
static org.apache.jena.shared.PrefixMapping
static org.apache.jena.shared.PrefixMapping
static Item
parse
(InputStream in) Parse from an input stream and obtain an SSE item expressionstatic Item
parse
(InputStream in, org.apache.jena.shared.PrefixMapping pmap) Parse from an input stream and obtain an SSE item expressionstatic Item
static Item
The parser process.static Item
Parse a string and obtain an SSE item expressionstatic Item
Parse a string and obtain an SSE item expressionstatic BasicPattern
Parse a string and obtain a SPARQL algebra basic graph patternstatic BasicPattern
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, org.apache.jena.shared.PrefixMapping pmap) Parse a string, and obtain a graphstatic Expr
Parse a string to obtain a SPARQL expressionstatic Expr
Parse a string to obtain a SPARQL expressionstatic ExprList
Parse a string to obtain a list of SPARQL expressionsstatic ExprList
parseExprList
(String s, org.apache.jena.shared.PrefixMapping pmap) Parse a string to obtain a list of SPARQL expressionsstatic org.apache.jena.graph.Graph
parseGraph
(String string) Parse a string, and obtain a graphstatic org.apache.jena.graph.Graph
parseGraph
(String string, org.apache.jena.shared.PrefixMapping pmap) Parse a string, and obtain a graphstatic Item
static Item
static org.apache.jena.graph.Node
Parse a string to obtain a Node (see NodeFactory.parse()static org.apache.jena.graph.Node
Parse a string to obtain a Nodestatic Op
Parse a string and obtain a SPARQL algebra opstatic Op
Parse a string and obtain a SPARQL algebra op, given a prefix mappingstatic Path
Parse a string to obtain a pathstatic Path
Parse a string to obtain a pathstatic Quad
Parse a string to obtain a Quadstatic Quad
Parse a string to obtain a Quadstatic Item
Parse a string and obtain an SSE item expression (no additional prefix mappings)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, org.apache.jena.shared.PrefixMapping pmap) Parse a string and obtain a SPARQL algebra tablestatic org.apache.jena.graph.Triple
parseTriple
(String str) Parse a string to obtain a Triplestatic org.apache.jena.graph.Triple
parseTriple
(String str, org.apache.jena.shared.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, org.apache.jena.shared.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, org.apache.jena.shared.PrefixMapping pmap) Read in a file, parse, load a DatasetGraphstatic Item
Read a file and obtain an SSE item expressionstatic Item
Read a file and obtain an SSE item expressionstatic org.apache.jena.graph.Graph
Read in a file, parse, and obtain a graphstatic org.apache.jena.graph.Graph
Read in a file, parse, and obtain a graphstatic void
Read in a file, parse, and obtain a graphstatic void
readGraph
(org.apache.jena.graph.Graph graph, String filename, org.apache.jena.shared.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
Read a file and obtain a SPARQL algebra tablestatic SerializationContext
sCxt
(org.apache.jena.graph.Graph graph) Return a SerializationContext appropriate for the graphstatic SerializationContext
sCxt
(org.apache.jena.shared.PrefixMapping pmap) Return a SerializationContext appropriate for the prefix mappingstatic void
setPrefixMapRead
(org.apache.jena.shared.PrefixMapping pmap) static void
setPrefixMapString
(org.apache.jena.shared.PrefixMapping pmap) static void
setPrefixMapWrite
(org.apache.jena.shared.PrefixMapping pmap) static void
setUseResolver
(boolean flag) static String
str
(org.apache.jena.graph.Graph graph) static String
str
(org.apache.jena.graph.Graph graph, org.apache.jena.shared.PrefixMapping pmap) static String
str
(org.apache.jena.graph.Node node) static String
str
(org.apache.jena.graph.Node node, org.apache.jena.shared.PrefixMapping pmap) static String
str
(org.apache.jena.graph.Triple triple) static String
str
(org.apache.jena.graph.Triple triple, org.apache.jena.shared.PrefixMapping pmap) static String
static String
static String
str
(BasicPattern bgp) static String
str
(BasicPattern bgp, org.apache.jena.shared.PrefixMapping pmap) static String
str
(DatasetGraph dsg) static String
str
(DatasetGraph dsg, org.apache.jena.shared.PrefixMapping pmap) static String
static String
static String
static String
static String
strPlain
(org.apache.jena.graph.Triple triple) Plain - with (), not (triple ...)static String
strPlain
(org.apache.jena.graph.Triple triple, org.apache.jena.shared.PrefixMapping pmap) Plain - with (), not (triple ...)static String
Plain - with (), not (quad ...)static String
Plain - with (), not (quad ...)static void
write
(OutputStream out, org.apache.jena.graph.Graph graph) static void
write
(OutputStream out, org.apache.jena.graph.Node node) static void
write
(OutputStream out, org.apache.jena.graph.Triple triple) static void
write
(OutputStream out, Dataset dataset) static void
write
(OutputStream out, org.apache.jena.rdf.model.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
write
(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.graph.Graph graph) static void
write
(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.graph.Node node) static void
write
(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.graph.Triple triple) static void
static void
write
(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.rdf.model.Model model) 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, org.apache.jena.shared.PrefixMapping pMap) static void
write
(org.apache.jena.atlas.io.IndentedWriter out, DatasetGraph dataset) static void
static void
write
(org.apache.jena.graph.Graph graph) static void
write
(org.apache.jena.graph.Node node) static void
write
(org.apache.jena.graph.Triple triple) static void
static void
write
(org.apache.jena.rdf.model.Model model) static void
static void
write
(BasicPattern pattern) static void
write
(DatasetGraph dataset) static void
-
Method Details
-
getPrefixMapRead
public static org.apache.jena.shared.PrefixMapping getPrefixMapRead() -
getPrefixMapString
public static org.apache.jena.shared.PrefixMapping getPrefixMapString() -
getPrefixMapWrite
public static org.apache.jena.shared.PrefixMapping 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
-
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
public static void write(org.apache.jena.graph.Graph graph) -
write
-
write
public static void write(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.graph.Graph graph) -
write
public static void write(org.apache.jena.rdf.model.Model model) -
write
-
write
public static void write(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.rdf.model.Model model) -
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
-
write
public static void write(org.apache.jena.graph.Triple triple) -
write
-
write
public static void write(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.graph.Triple triple) -
write
-
write
-
write
-
write
public static void write(org.apache.jena.graph.Node node) -
write
-
write
public static void write(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.graph.Node node) -
sCxt
Return a SerializationContext appropriate for the graph
-