Search in sources :

Example 66 with Sail

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

the class Query method createMemoryIntelligentGraphRepository.

/**
 * Creates the memory intelligent graph repository.
 *
 * @param dir the dir
 * @return the org.eclipse.rdf 4 j.repository. repository
 * @throws IOException Signals that an I/O exception has occurred.
 * @throws SailConfigException the sail config exception
 */
public static org.eclipse.rdf4j.repository.Repository createMemoryIntelligentGraphRepository(String dir) throws IOException, SailConfigException {
    File dataDir = new File(dir);
    FileUtils.deleteDirectory(dataDir);
    IntelligentGraphConfig intelligentGraphConfig = new IntelligentGraphConfig();
    IntelligentGraphFactory intelligentGraphFactory = new IntelligentGraphFactory();
    IntelligentGraphSail intelligentGraphSail = (IntelligentGraphSail) intelligentGraphFactory.getSail(intelligentGraphConfig);
    Sail baseSail = new MemoryStore();
    intelligentGraphSail.setBaseSail(baseSail);
    org.eclipse.rdf4j.repository.Repository workingRep = new SailRepository(intelligentGraphSail);
    return workingRep;
}
Also used : MemoryStore(org.eclipse.rdf4j.sail.memory.MemoryStore) SailRepository(org.eclipse.rdf4j.repository.sail.SailRepository) LuceneSail(org.eclipse.rdf4j.sail.lucene.LuceneSail) Sail(org.eclipse.rdf4j.sail.Sail) IntelligentGraphSail(com.inova8.intelligentgraph.sail.IntelligentGraphSail) IntelligentGraphFactory(com.inova8.intelligentgraph.sail.IntelligentGraphFactory) IntelligentGraphSail(com.inova8.intelligentgraph.sail.IntelligentGraphSail) File(java.io.File) IntelligentGraphConfig(com.inova8.intelligentgraph.sail.IntelligentGraphConfig)

Example 67 with Sail

use of org.eclipse.rdf4j.sail.Sail in project commons-rdf by apache.

the class NativeStoreGraphTest method createRepository.

public void createRepository() throws IOException {
    final Sail sail = new NativeStore(tempDir.newFolder());
    repository = new SailRepository(sail);
    repository.initialize();
}
Also used : SailRepository(org.eclipse.rdf4j.repository.sail.SailRepository) Sail(org.eclipse.rdf4j.sail.Sail) NativeStore(org.eclipse.rdf4j.sail.nativerdf.NativeStore)

Example 68 with Sail

use of org.eclipse.rdf4j.sail.Sail in project commons-rdf by apache.

the class RDF4J method createDataset.

/**
 * {@inheritDoc}
 * <p>
 * <strong>Note:</strong> Some operations on the {@link RDF4JDataset}
 * requires the use of try-with-resources to close underlying
 * {@link RepositoryConnection}s, including {@link RDF4JDataset#iterate()},
 * {@link RDF4JDataset#stream()} and {@link RDF4JDataset#getGraphNames()}.
 */
@Override
public RDF4JDataset createDataset() {
    final Sail sail = new MemoryStore();
    final Repository repository = new SailRepository(sail);
    return RDF4J.createRepositoryDatasetImpl(repository, true, false);
}
Also used : MemoryStore(org.eclipse.rdf4j.sail.memory.MemoryStore) Repository(org.eclipse.rdf4j.repository.Repository) SailRepository(org.eclipse.rdf4j.repository.sail.SailRepository) SailRepository(org.eclipse.rdf4j.repository.sail.SailRepository) Sail(org.eclipse.rdf4j.sail.Sail)

Aggregations

Sail (org.eclipse.rdf4j.sail.Sail)68 SailRepository (org.eclipse.rdf4j.repository.sail.SailRepository)49 SailRepositoryConnection (org.eclipse.rdf4j.repository.sail.SailRepositoryConnection)37 Test (org.junit.Test)33 AccumuloRdfConfiguration (org.apache.rya.accumulo.AccumuloRdfConfiguration)15 BindingSet (org.eclipse.rdf4j.query.BindingSet)13 TupleQueryResult (org.eclipse.rdf4j.query.TupleQueryResult)13 SailException (org.eclipse.rdf4j.sail.SailException)13 HashSet (java.util.HashSet)11 ValueFactory (org.eclipse.rdf4j.model.ValueFactory)11 SailConnection (org.eclipse.rdf4j.sail.SailConnection)11 RyaClient (org.apache.rya.api.client.RyaClient)9 ArrayList (java.util.ArrayList)8 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)8 Configuration (org.apache.hadoop.conf.Configuration)8 RyaClientException (org.apache.rya.api.client.RyaClientException)8 MongoDBRdfConfiguration (org.apache.rya.mongodb.MongoDBRdfConfiguration)7 RyaSailRepository (org.apache.rya.rdftriplestore.RyaSailRepository)7 MapBindingSet (org.eclipse.rdf4j.query.impl.MapBindingSet)7 RepositoryException (org.eclipse.rdf4j.repository.RepositoryException)7