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.outstr– 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.PrefixMappingstatic org.apache.jena.shared.PrefixMappingstatic org.apache.jena.shared.PrefixMappingstatic Itemparse(InputStream in) Parse from an input stream and obtain an SSE item expressionstatic Itemparse(InputStream in, org.apache.jena.shared.PrefixMapping pmap) Parse from an input stream and obtain an SSE item expressionstatic Itemstatic ItemThe parser process.static ItemParse a string and obtain an SSE item expressionstatic ItemParse a string and obtain an SSE item expressionstatic BasicPatternParse a string and obtain a SPARQL algebra basic graph patternstatic BasicPatternParse a string and obtain a SPARQL algebra basic graph pattern, given a prefix mappingstatic BindingparseBinding(String string) Build aBindingstatic DatasetGraphparseDatasetGraph(String string) Parse a string, and obtain a DatasetGraphstatic DatasetGraphparseDatasetGraph(String string, org.apache.jena.shared.PrefixMapping pmap) Parse a string, and obtain a graphstatic ExprParse a string to obtain a SPARQL expressionstatic ExprParse a string to obtain a SPARQL expressionstatic ExprListParse a string to obtain a list of SPARQL expressionsstatic ExprListparseExprList(String s, org.apache.jena.shared.PrefixMapping pmap) Parse a string to obtain a list of SPARQL expressionsstatic org.apache.jena.graph.GraphparseGraph(String string) Parse a string, and obtain a graphstatic org.apache.jena.graph.GraphparseGraph(String string, org.apache.jena.shared.PrefixMapping pmap) Parse a string, and obtain a graphstatic Itemstatic Itemstatic org.apache.jena.graph.NodeParse a string to obtain a Node (see NodeFactory.parse()static org.apache.jena.graph.NodeParse a string to obtain a Nodestatic NodeValueparseNodeValue(String str) Parse a string to obtain aNodeValue.static NodeValueparseNodeValue(String str, org.apache.jena.shared.PrefixMapping pmap) Parse a string to obtain aNodeValue.static OpParse a string and obtain a SPARQL algebra opstatic OpParse a string and obtain a SPARQL algebra op, given a prefix mappingstatic PathParse a string to obtain a pathstatic PathParse a string to obtain a pathstatic QuadParse a string to obtain a Quadstatic QuadParse a string to obtain a Quadstatic ItemParse a string and obtain an SSE item expression (no additional prefix mappings)static RowSetparseRowSet(String string) Build aRowSetstatic TableparseTable(String s) Parse a string and obtain a SPARQL algebra tablestatic TableparseTable(String s, org.apache.jena.shared.PrefixMapping pmap) Parse a string and obtain a SPARQL algebra tablestatic org.apache.jena.graph.TripleparseTriple(String str) Parse a string to obtain a Triplestatic org.apache.jena.graph.TripleparseTriple(String str, org.apache.jena.shared.PrefixMapping pmap) Parse a string to obtain a Triplestatic BasicPatternRead in a file, parse, and obtain a SPARQL algebra basic graph patternstatic DatasetGraphreadDatasetGraph(String filename) Read in a file, parse, and obtain a graphstatic DatasetGraphreadDatasetGraph(String filename, org.apache.jena.shared.PrefixMapping pmap) Read in a file, parse, and obtain a DatasetGraphstatic voidreadDatasetGraph(DatasetGraph dsg, String filename) Read in a file, parse, load a DatasetGraphstatic voidreadDatasetGraph(DatasetGraph dsg, String filename, org.apache.jena.shared.PrefixMapping pmap) Read in a file, parse, load a DatasetGraphstatic ItemRead a file and obtain an SSE item expressionstatic ItemRead a file and obtain an SSE item expressionstatic org.apache.jena.graph.GraphRead in a file, parse, and obtain a graphstatic org.apache.jena.graph.GraphRead in a file, parse, and obtain a graphstatic voidRead in a file, parse, and obtain a graphstatic voidreadGraph(org.apache.jena.graph.Graph graph, String filename, org.apache.jena.shared.PrefixMapping pmap) Read in a file, parse, and obtain a graphstatic OpRead in a file, parse, and obtain a SPARQL algebra opstatic TableRead a file and obtain a SPARQL algebra tablestatic TableRead a file and obtain a SPARQL algebra tablestatic SerializationContextsCxt(org.apache.jena.graph.Graph graph) Return a SerializationContext appropriate for the graphstatic SerializationContextsCxt(org.apache.jena.shared.PrefixMapping pmap) Return a SerializationContext appropriate for the prefix mappingstatic voidsetPrefixMapRead(org.apache.jena.shared.PrefixMapping pmap) static voidsetPrefixMapString(org.apache.jena.shared.PrefixMapping pmap) static voidsetPrefixMapWrite(org.apache.jena.shared.PrefixMapping pmap) static voidsetUseResolver(boolean flag) static Stringstr(org.apache.jena.graph.Graph graph) static Stringstr(org.apache.jena.graph.Graph graph, org.apache.jena.shared.PrefixMapping pmap) static Stringstr(org.apache.jena.graph.Node node) static Stringstr(org.apache.jena.graph.Node node, org.apache.jena.shared.PrefixMapping pmap) static Stringstr(org.apache.jena.graph.Triple triple) static Stringstr(org.apache.jena.graph.Triple triple, org.apache.jena.shared.PrefixMapping pmap) static Stringstatic Stringstatic Stringstr(BasicPattern bgp) static Stringstr(BasicPattern bgp, org.apache.jena.shared.PrefixMapping pmap) static Stringstr(DatasetGraph dsg) static Stringstr(DatasetGraph dsg, org.apache.jena.shared.PrefixMapping pmap) static Stringstatic Stringstatic Stringstatic Stringstatic StringstrPlain(org.apache.jena.graph.Triple triple) Plain - with (), not (triple ...)static StringstrPlain(org.apache.jena.graph.Triple triple, org.apache.jena.shared.PrefixMapping pmap) Plain - with (), not (triple ...)static StringPlain - with (), not (quad ...)static StringPlain - with (), not (quad ...)static voidwrite(OutputStream out, org.apache.jena.graph.Graph graph) static voidwrite(OutputStream out, org.apache.jena.graph.Node node) static voidwrite(OutputStream out, org.apache.jena.graph.Triple triple) static voidwrite(OutputStream out, Dataset dataset) static voidwrite(OutputStream out, org.apache.jena.rdf.model.Model model) static voidwrite(OutputStream out, Op op) static voidwrite(OutputStream out, DatasetGraph dataset) static voidwrite(OutputStream out, Quad quad) static voidwrite(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.graph.Graph graph) static voidwrite(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.graph.Node node) static voidwrite(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.graph.Triple triple) static voidstatic voidwrite(org.apache.jena.atlas.io.IndentedWriter out, org.apache.jena.rdf.model.Model model) static voidstatic voidwrite(org.apache.jena.atlas.io.IndentedWriter out, BasicPattern pattern) static voidwrite(org.apache.jena.atlas.io.IndentedWriter out, BasicPattern pattern, org.apache.jena.shared.PrefixMapping pMap) static voidwrite(org.apache.jena.atlas.io.IndentedWriter out, DatasetGraph dataset) static voidstatic voidwrite(org.apache.jena.graph.Graph graph) static voidwrite(org.apache.jena.graph.Node node) static voidwrite(org.apache.jena.graph.Triple triple) static voidstatic voidwrite(org.apache.jena.rdf.model.Model model) static voidstatic voidwrite(BasicPattern pattern) static voidwrite(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() -
parseNodeValue
Parse a string to obtain aNodeValue. -
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
-