Examples of MemoryStore


Examples of org.openrdf.sail.memory.MemoryStore

  {
    // Create test suite
    TestSuite suite = new TestSuite(TriGParserTestCase.class.getName());

    // Add the manifest for positive test cases to a repository and query it
    Repository repository = new SailRepository(new MemoryStore());
    repository.initialize();
    RepositoryConnection con = repository.getConnection();

    URL url = TriGParserTestCase.class.getResource(MANIFEST_GOOD_URL);
    con.add(url, base(url.toExternalForm()), RDFFormat.TURTLE);
View Full Code Here

Examples of org.openrdf.sail.memory.MemoryStore

  }

  public void testWrite()
    throws StoreException, RDFParseException, IOException, RDFHandlerException
  {
    Repository rep1 = new SailRepository(new MemoryStore());
    rep1.initialize();

    RepositoryConnection con1 = rep1.getConnection();

    URL ciaScheme = this.getClass().getResource("/cia-factbook/CIA-onto-enhanced.rdf");
    URL ciaFacts = this.getClass().getResource("/cia-factbook/CIA-facts-enhanced.rdf");

    con1.add(ciaScheme, ciaScheme.toExternalForm(), RDFFormat.forFileName(ciaScheme.toExternalForm()));
    con1.add(ciaFacts, ciaFacts.toExternalForm(), RDFFormat.forFileName(ciaFacts.toExternalForm()));

    StringWriter writer = new StringWriter();
    RDFWriter rdfWriter = rdfWriterFactory.getWriter(writer);
    con1.export(rdfWriter);

    long before = con1.size();
    con1.close();

    Repository rep2 = new SailRepository(new MemoryStore());
    rep2.initialize();

    RepositoryConnection con2 = rep2.getConnection();

    con2.add(new StringReader(writer.toString()), "foo:bar", rdfWriterFactory.getRDFFormat());
View Full Code Here

Examples of org.openrdf.sail.memory.MemoryStore

  }

  public void testRelativeWrite()
    throws StoreException, RDFParseException, IOException, RDFHandlerException
  {
    Repository rep1 = new SailRepository(new MemoryStore());
    rep1.initialize();

    RepositoryConnection con1 = rep1.getConnection();

    URL ciaScheme = this.getClass().getResource("/cia-factbook/CIA-onto-enhanced.rdf");
    URL ciaFacts = this.getClass().getResource("/cia-factbook/CIA-facts-enhanced.rdf");

    con1.add(ciaScheme, ciaScheme.toExternalForm(), RDFFormat.forFileName(ciaScheme.toExternalForm()));
    con1.add(ciaFacts, ciaFacts.toExternalForm(), RDFFormat.forFileName(ciaFacts.toExternalForm()));

    StringWriter writer = new StringWriter();
    RDFWriter rdfWriter = rdfWriterFactory.getWriter(writer);
    rdfWriter.setBaseURI(ciaFacts.toExternalForm());
    con1.export(rdfWriter);

    long before = con1.size();
    con1.close();

    Repository rep2 = new SailRepository(new MemoryStore());
    rep2.initialize();

    RepositoryConnection con2 = rep2.getConnection();

    con2.add(new StringReader(writer.toString()), ciaFacts.toExternalForm(),
View Full Code Here

Examples of org.openrdf.sail.memory.MemoryStore

  {
    // Create test suite
    TestSuite suite = new TestSuite(N3ParserTestCase.class.getName());

    // Add the manifest to a repository and query it
    Repository repository = new SailRepository(new MemoryStore());
    repository.initialize();
    RepositoryConnection con = repository.getConnection();

    URL url = url(MANIFEST_URL);
    con.add(url, base(MANIFEST_URL), RDFFormat.TURTLE);
View Full Code Here

Examples of org.openrdf.sail.memory.MemoryStore

    String outputURL = inputURL;
    String baseURL = NTRIPLES_TEST_URL;
    suite.addTest(new PositiveParserTest(testName, inputURL, outputURL, baseURL));

    // Add the manifest for positive test cases to a repository and query it
    Repository repository = new SailRepository(new MemoryStore());
    repository.initialize();
    RepositoryConnection con = repository.getConnection();

    url = TurtleParserTestCase.class.getResource(MANIFEST_GOOD_URL);
    con.add(url, base(url.toExternalForm()), RDFFormat.TURTLE);
View Full Code Here

Examples of org.openrdf.sail.memory.MemoryStore

  public TestSuite createTestSuite()
    throws Exception
  {
    // Create an RDF repository for the manifest data
    Repository repository = new SailRepository(new MemoryStore());
    repository.initialize();
    RepositoryConnection con = repository.getConnection();

    // Add W3C's manifest
    URL w3cManifest = resolveURL(W3C_MANIFEST_FILE);
View Full Code Here

Examples of org.openrdf.sail.memory.MemoryStore

  protected static Resource asserterNode;

  public static void main(String[] args)
    throws Exception
  {
    earlRepository = new SailRepository(new MemoryStore());
    earlRepository.initialize();
    con = earlRepository.getConnection();
    vf = con.getValueFactory();
    con.begin();
View Full Code Here

Examples of org.openrdf.sail.memory.MemoryStore

  {
    super(testURI, name, queryFileURL, resultFileURL, dataSet, laxCardinality);
  }

  protected Repository newRepository() {
    return new SailRepository(new DatasetSail(new MemoryStore()));
  }
View Full Code Here

Examples of org.openrdf.sail.memory.MemoryStore

    return QueryLanguage.SERQL;
  }

  @Override
  protected NotifyingSail newSail() {
    return new MemoryStore();
  }
View Full Code Here

Examples of org.openrdf.sail.memory.MemoryStore

  public static TestSuite suite(SPARQLQueryTest.Factory factory)
    throws Exception
  {
    TestSuite suite = new TestSuite(factory.getClass().getName());

    Repository manifestRep = new SailRepository(new MemoryStore());
    manifestRep.initialize();
    RepositoryConnection con = manifestRep.getConnection();

    addTurtle(con, new URL(MANIFEST_FILE), MANIFEST_FILE);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.