org.mindswap.pellet.jena.graph.loader
Class DefaultGraphLoader

java.lang.Object
  extended by org.mindswap.pellet.jena.graph.loader.DefaultGraphLoader
All Implemented Interfaces:
GraphLoader

public class DefaultGraphLoader
extends java.lang.Object
implements GraphLoader

Title:

Description:

Copyright: Copyright (c) 2008

Company: Clark & Parsia, LLC.

Author:
Evren Sirin

Field Summary
static java.util.logging.Logger log
           
static QNameProvider qnames
           
 
Constructor Summary
DefaultGraphLoader()
           
 
Method Summary
 void clear()
          Clear all internal caches (essentially used for mapping bnodes to ATerm structures)
 com.hp.hpl.jena.graph.Graph getGraph()
          Get the Jena graph used in the loader.
 java.util.Set<java.lang.String> getUnpportedFeatures()
          Returns the unsupported axioms ignored by the loader.
 boolean isLoadABox()
          Returns if the loader will load the Abox triples.
 boolean isPreprocessTypeTriples()
          Returns if the loader will preprocess rdf:type triples.
 void load(java.lang.Iterable<com.hp.hpl.jena.graph.Graph> graphs)
          Load the axioms from the Jena graphs to the given KB.
 aterm.ATermAppl node2term(com.hp.hpl.jena.graph.Node node)
          Translate the given graph node into an ATerm object.
 void preprocess()
          Do the preprocessing steps necessary to cache any information that will be used for loading.
 void setGraph(com.hp.hpl.jena.graph.Graph graph)
          Set the graph that will be used during loading.
 void setKB(KnowledgeBase kb)
           
 void setLoadABox(boolean loadABox)
          Sets the flag that tells the loader to skip ABox (instance) statements.
 void setPreprocessTypeTriples(boolean preprocessTypeTriples)
          This option forces the loader to process type triples before processing other triples.
 void setProgressMonitor(ProgressMonitor monitor)
          Set the progress monitor that will show the load progress.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final java.util.logging.Logger log

qnames

public static QNameProvider qnames
Constructor Detail

DefaultGraphLoader

public DefaultGraphLoader()
Method Detail

setProgressMonitor

public void setProgressMonitor(ProgressMonitor monitor)
Set the progress monitor that will show the load progress.

Specified by:
setProgressMonitor in interface GraphLoader

setGraph

public void setGraph(com.hp.hpl.jena.graph.Graph graph)
Set the graph that will be used during loading.

Specified by:
setGraph in interface GraphLoader

getGraph

public com.hp.hpl.jena.graph.Graph getGraph()
Get the Jena graph used in the loader.

Specified by:
getGraph in interface GraphLoader
Returns:

getUnpportedFeatures

public java.util.Set<java.lang.String> getUnpportedFeatures()
Returns the unsupported axioms ignored by the loader.

Specified by:
getUnpportedFeatures in interface GraphLoader
Returns:

clear

public void clear()
Clear all internal caches (essentially used for mapping bnodes to ATerm structures)

Specified by:
clear in interface GraphLoader

node2term

public aterm.ATermAppl node2term(com.hp.hpl.jena.graph.Node node)
Translate the given graph node into an ATerm object.

Specified by:
node2term in interface GraphLoader
Returns:

setKB

public void setKB(KnowledgeBase kb)
Specified by:
setKB in interface GraphLoader

load

public void load(java.lang.Iterable<com.hp.hpl.jena.graph.Graph> graphs)
          throws UnsupportedFeatureException
Load the axioms from the Jena graphs to the given KB.

Specified by:
load in interface GraphLoader
Throws:
UnsupportedFeatureException

preprocess

public void preprocess()
Do the preprocessing steps necessary to cache any information that will be used for loading.

Specified by:
preprocess in interface GraphLoader

isLoadABox

public boolean isLoadABox()
Description copied from interface: GraphLoader
Returns if the loader will load the Abox triples.

Specified by:
isLoadABox in interface GraphLoader
Returns:
boolean value indicating if ABox triples will be loaded
See Also:
GraphLoader.setLoadABox(boolean)

setLoadABox

public void setLoadABox(boolean loadABox)
Description copied from interface: GraphLoader
Sets the flag that tells the loader to skip ABox (instance) statements. Only TBox (class) and RBox (property) axioms will be loaded. Improves loading performance even if there are no ABox statements because lets the loader to ignore annotations.

Specified by:
setLoadABox in interface GraphLoader

isPreprocessTypeTriples

public boolean isPreprocessTypeTriples()
Description copied from interface: GraphLoader
Returns if the loader will preprocess rdf:type triples.

Specified by:
isPreprocessTypeTriples in interface GraphLoader
Returns:
boolean value indicating if rdf:type triples will be preprocessed
See Also:
GraphLoader.setPreprocessTypeTriples(boolean)

setPreprocessTypeTriples

public void setPreprocessTypeTriples(boolean preprocessTypeTriples)
Description copied from interface: GraphLoader
This option forces the loader to process type triples before processing other triples. Not preprocessing the type triples improves loading time 5% to 10% but might cause problems too. For example, without preprocessing the type triples a triple (s p "o") might be loaded as a datatype assertion (thinking s is an individual and p is a datatype property) whereas (s rdf:type owl:Class) and (p rdf:type owl:AnnotiationProperty) triples have not yet been processed. These problems depend on the order triples are processed and highly unpredictable. Loading the schema first with preprocessing and loading the instance data without preprocessing would be a viable option if schema and instance data are in separate files.

Specified by:
setPreprocessTypeTriples in interface GraphLoader


Copyright © 2004 Evren Sirin. All Rights Reserved.