public StatsMatcher(String filename) { try { Item stats = SSE.readFile(filename); if (stats.isNil()) { Log.warn(this, "Empty stats file: " + filename); return; } if (!stats.isTagged(STATS)) throw new ARQException("Not a stats file: " + filename); init(stats); } catch (ItemException ex) { // Debug throw ex; } }
@Override public String toString() { IndentedLineBuffer out = new IndentedLineBuffer(); SerializationContext sCxt = SSE.sCxt((SSE.defaultPrefixMapWrite)); boolean first = true; for (Triple t : triples) { if (!first) out.print("\n"); else first = false; // Adds (triple ...) // SSE.write(buff.getIndentedWriter(), t) ; out.print("("); WriterNode.outputPlain(out, t, sCxt); out.print(")"); } out.flush(); return out.toString(); }
private static void opSame(String str, Op other) { Op op = SSE.parseOp(str); assertEquals(op, other); }
private static void opSame(String str) { opSame(str, SSE.parseOp(str)); }
@Test public void test_08() { SSE.parseExpr("(+ 1 2)"); }
@Test public void test_07() { SSE.parseExpr("1"); }
@Test public void test_06() { SSE.parseQuad("(quad _ ?s ?p ?o)"); }
@Test public void test_05() { SSE.parseQuad("(_ ?s ?p ?o)"); }
@Test public void test_04() { SSE.parseTriple("(?s ?p ?o)"); }
@Test public void test_03() { SSE.parseTriple("[?s ?p ?o]"); }
@Test public void test_01() { SSE.parseTriple("[triple ?s ?p ?o]"); }
@Test public void testBuildInt_03() { Item item = SSE.parseItem("_"); int i = BuilderNode.buildInt(item, 23); assertEquals(23, i); }
@Test public void testBuildInt_01() { Item item = SSE.parseItem("1"); int i = BuilderNode.buildInt(item); assertEquals(1, i); }
private static Binding build(String string) { Item item = SSE.parse("(binding " + string + ")"); return BuilderBinding.build(item); }