本文整理汇总了Java中org.openrdf.sail.SailException类的典型用法代码示例。如果您正苦于以下问题:Java SailException类的具体用法?Java SailException怎么用?Java SailException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SailException类属于org.openrdf.sail包,在下文中一共展示了SailException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: refreshConnection
import org.openrdf.sail.SailException; //导入依赖的package包/类
protected void refreshConnection() throws SailException {
try {
checkNotNull(store.getRyaDAO());
checkArgument(store.getRyaDAO().isInitialized());
checkNotNull(store.getNamespaceManager());
this.ryaDAO = store.getRyaDAO();
this.rdfEvalStatsDAO = store.getRdfEvalStatsDAO();
this.selectEvalDAO = store.getSelectEvalDAO();
this.inferenceEngine = store.getInferenceEngine();
this.namespaceManager = store.getNamespaceManager();
this.provenanceCollector = store.getProvenanceCollector();
} catch (final Exception e) {
throw new SailException(e);
}
}
示例2: applyRuleRdfs4b
import org.openrdf.sail.SailException; //导入依赖的package包/类
private int applyRuleRdfs4b()
throws SailException
{
int nofInferred = 0;
Iterator<Statement> iter = this.newThisIteration.match(null, null, null);
while (iter.hasNext()) {
Statement st = iter.next();
Value uuu = st.getObject();
if (uuu instanceof Resource) {
boolean added = addInferredStatement((Resource)uuu, RDF.TYPE, RDFS.RESOURCE);
if (added) {
nofInferred++;
}
}
}
return nofInferred;
}
示例3: shutDownInternal
import org.openrdf.sail.SailException; //导入依赖的package包/类
@Override
protected void shutDownInternal() throws SailException {
try {
if (namespaceManager != null) {
namespaceManager.shutdown();
}
if (inferenceEngine != null) {
inferenceEngine.destroy();
}
if (rdfEvalStatsDAO != null) {
rdfEvalStatsDAO.destroy();
}
ryaDAO.destroy();
} catch (final Exception e) {
throw new SailException(e);
}
}
示例4: applyRuleRdf1
import org.openrdf.sail.SailException; //导入依赖的package包/类
private int applyRuleRdf1()
throws SailException
{
int nofInferred = 0;
Iterator<Statement> iter = this.newThisIteration.match(null, null, null);
while (iter.hasNext()) {
Statement st = iter.next();
boolean added = addInferredStatement(st.getPredicate(), RDF.TYPE, RDF.PROPERTY);
if (added) {
nofInferred++;
}
}
return nofInferred;
}
示例5: applyRuleRdfs10
import org.openrdf.sail.SailException; //导入依赖的package包/类
private int applyRuleRdfs10()
throws SailException
{
int nofInferred = 0;
Iterator<Statement> iter = this.newThisIteration.match(null, RDF.TYPE, RDFS.CLASS);
while (iter.hasNext()) {
Statement st = iter.next();
Resource xxx = st.getSubject();
boolean added = addInferredStatement(xxx, RDFS.SUBCLASSOF, xxx);
if (added) {
nofInferred++;
}
}
return nofInferred;
}
示例6: removeStatementsInternal
import org.openrdf.sail.SailException; //导入依赖的package包/类
@Override
protected void removeStatementsInternal(
final Resource subj,
final URI pred,
final Value obj,
final Resource... contexts) throws SailException {
try {
if (_quad) {
if (contexts == null || contexts.length == 0) {
throw new IllegalArgumentException("A quadstore always needs a context.");
}
for (int i = 0; i < contexts.length; i++) {
_crdf.removeData(_factory.createNodes(subj, pred, obj, contexts[0]));
}
} else {
_crdf.removeData(_factory.createNodes(subj, pred, obj));
}
} catch (CumulusStoreException e) {
e.printStackTrace();
throw new SailException(e);
}
}
示例7: updateFluoApp
import org.openrdf.sail.SailException; //导入依赖的package包/类
private void updateFluoApp(final String ryaInstance, final String fluoAppName, final String pcjId, String sparql, Set<ExportStrategy> strategies) throws RepositoryException, MalformedQueryException, SailException, QueryEvaluationException, PcjException, RyaDAOException, UnsupportedQueryException {
requireNonNull(sparql);
requireNonNull(pcjId);
requireNonNull(strategies);
// Connect to the Fluo application that is updating this instance's PCJs.
final AccumuloConnectionDetails cd = super.getAccumuloConnectionDetails();
try(final FluoClient fluoClient = new FluoClientFactory().connect(
cd.getUsername(),
new String(cd.getUserPass()),
cd.getInstanceName(),
cd.getZookeepers(),
fluoAppName);) {
// Initialize the PCJ within the Fluo application.
final CreateFluoPcj fluoCreatePcj = new CreateFluoPcj();
fluoCreatePcj.withRyaIntegration(pcjId, sparql, strategies, fluoClient, getConnector(), ryaInstance);
}
}
示例8: evaluateInternal
import org.openrdf.sail.SailException; //导入依赖的package包/类
@Override
protected CloseableIteration<BindingSet, QueryEvaluationException> evaluateInternal(
TupleExpr expr, Dataset dataset, BindingSet bindings, boolean includeInferred)
throws SailException {
triples.flush();
try {
TupleExpr tupleExpr;
EvaluationStrategy strategy;
strategy = factory.createRdbmsEvaluation(dataset);
tupleExpr = optimizer.optimize(expr, dataset, bindings, strategy);
// Mexri edw to GeneralDBSqlDiffDateTime ftanei kanonika
return strategy.evaluate(tupleExpr, EmptyBindingSet.getInstance());
} catch (QueryEvaluationException e) {
throw new SailException(e);
}
}
示例9: AccumuloIndexSet
import org.openrdf.sail.SailException; //导入依赖的package包/类
/**
*
* @param accCon
* - connection to a valid Accumulo instance
* @param tablename
* - name of an existing PCJ table
* @throws MalformedQueryException
* @throws SailException
* @throws QueryEvaluationException
* @throws TableNotFoundException
* @throws AccumuloSecurityException
* @throws AccumuloException
* @throws PCJStorageException
*/
public AccumuloIndexSet(final Configuration conf, final String tablename)
throws MalformedQueryException, SailException,
QueryEvaluationException, TableNotFoundException, AccumuloException, AccumuloSecurityException, PCJStorageException {
this.tablename = tablename;
this.accCon = ConfigUtils.getConnector(conf);
this.auths = getAuthorizations(conf);
PcjMetadata meta = pcj.getPcjMetadata(accCon, tablename);
final SPARQLParser sp = new SPARQLParser();
final ParsedTupleQuery pq = (ParsedTupleQuery) sp.parseQuery(meta.getSparql(), null);
setProjectionExpr((Projection) pq.getTupleExpr());
final Set<VariableOrder> orders = meta.getVarOrders();
varOrder = Lists.newArrayList();
for (final VariableOrder var : orders) {
varOrder.add(var.toString());
}
setLocalityGroups(tablename, accCon, varOrder);
this.setSupportedVariableOrderMap(varOrder);
}
示例10: applyRuleRdfs12
import org.openrdf.sail.SailException; //导入依赖的package包/类
private int applyRuleRdfs12()
throws SailException
{
int nofInferred = 0;
Iterator<Statement> iter = this.newThisIteration.match(null, RDF.TYPE, RDFS.CONTAINERMEMBERSHIPPROPERTY);
while (iter.hasNext()) {
Statement st = iter.next();
Resource xxx = st.getSubject();
boolean added = addInferredStatement(xxx, RDFS.SUBPROPERTYOF, RDFS.MEMBER);
if (added) {
nofInferred++;
}
}
return nofInferred;
}
示例11: getStatements
import org.openrdf.sail.SailException; //导入依赖的package包/类
@Override
public CloseableIteration<? extends Statement, QueryEvaluationException> getStatements(
final Resource subj,
final URI pred,
final Value obj,
final Resource... contexts) throws QueryEvaluationException {
try {
if (contexts != null && contexts.length > 0) {
@SuppressWarnings("unchecked")
final CloseableIteration<Statement, QueryEvaluationException>[] iterations = new CloseableIteration[contexts.length];
for (int i = 0; i < contexts.length; i++) {
iterations[i] = newStatementIterator(subj, pred, obj, contexts[i]);
}
return new CloseableMultiIterator<Statement, QueryEvaluationException>(iterations);
} else {
return newStatementIterator(subj, pred, obj, contexts);
}
} catch (final SailException exception) {
LOGGER.error(MessageCatalog._00025_CUMULUS_SYSTEM_INTERNAL_FAILURE, exception);
throw new QueryEvaluationException(exception);
}
}
示例12: flushUpdates
import org.openrdf.sail.SailException; //导入依赖的package包/类
@Override
public void flushUpdates()
throws SailException
{
super.flushUpdates();
if (this.statementsRemoved) {
this.logger.debug("statements removed, starting inferencing from scratch");
clearInferred();
addAxiomStatements();
this.newStatements = new GraphImpl();
Iterations.addAll(getWrappedConnection().getStatements(null, null, null, true), this.newStatements);
this.statementsRemoved = false;
}
doInferencing();
}
示例13: addStatementInternal
import org.openrdf.sail.SailException; //导入依赖的package包/类
@Override
protected void addStatementInternal(
final Resource subj,
final URI pred,
final Value obj,
final Resource... contexts) throws SailException {
try {
if (_quad) {
if (contexts == null || contexts.length == 0) {
throw new IllegalArgumentException("A quadstore always needs a context.");
}
for (int i = 0; i < contexts.length; i++) {
_crdf.addData(_factory.createStatement(subj, pred, obj, contexts[i]));
}
} else {
_crdf.addData(_factory.createStatement(subj, pred, obj));
}
} catch (CumulusStoreException e) {
e.printStackTrace();
throw new SailException(e);
}
}
示例14: run
import org.openrdf.sail.SailException; //导入依赖的package包/类
public void run() throws MalformedQueryException, QueryEvaluationException, NotEnoughResultsException, SailException {
CloseableIteration<? extends BindingSet, QueryEvaluationException> it = null;
try {
// Execute the query.
final SPARQLParser sparqlParser = new SPARQLParser();
final ParsedQuery parsedQuery = sparqlParser.parseQuery(sparql, null);
it = sailConn.evaluate(parsedQuery.getTupleExpr(), null, null, false);
// Perform the reads.
if(numReads.isPresent()) {
read(it, numReads.get() );
} else {
readAll(it);
}
} finally {
if(it != null) {
it.close();
}
}
}
示例15: getConnection
import org.openrdf.sail.SailException; //导入依赖的package包/类
@Override
public SailRepositoryConnection getConnection() throws RepositoryException {
try
{
return new RyaSailRepositoryConnection(this, this.getSail().getConnection());
}
catch(SailException e)
{
throw new RepositoryException(e);
}
}