Details

      Description

      BigdataGraphFactory.create method is not working for new file-backed graphs. It appears to work, but really creates an in-memory graph.

      The workaround is to create a SAIL directly for embedded graph usage.

      public BigdataSailRepository getOrCreateRepository(String journalFile) {
      
      		final java.util.Properties props = new java.util.Properties();
      		BigdataSailRepository repo = null;
      
      		/*
      		 * Lax edges allows us to use non-unique edge identifiers
      		 */
      		props.setProperty(BigdataGraph.Options.LAX_EDGES, "true");
      
      		/*
      		 * SPARQL bottom up evaluation semantics can have performance impact.
      		 */
      		props.setProperty(AbstractTripleStore.Options.BOTTOM_UP_EVALUATION,
      				"false");
      
      		if (journalFile == null || !new File(journalFile).exists()) {
      
      			/*
      			 * No journal specified or journal does not exist yet at specified
      			 * location. Create a new store. (If journal== null an in-memory
      			 * store will be created.
      			 */
      			repo = BigdataSailFactory.createRepository(props, journalFile,
      					Option.TextIndex);
      
      		} else {
      
      			/*
      			 * Journal already exists at specified location. Open existing
      			 * store.
      			 */
      			repo = BigdataSailFactory.openRepository(journalFile);
      
      		}
      		
      		try {
      			repo.initialize();
      		} catch (RepositoryException e) {
      			// TODO Auto-generated catch block
      			e.printStackTrace();
      		}
      		
      		return repo;
      	}
      
              public void testGraph()
              {
                      BigdataGraph testGraph = new BigdataGraphEmbedded(getOrCreateRepository("/tmp/some/file"));
              }
      
      
      

        Activity

          People

          • Assignee:
            beebs Brad Bebee
            Reporter:
            beebs Brad Bebee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: