Search in sources :

Example 36 with SailException

use of org.eclipse.rdf4j.sail.SailException in project com.inova8.intelligentgraph by peterjohnlawrence.

the class IntelligentGraphSail method initializeContexts.

/**
 * Initialize contexts.
 */
public void initializeContexts() {
    publicContexts.clear();
    privateContexts.clear();
    IntelligentGraphConnection connection = this.getConnection();
    CloseableIteration<? extends Resource, SailException> connectionIDs = connection.getContextIDs();
    while (connectionIDs.hasNext()) {
        Resource connectionID = connectionIDs.next();
        if (connectionID.stringValue().startsWith(IntelligentGraphConstants.URN_CUSTOM_QUERY_OPTIONS)) {
        // Ignore any urn:customQueryOptions that might have been added to contexts
        } else {
            CloseableIteration<? extends IntelligentStatement, SailException> contextPrivacies = connection.getStatements(connectionID, SCRIPT.ISPRIVATE, null, false);
            publicContexts.add((IRI) connectionID);
            while (contextPrivacies.hasNext()) {
                Statement contextPrivacy = contextPrivacies.next();
                Value privacy = contextPrivacy.getObject();
                if (privacy.stringValue() == "true") {
                    privateContexts.add((IRI) connectionID);
                    publicContexts.remove((IRI) connectionID);
                }
            }
        }
    }
// IntelligentGraphRepository.create(this).clearRepositoryNamespaceContext();
// IntelligentGraphRepository.create(this).clearRepositoryNamespaceContext();
}
Also used : Statement(org.eclipse.rdf4j.model.Statement) Resource(org.eclipse.rdf4j.model.Resource) Value(org.eclipse.rdf4j.model.Value) SailException(org.eclipse.rdf4j.sail.SailException)

Aggregations

SailException (org.eclipse.rdf4j.sail.SailException)36 RyaDAOException (org.apache.rya.api.persist.RyaDAOException)19 QueryEvaluationException (org.eclipse.rdf4j.query.QueryEvaluationException)17 RepositoryException (org.eclipse.rdf4j.repository.RepositoryException)17 AccumuloException (org.apache.accumulo.core.client.AccumuloException)13 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)13 RyaClientException (org.apache.rya.api.client.RyaClientException)13 Sail (org.eclipse.rdf4j.sail.Sail)13 InferenceEngineException (org.apache.rya.rdftriplestore.inference.InferenceEngineException)12 MalformedQueryException (org.eclipse.rdf4j.query.MalformedQueryException)11 InstanceDoesNotExistException (org.apache.rya.api.client.InstanceDoesNotExistException)8 SailRepository (org.eclipse.rdf4j.repository.sail.SailRepository)7 IOException (java.io.IOException)6 AccumuloRdfConfiguration (org.apache.rya.accumulo.AccumuloRdfConfiguration)6 PathPatternException (com.inova8.pathql.processor.PathPatternException)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)5 RecognitionException (org.antlr.v4.runtime.RecognitionException)5 Resource (org.eclipse.rdf4j.model.Resource)5 SailRepositoryConnection (org.eclipse.rdf4j.repository.sail.SailRepositoryConnection)5 SailConnection (org.eclipse.rdf4j.sail.SailConnection)5