/** Parse a string to obtain a Triple */ public static Triple parseTriple(String str) { return parseTriple(str, null) ; }
public static Item parseItem(String str) { return parse(str, null) ; }
public Op getOp() { if ( op != null ) return op ; op = SSE.parseOp(queryString) ; if ( op == null ) System.err.println("Failed to parse : "+queryString) ; return op ; } }
/** Parse a string and obtain a SPARQL algebra basic graph pattern */ public static BasicPattern parseBGP(String s) { return parseBGP(s, getDefaultPrefixMapRead()) ; }
private static Item parse(Reader reader, PrefixMapping pmap) { if ( pmap == null ) pmap = getDefaultPrefixMapRead() ; ParseHandler handler = createParseHandler(pmap) ; SSE_Parser.parse(reader, handler) ; return handler.getItem() ; }
public static void write(Model model) { write(IndentedWriter.stdout, model) ; IndentedWriter.stdout.flush() ; } public static void write(OutputStream out, Model model)
/** Parse a string to obtain a Quad */ public static Quad parseQuad(String s) { return parseQuad(s, null) ; }
/** Parse a string and obtain a SPARQL algebra table */ public static Table parseTable(String s) { return parseTable(s, null) ; }
/** Parse a string to obtain a SPARQL expression */ public static Expr parseExpr(String s) { return parseExpr(s, null) ; }
public static void write(Model model) { write(IndentedWriter.stdout, model) ; IndentedWriter.stdout.flush() ; } public static void write(OutputStream out, Model model)
public static Item parse(Reader reader, PrefixMapping pmap) { if ( pmap == null ) pmap = getDefaultPrefixMapRead() ; ParseHandler handler = createParseHandler(pmap) ; SSE_Parser.parse(reader, handler) ; return handler.getItem() ; }
/** Parse a string to obtain a Quad */ public static Quad parseQuad(String s) { return parseQuad(s, null) ; }
/** Parse a string and obtain a SPARQL algebra basic graph pattern */ public static BasicPattern parseBGP(String s) { return parseBGP(s, getDefaultPrefixMapRead()) ; }
/** Parse a string and obtain a SPARQL algebra table */ public static Table parseTable(String s) { return parseTable(s, null) ; }
/** Parse a string to obtain a SPARQL expression */ public static Expr parseExpr(String s) { return parseExpr(s, null) ; }
public static Item parseItem(String str) { return parse(str, null) ; }
public static void write(Graph graph) { write(IndentedWriter.stdout, graph) ; IndentedWriter.stdout.flush() ; } public static void write(OutputStream out, Graph graph)
/** Parse a string to obtain a Triple */ public static Triple parseTriple(String str) { return parseTriple(str, null) ; }
private static Item parseTerm(Reader reader, PrefixMapping pmap) { if ( pmap == null ) pmap = getDefaultPrefixMapRead() ; ParseHandler handler = createParseHandler(pmap) ; SSE_Parser.term(reader, handler) ; return handler.getItem() ; }
/** Example setup - in-memory dataset with two graphs, one triple in each */ private static Dataset setup() { Dataset ds = TDBFactory.createDataset() ; DatasetGraphTDB dsg = (DatasetGraphTDB)(ds.asDatasetGraph()) ; Quad q1 = SSE.parseQuad("(<http://example/g1> <http://example/s> <http://example/p> <http://example/o1>)") ; Quad q2 = SSE.parseQuad("(<http://example/g2> <http://example/s> <http://example/p> <http://example/o2>)") ; dsg.add(q1) ; dsg.add(q2) ; return ds ; }