/** * Add an "explicit" statement to the buffer (flushes on overflow). * * @param s * @param p * @param o * @param c */ @Override public void add(final Resource s, final URI p, final Value o, final Resource c) { add(s, p, o, c, StatementEnum.Explicit); }
/** * Add an "explicit" statement to the buffer (flushes on overflow, no * context). * * @param s * @param p * @param o */ @Override public void add(final Resource s, final URI p, final Value o) { add(s, p, o, null, StatementEnum.Explicit); }
/** * Add an "explicit" statement to the buffer (flushes on overflow). * * @param s * @param p * @param o * @param c */ @Override public void add(final Resource s, final URI p, final Value o, final Resource c) { add(s, p, o, c, StatementEnum.Explicit); }
/** * Add an "explicit" statement to the buffer (flushes on overflow, no * context). * * @param s * @param p * @param o */ @Override public void add(final Resource s, final URI p, final Value o) { add(s, p, o, null, StatementEnum.Explicit); }
@Override public void add(final Statement e) { add(e.getSubject(), e.getPredicate(), e.getObject(), e.getContext(), (e instanceof BigdataStatement ? ((BigdataStatement) e) .getStatementType() : null)); }
@Override public void add(final Statement e) { add(e.getSubject(), e.getPredicate(), e.getObject(), e.getContext(), (e instanceof BigdataStatement ? ((BigdataStatement) e) .getStatementType() : null)); }
@Override public void handleStatement(final Statement stmt) throws RDFHandlerException { final Resource s = stmt.getSubject(); final URI p = stmt.getPredicate(); final Value o = stmt.getObject(); final Resource c = stmt.getContext() == null ? this.context : stmt.getContext(); // if (log.isDebugEnabled()) // log.debug("<" + s + "," + p + "," + o + "," + c + ">"); buffer.add(s, p, o, c, StatementEnum.Explicit); n++; }
@Override public void handleStatement(final Statement stmt) throws RDFHandlerException { final Resource s = stmt.getSubject(); final URI p = stmt.getPredicate(); final Value o = stmt.getObject(); final Resource c = stmt.getContext() == null ? this.context : stmt.getContext(); // if (log.isDebugEnabled()) // log.debug("<" + s + "," + p + "," + o + "," + c + ">"); buffer.add(s, p, o, c, StatementEnum.Explicit); n++; }
public void testInlineUUIDs() throws Exception { /* * The bigdata store, backed by a temporary journal file. */ final AbstractTripleStore store = getStore(getProperties()); try { final BigdataValueFactory vf = store.getValueFactory(); final BigdataURI uri1 = vf.createURI("urn:uuid:" + UUID.randomUUID().toString()); final BigdataURI uri2 = vf.createURI("urn:uuid:" + UUID.randomUUID().toString()); final BigdataURI uri3 = vf.createURI("urn:uuid:foo"); final StatementBuffer<BigdataStatement> sb = new StatementBuffer<BigdataStatement>(store, 10/* capacity */); sb.add(uri1, RDF.TYPE, XSD.UUID); sb.add(uri2, RDF.TYPE, XSD.UUID); sb.add(uri3, RDF.TYPE, XSD.UUID); sb.flush(); store.commit(); if (log.isDebugEnabled()) log.debug(store.dumpStore()); assertTrue(uri1.getIV().isInline()); assertTrue(uri2.getIV().isInline()); assertFalse(uri3.getIV().isInline()); } finally { store.__tearDownUnitTest(); } }
public void testInlineUUIDs() throws Exception { /* * The bigdata store, backed by a temporary journal file. */ final AbstractTripleStore store = getStore(getProperties()); try { final BigdataValueFactory vf = store.getValueFactory(); final BigdataURI uri1 = vf.createURI("urn:uuid:" + UUID.randomUUID().toString()); final BigdataURI uri2 = vf.createURI("urn:uuid:" + UUID.randomUUID().toString()); final BigdataURI uri3 = vf.createURI("urn:uuid:foo"); final StatementBuffer<BigdataStatement> sb = new StatementBuffer<BigdataStatement>(store, 10/* capacity */); sb.add(uri1, RDF.TYPE, XSD.UUID); sb.add(uri2, RDF.TYPE, XSD.UUID); sb.add(uri3, RDF.TYPE, XSD.UUID); sb.flush(); store.commit(); if (log.isDebugEnabled()) log.debug(store.dumpStore()); assertTrue(uri1.getIV().isInline()); assertTrue(uri2.getIV().isInline()); assertFalse(uri3.getIV().isInline()); } finally { store.__tearDownUnitTest(); } }
@Override public void handleStatement(final Statement stmt) throws RDFHandlerException { final Resource s = stmt.getSubject(); final URI p = stmt.getPredicate(); final Value o = stmt.getObject(); final Resource c = stmt.getContext() == null ? this.context : stmt.getContext(); // if (log.isDebugEnabled()) // log.debug("<" + s + "," + p + "," + o + "," + c + ">"); buffer.add(s, p, o, c, StatementEnum.Explicit); n++; }
public void testInlineUUIDs() throws Exception { /* * The bigdata store, backed by a temporary journal file. */ final AbstractTripleStore store = getStore(getProperties()); try { final BigdataValueFactory vf = store.getValueFactory(); final BigdataURI uri1 = vf.createURI("urn:uuid:" + UUID.randomUUID().toString()); final BigdataURI uri2 = vf.createURI("urn:uuid:" + UUID.randomUUID().toString()); final BigdataURI uri3 = vf.createURI("urn:uuid:foo"); final StatementBuffer<BigdataStatement> sb = new StatementBuffer<BigdataStatement>(store, 10/* capacity */); sb.add(uri1, RDF.TYPE, XSD.UUID); sb.add(uri2, RDF.TYPE, XSD.UUID); sb.add(uri3, RDF.TYPE, XSD.UUID); sb.flush(); store.commit(); if (log.isDebugEnabled()) log.debug(store.dumpStore()); assertTrue(uri1.getIV().isInline()); assertTrue(uri2.getIV().isInline()); assertFalse(uri3.getIV().isInline()); } finally { store.__tearDownUnitTest(); } }
public void test_context_stripping() { int capacity = 1; final AbstractTripleStore store = getStore(getProperties()); try { final BigdataValueFactory vf = store.getValueFactory(); final BigdataURI s = vf.createURI("http://example.com/s"); final BigdataURI p = vf.createURI("http://example.com/p"); final BigdataURI o = vf.createURI("http://example.com/o"); final BigdataURI c = vf.createURI("http://example.com/c"); final StatementBuffer<Statement> buffer = new StatementBuffer<Statement>( store, capacity); buffer.add(vf.createStatement(s, p, o, c, StatementEnum.Explicit)); // flush the buffer. buffer.flush(); assertTrue(store.hasStatement(s, p, o)); assertFalse(store.hasStatement(s, p, o, c)); } finally { store.__tearDownUnitTest(); } }
public void test_context_stripping() { int capacity = 1; final AbstractTripleStore store = getStore(getProperties()); try { final BigdataValueFactory vf = store.getValueFactory(); final BigdataURI s = vf.createURI("http://example.com/s"); final BigdataURI p = vf.createURI("http://example.com/p"); final BigdataURI o = vf.createURI("http://example.com/o"); final BigdataURI c = vf.createURI("http://example.com/c"); final StatementBuffer<Statement> buffer = new StatementBuffer<Statement>( store, capacity); buffer.add(vf.createStatement(s, p, o, c, StatementEnum.Explicit)); // flush the buffer. buffer.flush(); assertTrue(store.hasStatement(s, p, o)); assertFalse(store.hasStatement(s, p, o, c)); } finally { store.__tearDownUnitTest(); } }
public void test_context_stripping() { int capacity = 1; final AbstractTripleStore store = getStore(getProperties()); try { final BigdataValueFactory vf = store.getValueFactory(); final BigdataURI s = vf.createURI("http://example.com/s"); final BigdataURI p = vf.createURI("http://example.com/p"); final BigdataURI o = vf.createURI("http://example.com/o"); final BigdataURI c = vf.createURI("http://example.com/c"); final StatementBuffer<Statement> buffer = new StatementBuffer<Statement>( store, capacity); buffer.add(vf.createStatement(s, p, o, c, StatementEnum.Explicit)); // flush the buffer. buffer.flush(); assertTrue(store.hasStatement(s, p, o)); assertFalse(store.hasStatement(s, p, o, c)); } finally { store.__tearDownUnitTest(); } }