public class DefaultGraphLoader extends Object implements GraphLoader
Title:
Description:
Copyright: Copyright (c) 2008
Company: Clark & Parsia, LLC.
| Modifier and Type | Field and Description |
|---|---|
protected Set<com.hp.hpl.jena.graph.Node> |
anonDatatypes |
protected com.hp.hpl.jena.graph.Graph |
graph |
protected KnowledgeBase |
kb |
protected Map<com.hp.hpl.jena.graph.Node,aterm.ATermList> |
lists |
static Logger |
log |
protected ProgressMonitor |
monitor |
protected Map<com.hp.hpl.jena.graph.Node,BuiltinTerm> |
naryDisjoints |
static QNameProvider |
qnames |
protected static com.hp.hpl.jena.graph.Node[] |
TBOX_PREDICATES |
protected static com.hp.hpl.jena.graph.Node[] |
TBOX_TYPES |
protected Map<com.hp.hpl.jena.graph.Node,aterm.ATermAppl> |
terms |
| Constructor and Description |
|---|
DefaultGraphLoader() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addSimpleProperty(aterm.ATermAppl p,
SimpleProperty why) |
protected void |
addUnsupportedFeature(String msg) |
void |
clear()
Clear all internal caches (essentially used for mapping bnodes to ATerm
structures)
|
protected aterm.ATermList |
createList(org.mindswap.pellet.jena.graph.loader.DefaultGraphLoader.RDFListIterator i) |
protected aterm.ATermList |
createList(com.hp.hpl.jena.graph.Node node) |
protected aterm.ATermAppl |
createRestriction(com.hp.hpl.jena.graph.Node node) |
protected aterm.ATermAppl |
createRestriction(com.hp.hpl.jena.graph.Node restrictionType,
com.hp.hpl.jena.graph.Node p,
com.hp.hpl.jena.graph.Node filler,
com.hp.hpl.jena.graph.Node qualification,
Bool isObjectRestriction) |
protected boolean |
defineClass(aterm.ATermAppl c) |
protected boolean |
defineDatatype(aterm.ATermAppl dt) |
protected boolean |
defineDatatypeProperty(aterm.ATermAppl c) |
protected boolean |
defineIndividual(aterm.ATermAppl c) |
protected boolean |
defineObjectProperty(aterm.ATermAppl c) |
protected boolean |
defineProperty(aterm.ATermAppl c) |
protected com.hp.hpl.jena.graph.Triple |
getExpression(com.hp.hpl.jena.graph.Node node) |
protected com.hp.hpl.jena.graph.Node |
getFirst(com.hp.hpl.jena.graph.Node list) |
com.hp.hpl.jena.graph.Graph |
getGraph()
Get the Jena graph used in the loader.
|
protected com.hp.hpl.jena.graph.Node |
getRest(com.hp.hpl.jena.graph.Node list) |
Set<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.
|
protected boolean |
isRestriction(com.hp.hpl.jena.graph.Node node) |
void |
load(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.
|
protected void |
processTriple(com.hp.hpl.jena.graph.Triple triple)
Process a single triple that corresponds to an axiom (or a fact).
|
protected void |
processTriples()
Process all the triples in the raw graph.
|
protected void |
processTriples(com.hp.hpl.jena.graph.Node predicate)
Process triples with the given predicate.
|
protected void |
processType(com.hp.hpl.jena.graph.Triple triple)
Process a single
rdf:type triple. |
protected void |
processTypes()
Process all triples with
rdf:type predicate. |
protected void |
processTypes(com.hp.hpl.jena.graph.Node type)
Process triples with
rdf:type predicate and given object. |
protected void |
processUntypedResources() |
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.
|
public static final Logger log
protected static final com.hp.hpl.jena.graph.Node[] TBOX_TYPES
protected static final com.hp.hpl.jena.graph.Node[] TBOX_PREDICATES
public static QNameProvider qnames
protected KnowledgeBase kb
protected com.hp.hpl.jena.graph.Graph graph
protected Map<com.hp.hpl.jena.graph.Node,aterm.ATermAppl> terms
protected Map<com.hp.hpl.jena.graph.Node,aterm.ATermList> lists
protected Set<com.hp.hpl.jena.graph.Node> anonDatatypes
protected Map<com.hp.hpl.jena.graph.Node,BuiltinTerm> naryDisjoints
protected ProgressMonitor monitor
public void setProgressMonitor(ProgressMonitor monitor)
setProgressMonitor in interface GraphLoaderpublic void setGraph(com.hp.hpl.jena.graph.Graph graph)
setGraph in interface GraphLoaderpublic com.hp.hpl.jena.graph.Graph getGraph()
getGraph in interface GraphLoaderpublic Set<String> getUnpportedFeatures()
getUnpportedFeatures in interface GraphLoaderprotected void addSimpleProperty(aterm.ATermAppl p,
SimpleProperty why)
protected void addUnsupportedFeature(String msg)
public void clear()
clear in interface GraphLoaderprotected com.hp.hpl.jena.graph.Node getFirst(com.hp.hpl.jena.graph.Node list)
protected com.hp.hpl.jena.graph.Node getRest(com.hp.hpl.jena.graph.Node list)
protected aterm.ATermList createList(com.hp.hpl.jena.graph.Node node)
protected aterm.ATermList createList(org.mindswap.pellet.jena.graph.loader.DefaultGraphLoader.RDFListIterator i)
protected boolean isRestriction(com.hp.hpl.jena.graph.Node node)
protected aterm.ATermAppl createRestriction(com.hp.hpl.jena.graph.Node node)
throws UnsupportedFeatureException
UnsupportedFeatureExceptionprotected aterm.ATermAppl createRestriction(com.hp.hpl.jena.graph.Node restrictionType,
com.hp.hpl.jena.graph.Node p,
com.hp.hpl.jena.graph.Node filler,
com.hp.hpl.jena.graph.Node qualification,
Bool isObjectRestriction)
throws UnsupportedFeatureException
UnsupportedFeatureExceptionpublic aterm.ATermAppl node2term(com.hp.hpl.jena.graph.Node node)
node2term in interface GraphLoaderprotected com.hp.hpl.jena.graph.Triple getExpression(com.hp.hpl.jena.graph.Node node)
protected boolean defineClass(aterm.ATermAppl c)
protected boolean defineDatatype(aterm.ATermAppl dt)
protected boolean defineObjectProperty(aterm.ATermAppl c)
protected boolean defineDatatypeProperty(aterm.ATermAppl c)
protected boolean defineProperty(aterm.ATermAppl c)
protected boolean defineIndividual(aterm.ATermAppl c)
protected void processTypes()
rdf:type predicate. If
PelletOptions#PREPROCESS_TYPE_TRIPLES option is true
this function is a noop.protected void processTypes(com.hp.hpl.jena.graph.Node type)
rdf:type predicate and given object.
Type can be Node.ANY to indicate all type triples should be
processed.type - the object of rdf:type triples to be processedprotected void processType(com.hp.hpl.jena.graph.Triple triple)
rdf:type triple. Type triples that are part
of the OWL syntax, e.g. _:x rdf:type owl:Restriction will
not be processed since they are handled by the node2term(Node)
function.triple - Type triple that will be processedprotected void processTriples()
PelletOptions#PREPROCESS_TYPE_TRIPLES option is true
all rdf:type will be ignored since they have already been
processed with processTypes() function.protected void processTriples(com.hp.hpl.jena.graph.Node predicate)
Node.ANY to indicate all triples should be processed.predicate - Predicate of the triples that will be processedprotected void processTriple(com.hp.hpl.jena.graph.Triple triple)
owl:onProperty predicate, will not be processed since they
are handled by the node2term(Node) function. Also, if
PelletOptions#PREPROCESS_TYPE_TRIPLES option is true
any triple with rdf:type predicate will be ignored.triple - Triple to be processed.protected void processUntypedResources()
public void setKB(KnowledgeBase kb)
setKB in interface GraphLoaderpublic void load(Iterable<com.hp.hpl.jena.graph.Graph> graphs) throws UnsupportedFeatureException
load in interface GraphLoaderUnsupportedFeatureExceptionpublic void preprocess()
preprocess in interface GraphLoaderpublic boolean isLoadABox()
GraphLoaderisLoadABox in interface GraphLoaderGraphLoader.setLoadABox(boolean)public void setLoadABox(boolean loadABox)
GraphLoadersetLoadABox in interface GraphLoaderpublic boolean isPreprocessTypeTriples()
GraphLoaderisPreprocessTypeTriples in interface GraphLoaderGraphLoader.setPreprocessTypeTriples(boolean)public void setPreprocessTypeTriples(boolean preprocessTypeTriples)
GraphLoadersetPreprocessTypeTriples in interface GraphLoaderCopyright © 2013. All Rights Reserved.