Java Code Examples for com.bigdata.rdf.store.AbstractTripleStore#create()

The following examples show how to use com.bigdata.rdf.store.AbstractTripleStore#create() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestBigdataSailEmbeddedFederationWithQuads.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create/re-open the repository.
 */
private AbstractTripleStore openTripleStore(final String namespace,
        final Properties properties) {

    // locate the resource declaration (aka "open").
    AbstractTripleStore tripleStore = (AbstractTripleStore) fed
            .getResourceLocator().locate(namespace, ITx.UNISOLATED);

    if (tripleStore == null) {

        /*
         * Does not exist, so create it now.
         */
        tripleStore = new ScaleOutTripleStore(fed, namespace,
                ITx.UNISOLATED, properties);

        // create the triple store.
        tripleStore.create();

    }

    return tripleStore;

}
 
Example 2
Source File: BigdataEmbeddedFederationSparqlTest.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create/re-open the repository.
 */
private AbstractTripleStore openTripleStore(final String namespace,
        final Properties properties) {

    // locate the resource declaration (aka "open").
    AbstractTripleStore tripleStore = (AbstractTripleStore) fed
            .getResourceLocator().locate(namespace, ITx.UNISOLATED);

    if (tripleStore == null) {

        /*
         * Does not exist, so create it now.
         */
        tripleStore = new ScaleOutTripleStore(fed, namespace,
                ITx.UNISOLATED, properties);

        // create the triple store.
        tripleStore.create();

    }

    return tripleStore;

}
 
Example 3
Source File: TestMockUtility.java    From database with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a mocked local triple (memory) store with the given namespace,
 * with unisolated transactions.
 * 
 * @param namespace
 * @return
 */
public static AbstractTripleStore mockTripleStore(final String namespace) {
   
   final Properties properties = new Properties();
   properties.setProperty(
      com.bigdata.journal.Options.BUFFER_MODE,BufferMode.MemStore.name());
   
   final Journal store = new Journal(properties);

   final AbstractTripleStore kb = new LocalTripleStore(
      store, namespace, ITx.UNISOLATED, properties);
   
   kb.create();
   store.commit();
         
   return kb;
       
}
 
Example 4
Source File: TestNativeDistinctFilter.java    From database with GNU General Public License v2.0 4 votes vote down vote up
public JoinSetup(final String kbNamespace) {

            if (kbNamespace == null)
                throw new IllegalArgumentException();
            
            final Properties properties = new Properties();

            properties.setProperty(Journal.Options.BUFFER_MODE,
                    BufferMode.Transient.toString());
            
            jnl = new Journal(properties);

            // create the kb.
            final AbstractTripleStore kb = new LocalTripleStore(jnl,
                    kbNamespace, ITx.UNISOLATED, properties);

            kb.create();

            this.spoNamespace = kb.getSPORelation().getNamespace();

            // Setup the vocabulary.
            {
                final BigdataValueFactory vf = kb.getValueFactory();
                final String uriString = "http://bigdata.com/";
                final BigdataURI _knows = vf.asValue(FOAFVocabularyDecl.knows);
                final BigdataURI _brad = vf.createURI(uriString+"brad");
                final BigdataURI _john = vf.createURI(uriString+"john");
                final BigdataURI _fred = vf.createURI(uriString+"fred");
                final BigdataURI _mary = vf.createURI(uriString+"mary");
                final BigdataURI _paul = vf.createURI(uriString+"paul");
                final BigdataURI _leon = vf.createURI(uriString+"leon");
                final BigdataURI _luke = vf.createURI(uriString+"luke");

                final BigdataValue[] a = new BigdataValue[] {
                      _knows,//
                      _brad,
                      _john,
                      _fred,
                      _mary,
                      _paul,
                      _leon,
                      _luke
                };

                kb.getLexiconRelation()
                        .addTerms(a, a.length, false/* readOnly */);

                knows = _knows.getIV();
                brad = _brad.getIV();
                john = _john.getIV();
                fred = _fred.getIV();
                mary = _mary.getIV();
                paul = _paul.getIV();
                leon = _leon.getIV();
                luke = _luke.getIV();

            }

//            // data to insert (in key order for convenience).
//            final SPO[] a = {//
//                    new SPO(paul, knows, mary, StatementEnum.Explicit),// [0]
//                    new SPO(paul, knows, brad, StatementEnum.Explicit),// [1]
//                    
//                    new SPO(john, knows, mary, StatementEnum.Explicit),// [2]
//                    new SPO(john, knows, brad, StatementEnum.Explicit),// [3]
//                    
//                    new SPO(mary, knows, brad, StatementEnum.Explicit),// [4]
//                    
//                    new SPO(brad, knows, fred, StatementEnum.Explicit),// [5]
//                    new SPO(brad, knows, leon, StatementEnum.Explicit),// [6]
//            };
//
//            // insert data (the records are not pre-sorted).
//            kb.addStatements(a, a.length);
//
//            // Do commit since not scale-out.
//            jnl.commit();

        }