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

AGIndexFlavors.java

package com.franz.ag.examples;

import com.franz.ag.*;

public class AGIndexFlavors {

    /**
     * Demonstrates managing which indices will be available in 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
        AllegroGraph ts = ags.renew("indexflavors", AGPaths.TRIPLE_STORES);
        
        // Show the currently managed indices
        String[] origflavors = ts.getIndexFlavors();
        AGUtils.printStringArray("original IndexFlavors: ", origflavors);
        
        // Now manage only a single index for the store
        ts.setIndexFlavors(new String[]{"spogi"});
        AGUtils.printStringArray("new IndexFlavors: ", ts.getIndexFlavors());
        
        // Reestablish the original index settings
        ts.setIndexFlavors(origflavors);
        AGUtils.printStringArray("Reestablish original IndexFlavors: ", ts.getIndexFlavors());
        
        // Close the triple store and disconnect from the server
        ts.closeTripleStore();
        ags.disable();
    }
}

Up | Next

 

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