Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.ModelMaker


        if (s_reload) {

            // we pass cleanDB=true to clear out existing models
            // NOTE: this will remove ALL Jena models from the named persistent store, so
            // use with care if you have existing data stored
            ModelMaker maker = po.getRDBMaker( s_dbURL, s_dbUser, s_dbPw, s_dbType, true );

            // now load the source data into the newly cleaned db
            po.loadDB( maker, s_source );
        }

        // now we list the classes in the database, to show that the persistence worked
        ModelMaker maker = po.getRDBMaker( s_dbURL, s_dbUser, s_dbPw, s_dbType, false );
        po.listClasses( maker, s_source );
    }
View Full Code Here


    } else if(backend.equalsIgnoreCase(FILE)) {
      String filename = p.getProperty(FILENAME);
      if(filename == null) {
        throw new RuntimeException("Please specify a filename in your property file!");
      }
      ModelMaker maker = getFileModelMaker(filename);
      model = maker.createDefaultModel();
    } else {
      throw new IllegalArgumentException("Illegal back-end type: " + backend);
    }
   
    // reasoning
View Full Code Here

    String dbUrl = "jdbc:mysql://" + hostName + "/" + dbName;
    // create a database connection
    IDBConnection conn = new DBConnection(dbUrl, userName, password, "MySQL");

    // create a model maker with the given connection parameters
    ModelMaker maker = ModelFactory.createModelRDBMaker(conn);

    ModelRDB model = (ModelRDB) maker.openModel(modelName);
    InputStream file = new FileInputStream(rdfFileName);
    model.read(file,null,"N3");
    file.close();
  }
View Full Code Here

    String jdbcType = "Derby";

    // Create database connection
    LOGGER.debug("Creating RDB database with URL " + jdbcUrl);
    IDBConnection conn = new DBConnection(jdbcUrl, jdbcUser, jdbcPassword, jdbcType);
    ModelMaker maker = ModelFactory.createModelRDBMaker(conn);

    // create or open the default model
    Model model = maker.createDefaultModel();

    return model;
  }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.ModelMaker

Copyright © 2018 www.massapicom. 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.