use of org.eclipse.rdf4j.sail.nativerdf.NativeStore in project com.inova8.intelligentgraph by peterjohnlawrence.
the class GeoFactValueTest method setUpBeforeClass.
/**
* Sets the up before class.
*
* @throws Exception the exception
*/
@BeforeAll
static void setUpBeforeClass() throws Exception {
File dataDir = new File("src/test/resources/datadir/olgap/");
FileUtils.deleteDirectory(dataDir);
org.eclipse.rdf4j.repository.Repository workingRep = new SailRepository(new NativeStore(dataDir));
String dataFilename = "src/test/resources/calc2graph.data.ttl";
InputStream dataInput = new FileInputStream(dataFilename);
Model dataModel = Rio.parse(dataInput, "", RDFFormat.TURTLE);
conn = workingRep.getConnection();
conn.add(dataModel.getStatements(null, null, null));
String modelFilename = "src/test/resources/calc2graph.def.ttl";
InputStream modelInput = new FileInputStream(modelFilename);
Model modelModel = Rio.parse(modelInput, "", RDFFormat.TURTLE);
conn = workingRep.getConnection();
conn.add(modelModel.getStatements(null, null, null));
// String plantFilename = "src/test/resources/Plant.2d.def.ttl";
// InputStream plantInput = new FileInputStream(plantFilename);
// Model plantModel = Rio.parse(plantInput, "", RDFFormat.TURTLE);
// conn = workingRep.getConnection();
// conn.add(plantModel.getStatements(null, null, null));
}
use of org.eclipse.rdf4j.sail.nativerdf.NativeStore in project com.inova8.intelligentgraph by peterjohnlawrence.
the class FactDebugTest method setUpBeforeClass.
/**
* Sets the up before class.
*
* @throws Exception the exception
*/
@BeforeAll
static void setUpBeforeClass() throws Exception {
File dataDir = new File("src/test/resources/datadir/olgap/");
FileUtils.deleteDirectory(dataDir);
org.eclipse.rdf4j.repository.Repository workingRep = new SailRepository(new NativeStore(dataDir));
String modelFilename = "src/test/resources/calc2graph.data.ttl";
InputStream input = new FileInputStream(modelFilename);
Model model = Rio.parse(input, "", RDFFormat.TURTLE);
conn = workingRep.getConnection();
conn.add(model.getStatements(null, null, null));
}
use of org.eclipse.rdf4j.sail.nativerdf.NativeStore in project com.inova8.intelligentgraph by peterjohnlawrence.
the class FactProvenanceTest method setUpBeforeClass.
/**
* Sets the up before class.
*
* @throws Exception the exception
*/
@BeforeAll
static void setUpBeforeClass() throws Exception {
File dataDir = new File("src/test/resources/datadir/olgap/");
FileUtils.deleteDirectory(dataDir);
org.eclipse.rdf4j.repository.Repository workingRep = new SailRepository(new NativeStore(dataDir));
String modelFilename = "src/test/resources/calc2graph.data.ttl";
InputStream input = new FileInputStream(modelFilename);
Model model = Rio.parse(input, "", RDFFormat.TURTLE);
conn = workingRep.getConnection();
conn.add(model.getStatements(null, null, null));
}
use of org.eclipse.rdf4j.sail.nativerdf.NativeStore 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;
}
use of org.eclipse.rdf4j.sail.nativerdf.NativeStore in project com.inova8.intelligentgraph by peterjohnlawrence.
the class Query method createNativeRepository.
/**
* Creates the native 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 createNativeRepository(String dir) throws IOException, SailConfigException {
File dataDir = new File(dir);
FileUtils.deleteDirectory(dataDir);
Sail baseSail = new NativeStore(dataDir);
org.eclipse.rdf4j.repository.Repository workingRep = new SailRepository(baseSail);
return workingRep;
}
Aggregations