Search in sources :

Example 1 with IntelligentGraphConfig

use of com.inova8.intelligentgraph.sail.IntelligentGraphConfig in project com.inova8.intelligentgraph by peterjohnlawrence.

the class Query method createNativeLuceneIntelligentGraphRepository.

/**
 * Creates the native lucene 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 createNativeLuceneIntelligentGraphRepository(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);
    // IntelligentGraphSail intelligentGraphSail = new IntelligentGraphSail();
    LuceneSail lucenesail = new LuceneSail();
    lucenesail.setParameter(LuceneSail.LUCENE_RAMDIR_KEY, "true");
    Sail baseSail = new NativeStore(dataDir);
    lucenesail.setBaseSail(baseSail);
    intelligentGraphSail.setBaseSail(lucenesail);
    org.eclipse.rdf4j.repository.Repository workingRep = new SailRepository(intelligentGraphSail);
    return workingRep;
}
Also used : 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) LuceneSail(org.eclipse.rdf4j.sail.lucene.LuceneSail) NativeStore(org.eclipse.rdf4j.sail.nativerdf.NativeStore) IntelligentGraphFactory(com.inova8.intelligentgraph.sail.IntelligentGraphFactory) IntelligentGraphSail(com.inova8.intelligentgraph.sail.IntelligentGraphSail) File(java.io.File) IntelligentGraphConfig(com.inova8.intelligentgraph.sail.IntelligentGraphConfig)

Example 2 with IntelligentGraphConfig

use of com.inova8.intelligentgraph.sail.IntelligentGraphConfig in project com.inova8.intelligentgraph by peterjohnlawrence.

the class Query method createNativeIntelligentGraphRepository.

/**
 * Creates the native 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 createNativeIntelligentGraphRepository(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);
    // IntelligentGraphSail intelligentGraphSail = new IntelligentGraphSail();
    Sail baseSail = new NativeStore(dataDir);
    intelligentGraphSail.setBaseSail(baseSail);
    org.eclipse.rdf4j.repository.Repository workingRep = new SailRepository(intelligentGraphSail);
    return workingRep;
}
Also used : 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) NativeStore(org.eclipse.rdf4j.sail.nativerdf.NativeStore) IntelligentGraphFactory(com.inova8.intelligentgraph.sail.IntelligentGraphFactory) IntelligentGraphSail(com.inova8.intelligentgraph.sail.IntelligentGraphSail) File(java.io.File) IntelligentGraphConfig(com.inova8.intelligentgraph.sail.IntelligentGraphConfig)

Example 3 with IntelligentGraphConfig

use of com.inova8.intelligentgraph.sail.IntelligentGraphConfig 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)

Aggregations

IntelligentGraphConfig (com.inova8.intelligentgraph.sail.IntelligentGraphConfig)3 IntelligentGraphFactory (com.inova8.intelligentgraph.sail.IntelligentGraphFactory)3 IntelligentGraphSail (com.inova8.intelligentgraph.sail.IntelligentGraphSail)3 File (java.io.File)3 SailRepository (org.eclipse.rdf4j.repository.sail.SailRepository)3 Sail (org.eclipse.rdf4j.sail.Sail)3 LuceneSail (org.eclipse.rdf4j.sail.lucene.LuceneSail)3 NativeStore (org.eclipse.rdf4j.sail.nativerdf.NativeStore)2 MemoryStore (org.eclipse.rdf4j.sail.memory.MemoryStore)1