public static BasicPattern bgp(String str) { String s1 = "(prefix ((: <http://example/>)) " ; String s2 = ")" ; return SSE.parseBGP(s1+str+s2) ; }
/** Parse a string and obtain a SPARQL algebra basic graph pattern */ public static BasicPattern parseBGP(String s) { return parseBGP(s, getPrefixMapRead()) ; }
@Test public void testFormatBGP_2() { IndentedLineBuffer b = new IndentedLineBuffer() ; BasicPattern bgp = SSE.parseBGP("(prefix ((zz: <"+aUri+">)) (bgp (zz:s zz:p zz:o) (zz:s zz:p 123) ))") ; FmtUtils.formatPattern(b, bgp, getContext()) ; assertEquals("zz:s zz:p zz:o .\nzz:s zz:p 123 .", b.toString()) ; }
@Test public void testFormatBGP_1() { IndentedLineBuffer b = new IndentedLineBuffer() ; BasicPattern bgp = SSE.parseBGP("(prefix ((zz: <"+aUri+">)) (bgp (zz:s zz:p zz:o)))") ; FmtUtils.formatPattern(b, bgp, getContext()) ; assertEquals("zz:s zz:p zz:o .", b.toString()) ; }