Package com.hp.hpl.jena.util

Examples of com.hp.hpl.jena.util.FileManager.open()


public class ExampleTDB_02 {

    public static void main(String[] args) {
        FileManager fm = FileManager.get();
        fm.addLocatorClassLoader(ExampleTDB_02.class.getClassLoader());
        InputStream in = fm.open("data/data.nt");

        Location location = new Location ("target/TDB");

        // Load some initial data
        TDBLoader.load(TDBInternal.getBaseDatasetGraphTDB(TDBFactory.createDatasetGraph(location)), in, false);
View Full Code Here


public class ExampleLARQ_01 {

  public static void main(String[] args) throws CorruptIndexException, IOException {
        FileManager fm = FileManager.get();
        fm.addLocatorClassLoader(ExampleTDB_01.class.getClassLoader());
        InputStream in = fm.open("data/data.nt");

        Location location = new Location ("tmp/TDB");
        // build the Lucene index when pointed to a non existing directory
        DatasetGraphTDB dsg = (DatasetGraphTDB)TDBFactory.createDatasetGraph(location);
View Full Code Here

public class ExampleTDB_03 {

    public static void main(String[] args) {
        FileManager fm = FileManager.get();
        fm.addLocatorClassLoader(ExampleTDB_03.class.getClassLoader());
        InputStream in = fm.open("data/data.nt");

        Location location = new Location ("target/TDB");
        Dataset dataset = TDBFactory.createDataset(location);
        dataset.begin(ReadWrite.WRITE);
        try {
View Full Code Here

public class ExampleTDB_01 {

    public static void main(String[] args) {
        FileManager fm = FileManager.get();
        fm.addLocatorClassLoader(ExampleTDB_01.class.getClassLoader());
        InputStream in = fm.open("data/data.nt");

        Location location = new Location ("target/TDB");

        // Load some initial data
        TDBLoader.load(TDBInternal.getBaseDatasetGraphTDB(TDBFactory.createDatasetGraph(location)), in, false);
View Full Code Here

public class ExampleTDB_04 {

    public static void main(String[] args) {
        FileManager fm = FileManager.get();
        fm.addLocatorClassLoader(ExampleTDB_04.class.getClassLoader());
        InputStream in = fm.open("data/data.nt");

        DatasetGraphTDB dsg =  TDBInternal.getBaseDatasetGraphTDB(TDBFactory.createDatasetGraph());

        GraphListener listener = new MyListener();
        dsg.getDefaultGraph().getEventManager().register(listener);
View Full Code Here

        // this sends events to the GraphListener
        Model model = ModelFactory.createModelForGraph(dsg.getDefaultGraph()) ;
        model.add(ResourceFactory.createProperty("foo:x1"), RDFS.label, "X1");

        // this does it too
        in = fm.open("data/data.nt");
        model.read(in, "", "N-TRIPLES");

        dsg.close();
    }
View Full Code Here

public class ExampleLARQ_02 {

  public static void main(String[] args) throws Exception {
        FileManager fm = FileManager.get();
        fm.addLocatorClassLoader(ExampleTDB_01.class.getClassLoader());
        InputStream in = fm.open("data/data.nt");
               
        Location location = new Location ("tmp/TDB");
        DatasetGraphTDB dsg = (DatasetGraphTDB)TDBFactory.createDatasetGraph(location);

        TDBLoader.load(dsg, in, false); // load data into TDB
View Full Code Here

    public void testFileManagerFileLocator()
    {
        FileManager fileManager = new FileManager() ;
        fileManager.addLocatorFile() ;
        InputStream in = fileManager.open(testingDir+"/"+filename) ;
        assertNotNull(in) ;
        closeInputStream(in) ;
    }

    public void testFileManagerFileLocatorWithDir()
View Full Code Here

    public void testFileManagerFileLocatorWithDir()
    {
        FileManager fileManager = new FileManager() ;
        fileManager.addLocatorFile(testingDir) ;
        InputStream in = fileManager.open(filename) ;
        assertNotNull(in) ;
        closeInputStream(in) ;
    }

View Full Code Here

    {
        FileManager fileManager = new FileManager() ;
        fileManager.addLocatorFile() ;
        try {
            // Tests either way round - exception or a null return.
            InputStream in = fileManager.open(filenameNonExistent) ;
            closeInputStream(in) ;
            assertNull("Found non-existant file: "+filenameNonExistent, in) ;
        } catch (NotFoundException ex) {}
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.