Package org.openrdf.sail.memory

Examples of org.openrdf.sail.memory.MemoryStore


    assertTrue("Repository should contain newly added statement", testCon.hasStatement(statement, false));
    assertTrue("Repository should contain newly added statement", testCon.hasMatch(alice, name, nameAlice,
        false));

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

    con.add(testCon.match(null, null, null, false));
View Full Code Here


  {
    if (!SAIL_TYPE.equals(config.getType())) {
      throw new StoreConfigException("Invalid Sail type: " + config.getType());
    }

    MemoryStore memoryStore = new MemoryStore();

    if (config instanceof MemoryStoreConfig) {
      MemoryStoreConfig memConfig = (MemoryStoreConfig)config;

      memoryStore.setPersist(memConfig.getPersist());
      memoryStore.setSyncDelay(memConfig.getSyncDelay());
    }

    return memoryStore;
  }
View Full Code Here

  private RDFWriterFactory rdfWriterFactory = new RDFaWriterFactory();

  public void test()
    throws Exception
  {
    Repository rep1 = new SailRepository(new MemoryStore());
    rep1.initialize();

    RepositoryConnection con1 = rep1.getConnection();

    URL rdf = this.getClass().getResource("/testcases/rdfa-test.rdf");

    con1.add(rdf, rdf.toExternalForm(), RDFFormat.forFileName(rdf.toExternalForm()));

    StringWriter writer = new StringWriter();
    RDFWriter rdfWriter = rdfWriterFactory.getWriter(writer);
    rdfWriter.setBaseURI(rdf.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()), rdf.toExternalForm(), rdfWriterFactory.getRDFFormat());
View Full Code Here

      "}";

    public DataStoreModel()
  {
 
    _repository = new SailRepository(new ForwardChainingRDFSInferencer(new MemoryStore()));
   
        try {
            _repository.initialize();
            con = _repository.getConnection();
        } catch (RepositoryException e) {
View Full Code Here

     * @throws Exception
     */
    @Before
    public void setUp() throws Exception {
        super.setUp();
        Sail store = new MemoryStore();
        store.initialize();
        conn = new SailRepository(store).getConnection();
    }
View Full Code Here

        Any23 any23;
        RepositoryConnection conn;
        RepositoryWriter repositoryWriter;
       
        any23 = new Any23();
        Sail store = new MemoryStore();
        store.initialize();
        conn = new SailRepository(store).getConnection();
        repositoryWriter = new RepositoryWriter(conn);
        Assert.assertTrue( any23.extract(fileDocumentSource, repositoryWriter, encoding).hasMatchingExtractors() );

        RepositoryResult<Statement> statements = conn.getStatements(null, vDCTERMS.title, null, false);
View Full Code Here

    @Before
    public void setUp() throws Exception {
        super.setUp();
        extractorGroup = ExtractorRegistryImpl.getInstance().getExtractorGroup();
        store = new MemoryStore();
        store.initialize();
        conn = new SailRepository(store).getConnection();
    }
View Full Code Here

  @Override
  public long prepareInputData(final Collection<URILiteral> defaultGraphs,
      final Collection<URILiteral> namedGraphs) throws Exception {
    final Date a = new Date();
    NotifyingSail sailStack = new MemoryStore();

    if (ontology == ONTOLOGY.RDFS)
      sailStack = new ForwardChainingRDFSInferencer(sailStack);

    repo = new SailRepository(sailStack);
View Full Code Here

  }

  @Override
  @Test
  public void testRemoveAll() throws Exception {
    Repository repo = new SailRepository(new MemoryStore());
    repo.initialize();
    RepositoryModelSet modelSet = new RepositoryModelSet(repo);
    modelSet.open();
    URI context1 = new URIImpl("uri:context1");
    URI context2 = new URIImpl("uri:context2");
View Full Code Here

    URI a = new URIImpl("urn:rel:a");
    URI b = new URIImpl("urn:rel:b");
    URI c = new URIImpl("urn:rel:c");
    URI defaultContext = null;
    // create a Sail stack
    Sail sail = new MemoryStore();
    sail = new ForwardChainingRDFSInferencer(sail);
    // create a Repository
    Repository repository = new SailRepository(sail);
    repository.initialize();
View Full Code Here

TOP

Related Classes of org.openrdf.sail.memory.MemoryStore

Copyright © 2018 www.massapicom. 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.