franz inc logo  
  download learning center franz inc search franz inc resources franz inc          

allegrograph
racer
tbc
services
support
  Learning Center
  Documentation
  Updates
     Info
  FAQ
about

RSS Feeds

AllegroServe at opensource.franz.com

AGCreateTripleStore.java

package com.franz.ag.examples;

import com.franz.ag.*;

public class AGCreateTripleStore {

    /**
     * Demonstrates basics of creating a triple store
     * 
     * @param args unused
     * @throws AllegroGraphException
     */
    public static void main(String[] args) throws AllegroGraphException {
        
        // Connect to the server, which must already be running.
        AllegroGraphConnection ags = new AllegroGraphConnection();
        try {
            ags.enable();
        } catch (Exception e) {
            throw new AllegroGraphException("Server connection problem.", e);
        }

        // Create a triple store -- an exception is thrown if it already exists.
        System.out.println("Attempting to create a triple store.");
        try {
            AllegroGraph ts = ags.create("nonexistingstore", AGPaths.TRIPLE_STORES);
            System.out.println("Triple store created.");
        
            // Close the triple store
            System.out.println("Closing the triple store.");
            ts.closeTripleStore();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        
        // Disconnect from the server
        System.out.println("Disconnecting from the server.");
        ags.disable();
        System.out.println("Done.");
        
    }
    
}

Up | Next

 

© 2008 Franz Inc - Privacy Statement
[ Consulting Services | Franz | TopQuadrant | Racer Systems ]