org.semanticweb.HermiT.model
Class DLOntology
java.lang.Object
org.semanticweb.HermiT.model.DLOntology
- All Implemented Interfaces:
- java.io.Serializable
public class DLOntology
- extends java.lang.Object
- implements java.io.Serializable
Represents a DL ontology as a set of rules.
- See Also:
- Serialized Form
|
Constructor Summary |
DLOntology(java.lang.String ontologyURI,
java.util.Set<DLClause> dlClauses,
java.util.Set<Atom> positiveFacts,
java.util.Set<Atom> negativeFacts,
java.util.Set<AtomicConcept> atomicConcepts,
java.util.Set<Individual> individuals,
java.util.Map<AtomicRole,HierarchyPosition<AtomicRole>> explicitRoleHierarchy,
boolean hasInverseRoles,
boolean hasAtMostRestrictions,
boolean hasNominals,
boolean canUseNIRule,
boolean hasReflexivity)
|
|
Method Summary |
protected boolean |
addAtomicRoles(DLClause dlClause,
java.util.Set<AtomicRole> abstractRoles)
|
protected void |
addDLPredicate(DLPredicate dlPredicate)
|
boolean |
canUseNIRule()
|
protected java.util.Set<AtomicRole> |
computeGraphAtomicRoles()
|
protected boolean |
containsAtomicRoles(DLClause dlClause,
java.util.Set<AtomicRole> abstractRoles)
|
java.util.Set<AtomicConcept> |
getAllAtomicConcepts()
|
java.util.Set<DescriptionGraph> |
getAllDescriptionGraphs()
|
java.util.Set<Individual> |
getAllIndividuals()
|
protected java.util.Set<AtomicConcept> |
getBodyOnlyAtomicConcepts()
|
java.util.Set<DLClause> |
getDLClauses()
|
java.util.Set<Atom> |
getNegativeFacts()
|
java.util.Collection<DLClause> |
getNonadmissibleDLClauses()
|
java.lang.String |
getOntologyURI()
|
java.util.Set<Atom> |
getPositiveFacts()
|
protected int |
getUsedRoleTypes(DLClause dlClause,
java.util.Set<AtomicRole> graphAtomicRoles)
Takes the set of roles that are for use in Description Graphs and detects
whether clause contains no roles, only roles from the given set, only
roles not from the given set or both types of roles. |
boolean |
hasAtMostRestrictions()
|
boolean |
hasInverseRoles()
|
boolean |
hasNominals()
|
boolean |
hasReflexifity()
|
protected boolean |
isGraphDLClause(DLClause dlClause)
|
boolean |
isHorn()
|
protected boolean |
isTreeDLClause(DLClause dlClause,
java.util.Set<AtomicRole> graphAtomicRoles,
java.util.Set<AtomicConcept> bodyOnlyAtomicConcepts)
Tests whether the clause conforms to the properties of HT clauses, i.e.,
the variables can be split into a centre variable x, a set of branch
variables y_i, and a set of nominal variables z_j such that certain
conditions hold. |
protected boolean |
isTreeWithCenterVariable(DLClause dlClause,
Variable centerVariable,
java.util.Set<AtomicConcept> bodyOnlyAtomicConcepts)
Tests whether the given center variable is suitable. |
static DLOntology |
load(java.io.File file)
|
static DLOntology |
load(java.io.InputStream inputStream)
|
int |
numExternalConcepts()
|
void |
save(java.io.File file)
|
void |
save(java.io.OutputStream outputStream)
|
java.lang.String |
toString()
|
java.lang.String |
toString(Namespaces ns)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
CRLF
protected static final java.lang.String CRLF
CONTAINS_NO_ROLES
protected static final int CONTAINS_NO_ROLES
- See Also:
- Constant Field Values
CONTAINS_ONLY_GRAPH_ROLES
protected static final int CONTAINS_ONLY_GRAPH_ROLES
- See Also:
- Constant Field Values
CONTAINS_ONLY_TREE_ROLES
protected static final int CONTAINS_ONLY_TREE_ROLES
- See Also:
- Constant Field Values
CONTAINS_GRAPH_AND_TREE_ROLES
protected static final int CONTAINS_GRAPH_AND_TREE_ROLES
- See Also:
- Constant Field Values
m_ontologyURI
protected final java.lang.String m_ontologyURI
m_dlClauses
protected final java.util.Set<DLClause> m_dlClauses
m_positiveFacts
protected final java.util.Set<Atom> m_positiveFacts
m_negativeFacts
protected final java.util.Set<Atom> m_negativeFacts
m_hasInverseRoles
protected final boolean m_hasInverseRoles
m_hasAtMostRestrictions
protected final boolean m_hasAtMostRestrictions
m_hasNominals
protected final boolean m_hasNominals
m_canUseNIRule
protected final boolean m_canUseNIRule
m_isHorn
protected final boolean m_isHorn
m_hasReflexifity
protected final boolean m_hasReflexifity
m_allAtomicConcepts
protected final java.util.Set<AtomicConcept> m_allAtomicConcepts
m_allIndividuals
protected final java.util.Set<Individual> m_allIndividuals
m_allDescriptionGraphs
protected final java.util.Set<DescriptionGraph> m_allDescriptionGraphs
explicitRoleHierarchy
public final java.util.Map<AtomicRole,HierarchyPosition<AtomicRole>> explicitRoleHierarchy
m_numExternalConcepts
protected int m_numExternalConcepts
DLOntology
public DLOntology(java.lang.String ontologyURI,
java.util.Set<DLClause> dlClauses,
java.util.Set<Atom> positiveFacts,
java.util.Set<Atom> negativeFacts,
java.util.Set<AtomicConcept> atomicConcepts,
java.util.Set<Individual> individuals,
java.util.Map<AtomicRole,HierarchyPosition<AtomicRole>> explicitRoleHierarchy,
boolean hasInverseRoles,
boolean hasAtMostRestrictions,
boolean hasNominals,
boolean canUseNIRule,
boolean hasReflexivity)
numExternalConcepts
public int numExternalConcepts()
addDLPredicate
protected void addDLPredicate(DLPredicate dlPredicate)
getOntologyURI
public java.lang.String getOntologyURI()
getAllAtomicConcepts
public java.util.Set<AtomicConcept> getAllAtomicConcepts()
getAllIndividuals
public java.util.Set<Individual> getAllIndividuals()
getAllDescriptionGraphs
public java.util.Set<DescriptionGraph> getAllDescriptionGraphs()
getDLClauses
public java.util.Set<DLClause> getDLClauses()
getPositiveFacts
public java.util.Set<Atom> getPositiveFacts()
getNegativeFacts
public java.util.Set<Atom> getNegativeFacts()
hasInverseRoles
public boolean hasInverseRoles()
hasAtMostRestrictions
public boolean hasAtMostRestrictions()
hasNominals
public boolean hasNominals()
canUseNIRule
public boolean canUseNIRule()
isHorn
public boolean isHorn()
hasReflexifity
public boolean hasReflexifity()
getNonadmissibleDLClauses
public java.util.Collection<DLClause> getNonadmissibleDLClauses()
getBodyOnlyAtomicConcepts
protected java.util.Set<AtomicConcept> getBodyOnlyAtomicConcepts()
computeGraphAtomicRoles
protected java.util.Set<AtomicRole> computeGraphAtomicRoles()
containsAtomicRoles
protected boolean containsAtomicRoles(DLClause dlClause,
java.util.Set<AtomicRole> abstractRoles)
addAtomicRoles
protected boolean addAtomicRoles(DLClause dlClause,
java.util.Set<AtomicRole> abstractRoles)
getUsedRoleTypes
protected int getUsedRoleTypes(DLClause dlClause,
java.util.Set<AtomicRole> graphAtomicRoles)
- Takes the set of roles that are for use in Description Graphs and detects
whether clause contains no roles, only roles from the given set, only
roles not from the given set or both types of roles.
isTreeDLClause
protected boolean isTreeDLClause(DLClause dlClause,
java.util.Set<AtomicRole> graphAtomicRoles,
java.util.Set<AtomicConcept> bodyOnlyAtomicConcepts)
- Tests whether the clause conforms to the properties of HT clauses, i.e.,
the variables can be split into a centre variable x, a set of branch
variables y_i, and a set of nominal variables z_j such that certain
conditions hold.
isTreeWithCenterVariable
protected boolean isTreeWithCenterVariable(DLClause dlClause,
Variable centerVariable,
java.util.Set<AtomicConcept> bodyOnlyAtomicConcepts)
- Tests whether the given center variable is suitable.
isGraphDLClause
protected boolean isGraphDLClause(DLClause dlClause)
toString
public java.lang.String toString(Namespaces ns)
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
save
public void save(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException
save
public void save(java.io.OutputStream outputStream)
throws java.io.IOException
- Throws:
java.io.IOException
load
public static DLOntology load(java.io.InputStream inputStream)
throws java.io.IOException
- Throws:
java.io.IOException
load
public static DLOntology load(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException