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 ontologyIRI,
java.util.Set<DLClause> dlClauses,
java.util.Set<Atom> positiveFacts,
java.util.Set<Atom> negativeFacts,
java.util.Set<AtomicConcept> atomicConcepts,
java.util.Set<AtomicRole> atomicObjectRoles,
java.util.Set<Role> allComplexObjectRoles,
java.util.Set<AtomicRole> atomicDataRoles,
java.util.Set<DatatypeRestriction> allUnknownDatatypeRestrictions,
java.util.Set<java.lang.String> definedDatatypeIRIs,
java.util.Set<Individual> individuals,
boolean hasInverseRoles,
boolean hasAtMostRestrictions,
boolean hasNominals,
boolean hasDatatypes)
|
Method Summary |
protected boolean |
addAtomicRoles(DLClause dlClause,
java.util.Set<AtomicRole> roles)
|
protected void |
addDLPredicate(DLPredicate dlPredicate)
|
protected java.util.Set<AtomicRole> |
computeGraphAtomicRoles()
|
boolean |
containsAtomicConcept(AtomicConcept concept)
|
protected boolean |
containsAtomicRoles(DLClause dlClause,
java.util.Set<AtomicRole> roles)
|
boolean |
containsDataRole(AtomicRole role)
|
boolean |
containsIndividual(Individual individual)
|
boolean |
containsObjectRole(AtomicRole role)
|
java.util.Set<AtomicConcept> |
getAllAtomicConcepts()
|
java.util.Set<AtomicRole> |
getAllAtomicDataRoles()
|
java.util.Set<AtomicRole> |
getAllAtomicObjectRoles()
|
java.util.Set<Role> |
getAllComplexObjectRoles()
|
java.util.Set<DescriptionGraph> |
getAllDescriptionGraphs()
|
java.util.Set<Individual> |
getAllIndividuals()
|
java.util.Set<DatatypeRestriction> |
getAllUnknownDatatypeRestrictions()
|
protected java.util.Set<AtomicConcept> |
getBodyOnlyAtomicConcepts()
|
java.util.Map<AtomicRole,java.util.Map<Individual,java.util.Set<Constant>>> |
getDataPropertyAssertions()
|
java.util.Set<java.lang.String> |
getDefinedDatatypeIRIs()
|
java.util.Set<DLClause> |
getDLClauses()
|
java.util.Set<Atom> |
getNegativeFacts()
|
java.util.Collection<DLClause> |
getNonadmissibleDLClauses()
|
int |
getNumberOfExternalConcepts()
|
java.lang.String |
getOntologyIRI()
|
java.util.Set<Atom> |
getPositiveFacts()
|
java.lang.String |
getStatistics()
|
protected java.lang.String |
getStatistics(java.lang.Integer numDeterministicClauses,
java.lang.Integer numNondeterministicClauses,
java.lang.Integer numDisjunctions)
|
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 |
hasDatatypes()
|
boolean |
hasInverseRoles()
|
boolean |
hasNominals()
|
boolean |
hasUnknownDatatypeRestrictions()
|
boolean |
isComplexObjectRole(Role role)
|
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 center 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)
|
void |
save(java.io.File file)
|
void |
save(java.io.OutputStream outputStream)
|
java.lang.String |
toString()
|
java.lang.String |
toString(Prefixes prefixes)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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_ontologyIRI
protected final java.lang.String m_ontologyIRI
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_hasDatatypes
protected final boolean m_hasDatatypes
m_isHorn
protected final boolean m_isHorn
m_allAtomicConcepts
protected final java.util.Set<AtomicConcept> m_allAtomicConcepts
m_numberOfExternalConcepts
protected final int m_numberOfExternalConcepts
m_allAtomicObjectRoles
protected final java.util.Set<AtomicRole> m_allAtomicObjectRoles
m_allComplexObjectRoles
protected final java.util.Set<Role> m_allComplexObjectRoles
m_allAtomicDataRoles
protected final java.util.Set<AtomicRole> m_allAtomicDataRoles
m_allUnknownDatatypeRestrictions
protected final java.util.Set<DatatypeRestriction> m_allUnknownDatatypeRestrictions
m_definedDatatypeIRIs
protected final java.util.Set<java.lang.String> m_definedDatatypeIRIs
m_allIndividuals
protected final java.util.Set<Individual> m_allIndividuals
m_allDescriptionGraphs
protected final java.util.Set<DescriptionGraph> m_allDescriptionGraphs
m_dataPropertyAssertions
protected final java.util.Map<AtomicRole,java.util.Map<Individual,java.util.Set<Constant>>> m_dataPropertyAssertions
DLOntology
public DLOntology(java.lang.String ontologyIRI,
java.util.Set<DLClause> dlClauses,
java.util.Set<Atom> positiveFacts,
java.util.Set<Atom> negativeFacts,
java.util.Set<AtomicConcept> atomicConcepts,
java.util.Set<AtomicRole> atomicObjectRoles,
java.util.Set<Role> allComplexObjectRoles,
java.util.Set<AtomicRole> atomicDataRoles,
java.util.Set<DatatypeRestriction> allUnknownDatatypeRestrictions,
java.util.Set<java.lang.String> definedDatatypeIRIs,
java.util.Set<Individual> individuals,
boolean hasInverseRoles,
boolean hasAtMostRestrictions,
boolean hasNominals,
boolean hasDatatypes)
addDLPredicate
protected void addDLPredicate(DLPredicate dlPredicate)
getOntologyIRI
public java.lang.String getOntologyIRI()
getAllAtomicConcepts
public java.util.Set<AtomicConcept> getAllAtomicConcepts()
containsAtomicConcept
public boolean containsAtomicConcept(AtomicConcept concept)
getNumberOfExternalConcepts
public int getNumberOfExternalConcepts()
getAllAtomicObjectRoles
public java.util.Set<AtomicRole> getAllAtomicObjectRoles()
containsObjectRole
public boolean containsObjectRole(AtomicRole role)
getAllComplexObjectRoles
public java.util.Set<Role> getAllComplexObjectRoles()
isComplexObjectRole
public boolean isComplexObjectRole(Role role)
getAllAtomicDataRoles
public java.util.Set<AtomicRole> getAllAtomicDataRoles()
containsDataRole
public boolean containsDataRole(AtomicRole role)
getAllUnknownDatatypeRestrictions
public java.util.Set<DatatypeRestriction> getAllUnknownDatatypeRestrictions()
getAllIndividuals
public java.util.Set<Individual> getAllIndividuals()
containsIndividual
public boolean containsIndividual(Individual individual)
getAllDescriptionGraphs
public java.util.Set<DescriptionGraph> getAllDescriptionGraphs()
getDLClauses
public java.util.Set<DLClause> getDLClauses()
getPositiveFacts
public java.util.Set<Atom> getPositiveFacts()
getDataPropertyAssertions
public java.util.Map<AtomicRole,java.util.Map<Individual,java.util.Set<Constant>>> getDataPropertyAssertions()
getNegativeFacts
public java.util.Set<Atom> getNegativeFacts()
hasInverseRoles
public boolean hasInverseRoles()
hasAtMostRestrictions
public boolean hasAtMostRestrictions()
hasNominals
public boolean hasNominals()
hasDatatypes
public boolean hasDatatypes()
hasUnknownDatatypeRestrictions
public boolean hasUnknownDatatypeRestrictions()
isHorn
public boolean isHorn()
getDefinedDatatypeIRIs
public java.util.Set<java.lang.String> getDefinedDatatypeIRIs()
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> roles)
addAtomicRoles
protected boolean addAtomicRoles(DLClause dlClause,
java.util.Set<AtomicRole> roles)
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 center 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(Prefixes prefixes)
getStatistics
public java.lang.String getStatistics()
getStatistics
protected java.lang.String getStatistics(java.lang.Integer numDeterministicClauses,
java.lang.Integer numNondeterministicClauses,
java.lang.Integer numDisjunctions)
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