net.sourceforge.fluxion.runcible.graph.factory
Class OntologyGraphFactory
java.lang.Object
net.sourceforge.fluxion.runcible.graph.factory.OntologyGraphFactory
- All Implemented Interfaces:
- GraphFactory, OWLGraphFactory
public class OntologyGraphFactory
- extends java.lang.Object
- implements OWLGraphFactory
Given an ontology and an option of source or target, an OntologyGraphFactory
will
precalculate a runcible rules graph. This class inspects the ontology and
uses a reasoner to evaluate all possible, useful walk operations from each
class to draw a putative set of facts that could be used in Runcible. The
user is then responsible forpruning this tree to reduce this graph down to
only the nodes they are interested in, rather than building the full graph
from scratch.
- Author:
- Tony Burdett
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
newInstance
public static OntologyGraphFactory newInstance(OntologyGraphFactory.Type type,
org.semanticweb.owl.model.OWLOntology ontology)
throws org.semanticweb.owl.inference.OWLReasonerException
- Request a new OntologyGraphFactory that will produce an OWLGraph from the
given ontology and of the correct type. Nodes in the OWLGraph can be
mapped to one another to produce runcible rules, if required, but this is
entirely up to the client. Note that the graphs will be different
depending on the type specified - source graphs will indicate possible
selections from the ontology, whereas target graphs represent facts that
can be asserted. Whilst this will generally not influence the structure of
the graph, it is important if defining custom visualisation strategies to
represent runcible rules. The graphs can be used as standalone, however -
in such cases it is possible to specify a null type, or otherwise use a
source graph
- Parameters:
type
- the OntologyGraphFactory.Type
of graph the factory will produce graphs
forsontology
- the OWLOntology
to create a graph from
- Returns:
- the factory that can be used to produce graphs
- Throws:
org.semanticweb.owl.inference.OWLReasonerException
- if the ontology specified cannot be
classified
getOWLOntology
public org.semanticweb.owl.model.OWLOntology getOWLOntology()
getGraph
public OWLGraph getGraph()
- Specified by:
getGraph
in interface GraphFactory
- Specified by:
getGraph
in interface OWLGraphFactory
calculateGraph
public void calculateGraph()
calculateSubgraph
public void calculateSubgraph(OntologyGraphFactory.Type type,
org.semanticweb.owl.model.OWLClass rootClass)
throws UnsupportedTypeException
- Calculates a portion of the graph, using the currently specified OWLClass
as a root node. This method should not be called unless the full graph has
been calculated at least once first, using the
calculateGraph()
method, as the possible walk operations will not have been calcaulted.
- Parameters:
type
- the graph type, SOURCE or TARGETrootClass
- the class used as the OWLClass for the root node
- Throws:
UnsupportedTypeException
- if their is a restriction in the map that represents an unusable
type
Copyright © 2010. All Rights Reserved.