Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.hp.hpl.jena.util
Class ModelLoader

    java.lang.Object
      com.hp.hpl.jena.util.ModelLoader

    public class ModelLoader

extends java.lang.Object

A set of static convenience methods for getting models The loader will guess the language/type of the model using `guessLang`

Version:
  $Id: ModelLoader.java,v 1.28 2008/01/02 12:07:44 andy_seaborne Exp $
Author:
  Andy Seaborne

Field Summary
`static java.lang.String` | `langBDB` Deprecated. Use FileUtils.langBDB
`static java.lang.String` | `langN3` Deprecated. Use FileUtils.langN3
`static java.lang.String` | `langNTriple` Deprecated. Use FileUtils.langNTriple
`static java.lang.String` | `langSQL` Deprecated. Use FileUtils.langSQL
`static java.lang.String` | `langXML` Deprecated. Use FileUtils.FileUtils.langXML
`static java.lang.String` | `langXMLAbbrev` Deprecated. Use FileUtils.langXMLAbbrev

Constructor Summary
`ModelLoader()`

Method Summary
`static Model` | `connectToDB(java.lang.String urlStr, java.lang.String dbUser, java.lang.String dbPassword, java.lang.String modelName, java.lang.String dbType, java.lang.String driverName)` Connect to a database.
`static java.lang.String` | `guessLang(java.lang.String urlStr)` Deprecated. Use FileUtils.guessLang
`static java.lang.String` | `guessLang(java.lang.String urlStr, java.lang.String defaultLang)` Deprecated. Use FileUtils.guessLang
`static Model` | `loadModel(Model model, java.lang.String urlStr)` Deprecated. Use FileManager.get().readModel(model, urlStr) instead
`static Model` | `loadModel(Model model, java.lang.String urlStr, java.lang.String lang)` Deprecated. Use FileManager.get().readModel(model, urlStr, lang) instead
`static Model` | `loadModel(java.lang.String urlStr)` Deprecated. Use FileManager.get().loadModel(urlStr)
`static Model` | `loadModel(java.lang.String urlStr, java.lang.String lang)` Deprecated. Use FileManager.get().loadModel(urlStr, lang)
`static Model` | `loadModel(java.lang.String urlStr, java.lang.String lang, java.lang.String dbUser, java.lang.String dbPassword, java.lang.String modelName, java.lang.String dbType, java.lang.String driver)` Load a model or attached a persistent store.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### langXML

    public static final java.lang.String langXML

  Deprecated. Use FileUtils.FileUtils.langXML
  See Also:
    Constant Field Values

### langXMLAbbrev

    public static final java.lang.String langXMLAbbrev

  Deprecated. Use FileUtils.langXMLAbbrev
  See Also:
    Constant Field Values

### langNTriple

    public static final java.lang.String langNTriple

  Deprecated. Use FileUtils.langNTriple
  See Also:
    Constant Field Values

### langN3

    public static final java.lang.String langN3

  Deprecated. Use FileUtils.langN3
  See Also:
    Constant Field Values

### langBDB

    public static final java.lang.String langBDB

  Deprecated. Use FileUtils.langBDB
  See Also:
    Constant Field Values

### langSQL

    public static final java.lang.String langSQL

  Deprecated. Use FileUtils.langSQL
  See Also:
    Constant Field Values

Constructor Detail

### ModelLoader

    public ModelLoader()

Method Detail

### loadModel

    public static Model loadModel(java.lang.String urlStr)

  Deprecated. Use FileManager.get().loadModel(urlStr)

  Load a model

  Parameters:
    `urlStr` - The URL or file name of the model

### loadModel

    public static Model loadModel(java.lang.String urlStr,
                                  java.lang.String lang)

  Deprecated. Use FileManager.get().loadModel(urlStr, lang)

  Load a model or attached a persistent store (but not a database).

  Parameters:
    `urlStr` - The URL or file name of the model
    `lang` - The language of the data - if null, the system guesses

### loadModel

    public static Model loadModel(java.lang.String urlStr,
                                  java.lang.String lang,
                                  java.lang.String dbUser,
                                  java.lang.String dbPassword,
                                  java.lang.String modelName,
                                  java.lang.String dbType,
                                  java.lang.String driver)

  Load a model or attached a persistent store. Tries to guess syntax type. Database paramters only needed if its a database.

  Parameters:
    `urlStr` - The URL or file name of the model
    `lang` - The language of the data - if null, the system guesses
    `dbUser` - Database user name (for RDB/JDBC)
    `dbPassword` - Database password (for RDB/JDBC)
    `modelName` - The name of the model
    `dbType` - Database type (e.g. MySQL)
    `driver` - JDBC driver to load.
  Returns:
    Model

### loadModel

    public static Model loadModel(Model model,
                                  java.lang.String urlStr)

  Deprecated. Use FileManager.get().readModel(model, urlStr) instead

  Load a model from a file into a model.

  Parameters:
    `model` - Model to read into
    `urlStr` - URL (or filename) to read from
  Returns:
    Returns the model passed in.

### loadModel

    public static Model loadModel(Model model,
                                  java.lang.String urlStr,
                                  java.lang.String lang)

  Deprecated. Use FileManager.get().readModel(model, urlStr, lang) instead

  Load a model from a file into a model.

  Parameters:
    `model` - Model to read into
    `urlStr` - URL (or filename) to read from
    `lang` - Null mean guess based on the URI String
  Returns:
    Returns the model passed in.

### connectToDB

    public static Model connectToDB(java.lang.String urlStr,
                                    java.lang.String dbUser,
                                    java.lang.String dbPassword,
                                    java.lang.String modelName,
                                    java.lang.String dbType,
                                    java.lang.String driverName)

  Connect to a database.

  Parameters:
    `urlStr` -
    `dbUser` -
    `dbPassword` -
    `dbType` -
    `driverName` - Load this driver (if not null)
  Returns:
    Model

### guessLang

    public static java.lang.String guessLang(java.lang.String urlStr,
                                             java.lang.String defaultLang)

  Deprecated. Use FileUtils.guessLang

  Guess the language/type of model data. Updated by Chris, hived off the model-suffix part to FileUtils as part of unifying it with similar code in FileGraph.
  - If the URI of the model starts jdbc: it is assumed to be an RDB model
  - If the URI ends ".rdf", it is assumed to be RDF/XML
  - If the URI end .nt, it is assumed to be N-Triples
  - If the URI end .bdb, it is assumed to be BerkeleyDB model [suppressed at present]

  Parameters:
    `urlStr` - URL to base the guess on
    `defaultLang` - Default guess
  Returns:
    String Guessed syntax - or the default supplied

### guessLang

    public static java.lang.String guessLang(java.lang.String urlStr)

  Deprecated. Use FileUtils.guessLang

  Guess the language/type of model data
  - If the URI of the model starts jdbc: it is assumed to be an RDB model
  - If the URI ends ".rdf", it is assumed to be RDF/XML
  - If the URI end .nt, it is assumed to be N-Triples
  - If the URI end .bdb, it is assumed to be BerkeleyDB model

  Parameters:
    `urlStr` - URL to base the guess on
  Returns:
    String Guessed syntax - null for no guess.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP