AGDuplicates.java
package com.franz.ag.examples;
import com.franz.ag.*;
public class AGDuplicates {
    
@param
@throws
    public static void main(String[] args) throws AllegroGraphException {
        
        AllegroGraphConnection ags = new AllegroGraphConnection();
        try {
            ags.enable();
        } catch (Exception e) {
            throw new AllegroGraphException("Server connection problem", e);
        }
        
        AllegroGraph ts = ags.renew("duplicates", AGPaths.TRIPLE_STORES);
        
        String ntripleFile = AGPaths.dataSources("test.nt");        
        System.out.println("Loading N-Triples from " + ntripleFile);
        Long n = ts.loadNTriples(ntripleFile);
        System.out.println("Loaded " + n + " triples.");
        
        
        System.out.println("Loading them again from " + ntripleFile);
        n = ts.loadNTriples(ntripleFile);
        System.out.println("Loaded another " + n + " triples, totaling: " + ts.numberOfTriples());
        
        Cursor cc = ts.getStatements(null, null, null);
        AGUtils.showTriples(cc);
        
        
        ts.closeTripleStore();
        ags.disable();
    }
}
Up | 
Next