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();
}
Aggregations