本文整理了Java中org.eclipse.rdf4j.repository.RepositoryConnection.exportStatements
方法的一些代码示例,展示了RepositoryConnection.exportStatements
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RepositoryConnection.exportStatements
方法的具体详情如下:
包路径:org.eclipse.rdf4j.repository.RepositoryConnection
类名称:RepositoryConnection
方法名:exportStatements
[英]Exports all statements with a specific subject, predicate and/or object from the repository, optionally from the specified contexts.
[中]从存储库中导出具有特定主语、谓语和/或宾语的所有语句,可以选择从指定的上下文中导出。
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-http-server-spring
/**
* @param subj
* @param pred
* @param obj
* @param useInferencing
* @param rdfWriter
* @param contexts
* @throws ExecutionException
* @throws InterruptedException
*/
void exportStatements(Resource subj, IRI pred, Value obj, boolean useInferencing, RDFWriter rdfWriter,
Resource... contexts)
throws InterruptedException, ExecutionException
{
Future<Boolean> result = submit(() -> {
txnConnection.exportStatements(subj, pred, obj, useInferencing, rdfWriter, contexts);
return true;
});
getFromFuture(result);
}
代码示例来源:origin: eclipse/rdf4j
@Override
public void exportStatements(Resource subj, IRI pred, Value obj, boolean includeInferred,
RDFHandler handler, Resource... contexts)
throws RepositoryException, RDFHandlerException
{
if (isDelegatingRead()) {
getDelegate().exportStatements(subj, pred, obj, includeInferred, handler, contexts);
}
else {
exportStatements(getStatements(subj, pred, obj, includeInferred, contexts), handler);
}
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client
@Override
public void exportStatements(Resource subj, IRI pred, Value obj, boolean includeInferred,
RDFHandler handler, Resource... contexts)
throws RepositoryException, RDFHandlerException
{
if (isDelegatingRead()) {
getDelegate().exportStatements(subj, pred, obj, includeInferred, handler, contexts);
}
else {
exportStatements(getStatements(subj, pred, obj, includeInferred, contexts), handler);
}
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-http-server-spring
conn.exportStatements(subj, pred, obj, useInferencing, rdfWriter, contexts);
代码示例来源:origin: eclipse/rdf4j
@Override
protected void removeWithoutCommit(Resource subject, IRI predicate, Value object, Resource... contexts)
throws RepositoryException
{
IRI[] archiveContexts = getArchiveContexts();
if (archiveContexts.length > 0) {
RDFHandler handler = new RDFInserter(getDelegate());
try {
getDelegate().exportStatements(subject, predicate, object, true, handler, archiveContexts);
}
catch (RDFHandlerException e) {
if (e.getCause() instanceof RepositoryException) {
throw (RepositoryException)e.getCause();
}
throw new AssertionError(e);
}
}
if (isAllContext(contexts)) {
getDelegate().remove(subject, predicate, object, getRemoveContexts());
}
else {
getDelegate().remove(subject, predicate, object, contexts);
}
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-repository-contextaware
@Override
protected void removeWithoutCommit(Resource subject, IRI predicate, Value object, Resource... contexts)
throws RepositoryException
{
IRI[] archiveContexts = getArchiveContexts();
if (archiveContexts.length > 0) {
RDFHandler handler = new RDFInserter(getDelegate());
try {
getDelegate().exportStatements(subject, predicate, object, true, handler, archiveContexts);
}
catch (RDFHandlerException e) {
if (e.getCause() instanceof RepositoryException) {
throw (RepositoryException)e.getCause();
}
throw new AssertionError(e);
}
}
if (isAllContext(contexts)) {
getDelegate().remove(subject, predicate, object, getRemoveContexts());
}
else {
getDelegate().remove(subject, predicate, object, contexts);
}
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client
@Override
protected void removeWithoutCommit(Resource subject, IRI predicate, Value object, Resource... contexts)
throws RepositoryException
{
IRI[] archiveContexts = getArchiveContexts();
if (archiveContexts.length > 0) {
RDFHandler handler = new RDFInserter(getDelegate());
try {
getDelegate().exportStatements(subject, predicate, object, true, handler, archiveContexts);
}
catch (RDFHandlerException e) {
if (e.getCause() instanceof RepositoryException) {
throw (RepositoryException)e.getCause();
}
throw new AssertionError(e);
}
}
if (isAllContext(contexts)) {
getDelegate().remove(subject, predicate, object, getRemoveContexts());
}
else {
getDelegate().remove(subject, predicate, object, contexts);
}
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testAddRemove()
throws Exception {
IRI FOAF_PERSON = vf.createIRI("http://xmlns.com/foaf/0.1/Person");
final Statement stmt = vf.createStatement(bob, name, nameBob);
testCon.add(bob, RDF.TYPE, FOAF_PERSON);
testCon.setAutoCommit(false);
testCon.add(stmt);
testCon.remove(stmt);
testCon.commit();
testCon.exportStatements(null, null, null, false, new RDFHandlerBase() {
@Override
public void handleStatement(Statement st)
throws RDFHandlerException {
assertTrue(!stmt.equals(st));
}
});
}
内容来源于网络,如有侵权,请联系作者删除!