本文整理了Java中org.openrdf.repository.RepositoryConnection.getStatements
方法的一些代码示例,展示了RepositoryConnection.getStatements
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RepositoryConnection.getStatements
方法的具体详情如下:
包路径:org.openrdf.repository.RepositoryConnection
类名称:RepositoryConnection
方法名:getStatements
暂无
代码示例来源:origin: org.openrdf.sesame/sesame-sail-federation
public CloseableIteration<? extends Statement, RepositoryException> call(RepositoryConnection member)
throws RepositoryException
{
return member.getStatements(subj, pred, obj, includeInferred, contexts);
}
});
代码示例来源:origin: org.openrdf.alibaba/alibaba-sail-federation
public CloseableIteration<? extends Statement, RepositoryException> call(
RepositoryConnection member) throws RepositoryException {
return member.getStatements(subj, pred, obj, includeInferred,
contexts);
}
});
代码示例来源:origin: net.fortytwo.sesametools/common
@Override
public Set<Value> objects() {
Function<Statement, Value> f = new Function<Statement, Value>() {
@Override
public Value apply(Statement statement) {
return statement.getObject();
}
};
return toSet(rc.getStatements(null, null, null), f);
}
代码示例来源:origin: fr.lirmm.graphik/graal-store-openrdf
@Override
public CloseableIterator<Atom> iterator() {
try {
return new AtomIterator(this.connection.getStatements(null, null, null, false));
} catch (RepositoryException e) {
if (LOGGER.isErrorEnabled()) {
LOGGER.error("Error during iterator creation", e);
}
}
return null;
}
代码示例来源:origin: net.fortytwo.sesametools/common
@Override
public boolean contains(Resource resource, IRI iri, Value value, Resource... resources) {
try (CloseableIteration<Statement, RepositoryException> iter
= rc.getStatements(resource, iri, value, resources)) {
return iter.hasNext();
}
}
代码示例来源:origin: net.fortytwo.sesametools/common
@Override
public Set<IRI> predicates() {
Function<Statement, IRI> f = new Function<Statement, IRI>() {
@Override
public IRI apply(Statement statement) {
return statement.getPredicate();
}
};
return toSet(rc.getStatements(null, null, null), f);
}
代码示例来源:origin: net.fortytwo.sesametools/common
@Override
public Set<Resource> subjects() {
Function<Statement, Resource> f = new Function<Statement, Resource>() {
@Override
public Resource apply(Statement statement) {
return statement.getSubject();
}
};
return toSet(rc.getStatements(null, null, null), f);
}
代码示例来源:origin: org.openrdf.alibaba/alibaba-model
@Override
public Iterator<Statement> iterator() {
try {
return new StatementIterator(con.getStatements(null, null, null,
false));
} catch (RepositoryException e) {
throw new ModelException(e);
}
}
代码示例来源:origin: org.openrdf.alibaba/alibaba-model
@Override
public Iterator<Statement> iterator() {
try {
return new StatementIterator(con.getStatements(
(Resource) subj, (URI) pred, obj, false,
cast(contexts)));
} catch (RepositoryException e) {
throw new ModelException(e);
}
}
};
代码示例来源:origin: net.fortytwo.sesametools/repository-sail
protected CloseableIteration<? extends Statement, SailException> getStatementsInternal(
Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts)
throws SailException {
try {
return new RepositoryStatementIteration(
repoConnection.getStatements(subj, pred, obj, includeInferred && !inferenceDisabled, contexts));
} catch (RepositoryException e) {
throw new SailException(e);
}
}
代码示例来源:origin: net.fortytwo.sesametools/common
@Override
public Iterator<Statement> match(Resource s, IRI p, Value o, Resource... c) {
RepositoryResult<Statement> result;
try {
result = rc.getStatements(s, p, o, INFER, c);
} catch (RepositoryException e) {
throw new RepositoryGraphRuntimeException(e);
}
return new RepositoryResultIterator(result);
}
代码示例来源:origin: org.apache.marmotta/marmotta-commons
@Override
public Iterator<Statement> iterator() {
try {
return ResultUtils.unwrap(con.getStatements(r, property, null, true, contexts));
} catch (RepositoryException ex) {
ExceptionUtils.handleRepositoryException(ex, ResourceUtils.class);
return Iterators.emptyIterator();
}
}
};
代码示例来源:origin: org.openrdf.elmo/elmo-codegen
private Statement first(RepositoryConnection conn, URI pred, Value obj)
throws RepositoryException {
RepositoryResult<Statement> stmts;
stmts = conn.getStatements(null, pred, obj, true);
try {
if (stmts.hasNext())
return stmts.next();
return null;
} finally {
stmts.close();
}
}
代码示例来源:origin: org.apache.marmotta/marmotta-commons
@Override
public Iterator<Statement> iterator() {
try {
return ResultUtils.unwrap(con.getStatements(null, property, r, true, contexts));
} catch (RepositoryException ex) {
ExceptionUtils.handleRepositoryException(ex, ResourceUtils.class);
return Iterators.emptyIterator();
}
}
};
代码示例来源:origin: org.apache.marmotta/marmotta-commons
@Override
public Iterator<Statement> iterator() {
try {
return ResultUtils.unwrap(con.getStatements(r,rdf_type,null,true,contexts));
} catch (RepositoryException e) {
ExceptionUtils.handleRepositoryException(e, ResourceUtils.class);
return Iterators.emptyIterator();
}
}
},
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
public static SailRepository exportRepoToNativeStore(Repository rep, String dirPath) throws RepositoryException, FileNotFoundException, RDFHandlerException{
File f = new File(dirPath);
if(f.exists()) f.delete();
f.mkdirs();
NativeStore nativeStore = new NativeStore(f);
SailRepository nativeRepo = new SailRepository(nativeStore);
nativeRepo.initialize();
RepositoryResult<Statement> rr = rep.getConnection().getStatements((Resource)null, null, null, false, (Resource)null);
nativeRepo.getConnection().add(rr.asList(), (Resource)null);
return nativeRepo;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
public static SailRepository exportRepoToNativeStore(Repository rep, String dirPath) throws RepositoryException, FileNotFoundException, RDFHandlerException{
File f = new File(dirPath);
if(f.exists()) f.delete();
f.mkdirs();
NativeStore nativeStore = new NativeStore(f);
SailRepository nativeRepo = new SailRepository(nativeStore);
nativeRepo.initialize();
RepositoryResult<Statement> rr = rep.getConnection().getStatements((Resource)null, null, null, false, (Resource)null);
nativeRepo.getConnection().add(rr.asList(), (Resource)null);
return nativeRepo;
}
代码示例来源:origin: org.semweb4j/rdf2go.impl.sesame20
public ClosableIterator<Statement> iterator() {
assertModel();
try {
CloseableIteration<? extends org.openrdf.model.Statement, RepositoryException> statements = connection.getStatements(
null, null, null, true, openRdfContext);
return new StatementIterator(statements, this);
}
catch (RepositoryException e) {
throw new ModelRuntimeException(e);
}
}
代码示例来源:origin: apache/marmotta
@Override
public Iterator<Statement> iterator() {
try {
return ResultUtils.unwrap(con.getStatements(r,rdf_type,null,true,contexts));
} catch (RepositoryException e) {
ExceptionUtils.handleRepositoryException(e, ResourceUtils.class);
return Iterators.emptyIterator();
}
}
},
代码示例来源:origin: fr.lirmm.graphik/graal-store-openrdf
@Override
public CloseableIterator<Atom> atomsByPredicate(Predicate p) throws AtomSetException {
try {
return new AtomIterator(this.connection.getStatements(null, this.createURI(p), null, false));
} catch (RepositoryException e) {
throw new AtomSetException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!