Package openllet.core
Class KnowledgeBaseImpl
- java.lang.Object
-
- openllet.core.KnowledgeBaseImpl
-
- All Implemented Interfaces:
Base,Boxes,ClassesBase,InstancesBase,MessageBase,PropertiesBase,KnowledgeBase,openllet.shared.tools.Logging
- Direct Known Subclasses:
KnowledgeBaseImplFullSync
public class KnowledgeBaseImpl extends java.lang.Object implements KnowledgeBase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKnowledgeBaseImpl.AssertionType-
Nested classes/interfaces inherited from interface openllet.core.KnowledgeBase
KnowledgeBase.ChangeType
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.logging.Logger_loggerTimers_timersTimers used in various different parts of KB.-
Fields inherited from interface openllet.core.knowledge.MessageBase
_isNotAnClass, _isNotAnIndividual, _isNotAnKnowClass, _isNotAnKnowDataProperty, _isNotAnKnowIndividual, _isNotAnKnowObjectProperty, _isNotAnKnowProperty, _isNotAnProperty, _isNotAnPropertyNorAClass, _isNotAValidClassExpression, _isNotAValidClassExpressionOrDataRange
-
-
Constructor Summary
Constructors Constructor Description KnowledgeBaseImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAllDifferent(openllet.aterm.ATermList list)booleanaddAnnotation(openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl o)booleanaddAnnotationProperty(openllet.aterm.ATerm p)voidaddClass(openllet.aterm.ATermAppl c)voidaddComplementClass(openllet.aterm.ATermAppl c1, openllet.aterm.ATermAppl c2)voidaddDatatype(openllet.aterm.ATermAppl p)booleanaddDatatypeDefinition(openllet.aterm.ATermAppl name, openllet.aterm.ATermAppl datarange)Adds a new datatype defined to be equivalent to the given data range expression.booleanaddDatatypeProperty(openllet.aterm.ATerm p)Add a new object property.voidaddDifferent(openllet.aterm.ATermAppl i1, openllet.aterm.ATermAppl i2)voidaddDisjointClass(openllet.aterm.ATermAppl c1, openllet.aterm.ATermAppl c2)voidaddDisjointClasses(java.util.List<openllet.aterm.ATermAppl> classes)voidaddDisjointClasses(openllet.aterm.ATermList classes)voidaddDomain(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c)voidaddDomain(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c, java.util.Set<openllet.aterm.ATermAppl> explain)For internal use when domain axioms come from TBox absorptionvoidaddEquivalentClass(openllet.aterm.ATermAppl c1, openllet.aterm.ATermAppl c2)IndividualaddIndividual(openllet.aterm.ATermAppl i)voidaddKey(openllet.aterm.ATermAppl c, java.util.Set<openllet.aterm.ATermAppl> properties)booleanaddNegatedPropertyValue(openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl o)booleanaddObjectProperty(openllet.aterm.ATerm p)Add a new object property.voidaddObjectPropertyValue(openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl o)Deprecated.2.5.1 Use addPropertyValue insteadvoidaddOntologyProperty(openllet.aterm.ATermAppl p)Deprecated.voidaddProperty(openllet.aterm.ATermAppl p)booleanaddPropertyValue(openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl o)voidaddRange(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c)voidaddRange(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c, java.util.Set<openllet.aterm.ATermAppl> explain)For internal use when range axioms come from TBox absorptionbooleanaddRule(Rule rule)Add a rule to the KB.voidaddSame(openllet.aterm.ATermAppl i1, openllet.aterm.ATermAppl i2)voidaddSubClass(openllet.aterm.ATermAppl sub, openllet.aterm.ATermAppl sup)voidaddType(openllet.aterm.ATermAppl i, openllet.aterm.ATermAppl c)voidaddType(openllet.aterm.ATermAppl i, openllet.aterm.ATermAppl c, DependencySet ds)CompletionStrategychooseStrategy(ABox abox)CompletionStrategychooseStrategy(ABox abox, Expressivity expressivity)Choose a completion strategy based on the expressivity of the KB.voidclassify()voidclear()voidclearABox()KnowledgeBasecopy(boolean emptyABox)Create a copy of this KB.java.util.Set<openllet.aterm.ATermAppl>currentIndividuals()voidensureConsistency()voidensureIncConsistency(boolean aboxDeletion)ABoxgetABox()java.util.Set<openllet.aterm.ATermAppl>getABoxAssertions(KnowledgeBaseImpl.AssertionType assertionType)java.util.Set<openllet.aterm.ATermAppl>getAllUnsatisfiableClasses()Returns all unsatisfiable classes in the KB including the BOTTOM concept.java.util.Map<openllet.aterm.ATermAppl,java.util.Map<openllet.aterm.ATermAppl,java.util.Set<openllet.aterm.ATermAppl>>>getAnnotations()TaxonomyBuildergetBuilder()ProgressMonitorgetBuilderProgressMonitor()java.util.EnumSet<KnowledgeBase.ChangeType>getChanges()java.util.Set<openllet.aterm.ATermAppl>getComplements(openllet.aterm.ATermAppl c)DatatypeVisitorgetDatatypeVisitor()java.util.Set<openllet.aterm.ATermAppl>getDeletedAssertions()DependencyIndexgetDependencyIndex()java.util.Set<openllet.aterm.ATermAppl>getDifferents(openllet.aterm.ATermAppl name)java.util.Set<java.util.Set<openllet.aterm.ATermAppl>>getDisjointProperties(openllet.aterm.ATermAppl p)java.util.Set<java.util.Set<openllet.aterm.ATermAppl>>getDisjointProperties(openllet.aterm.ATermAppl p, boolean direct)java.util.Set<java.util.Set<openllet.aterm.ATermAppl>>getDisjoints(openllet.aterm.ATermAppl c)booleangetDoDependencyAxioms()Deprecated.Use getExplanation insteadExpressivityCheckergetExpChecker()ExpressivitygetExpressivity()ExpressivityCheckergetExpressivityChecker()FullyDefinedClassVisitorgetFullyDefinedVisitor()java.util.Set<openllet.aterm.ATermAppl>getIndividuals()intgetIndividualsCount()java.lang.StringgetInfo()java.util.Map<openllet.aterm.ATermAppl,java.util.Set<openllet.aterm.ATermAppl>>getInstances()KnowledgeBasegetKnowledgeBase()java.util.logging.LoggergetLogger()java.util.Map<Rule,Rule>getNormalizedRules()Return the asserted rules with their normalized form.java.util.Optional<TaxonomyBuilder>getOptTaxonomyBuilder()RBoxgetRBox()java.util.Set<Rule>getRules()Return all the asserted rules.java.util.Set<openllet.aterm.ATermAppl>getSames(openllet.aterm.ATermAppl name)SizeEstimategetSizeEstimate()java.util.Set<openllet.aterm.ATermAppl>getSyntacticAssertions()Taxonomy<openllet.aterm.ATermAppl>getTaxonomy()Get the classification results.TBoxgetTBox()TimersgetTimers()java.util.Map<openllet.aterm.ATermAppl,java.util.Set<openllet.aterm.ATermAppl>>getToldDisjoints()Taxonomy<openllet.aterm.ATermAppl>getToldTaxonomy()java.util.Set<openllet.aterm.ATermAppl>getUnsatisfiableClasses()Returns all unsatisfiable classes in the KB excluding the BOTTOM concept.booleanhasInstance(openllet.aterm.ATerm d)BoolhasKnownPropertyValue(openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl o)Answers the hasPropertyValue question without doing any satisfiability check.booleanhasPropertyValue(openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl o)java.util.stream.Stream<openllet.aterm.ATermAppl>individuals()booleanisABoxChanged()booleanisAnnotation(openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl o)booleanisChanged()booleanisChanged(KnowledgeBase.ChangeType change)booleanisClassified()Returns true if the classification check has been done and nothing in the KB has changed after that.booleanisConsistencyDone()Returns true if the consistency check has been done and nothing in the KB has changed after that.booleanisConsistent()booleanisDifferentFrom(openllet.aterm.ATermAppl t1, openllet.aterm.ATermAppl t2)booleanisExplainOnlyInconsistency()Returns _current value of explainOnlyInconsistency option.booleanisRBoxChanged()booleanisRealized()booleanisSameAs(openllet.aterm.ATermAppl t1, openllet.aterm.ATermAppl t2)booleanisSatisfiable(openllet.aterm.ATermAppl c)booleanisTBoxChanged()voidprepare()voidprintClassTree(java.io.PrintWriter out)voidrealize()booleanremoveAxiom(openllet.aterm.ATermAppl axiom)Removes (if possible) the given TBox axiom from the KB and returntrueif removal was successful.booleanremoveDomain(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c)Removes (if possible) the given property domain axiom from the KB and returntrueif removal was successful.booleanremovePropertyValue(openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl i1, openllet.aterm.ATermAppl i2)booleanremoveRange(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c)Removes (if possible) the given property range axiom from the KB and returntrueif removal was successful.booleanremoveType(openllet.aterm.ATermAppl ind, openllet.aterm.ATermAppl c)voidsetBuilderProgressMonitor(ProgressMonitor builderProgressMonitor)voidsetChanges(java.util.EnumSet<KnowledgeBase.ChangeType> changes)voidsetDoDependencyAxioms(boolean doDepAxioms)Deprecated.Use setDoExplanation insteadvoidsetExpChecker(ExpressivityChecker expChecker)voidsetExplainOnlyInconsistency(boolean explainOnlyInconsistency)Controls what kind of explanations can be generated using this KB.voidsetOptTaxonomyBuilder(java.util.Optional<TaxonomyBuilder> builder)voidsetTaxonomyBuilderProgressMonitor(ProgressMonitor progressMonitor)voidsetTimeout(long timeout)Set a timeout for the main timer.voidupdateExpressivity(openllet.aterm.ATermAppl i, openllet.aterm.ATermAppl c)This method is used for incremental reasoning.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface openllet.core.knowledge.Base
allClasses, doExplanation, getAllClasses, getAnnotationSubjects, getClasses, getExplanation, getExplanationSet, getProperties, getProperty, getPropertyType, getRole, getTaxonomyBuilder, isABoxProperty, isAnnotationProperty, isClass, isDatatype, isDatatypeProperty, isIndividual, isObjectProperty, isProperty, setDoExplanation
-
Methods inherited from interface openllet.core.knowledge.Boxes
getDatatypeReasoner
-
Methods inherited from interface openllet.core.knowledge.ClassesBase
getAllEquivalentClasses, getDisjointClasses, getEquivalentClasses, getSubClasses, getSuperClasses, hasRange, isComplement, isDisjoint, isDisjointClass, isDisjointProperty, isEquivalentClass, isKnownType, isSubClassOf, isType, printClassTree
-
Methods inherited from interface openllet.core.knowledge.InstancesBase
binaryInstanceRetrieval, getAllSames, getInstances, getInstances, getPrimitiveTypes, getTypes, linearInstanceRetrieval, partitionInstanceRetrieval, retrieve, retrieveIndividualsWithProperty, tracingBasedInstanceRetrieval
-
Methods inherited from interface openllet.core.KnowledgeBase
copy, getDisjointClasses, getSubClasses, getSuperClasses, getTypes
-
Methods inherited from interface openllet.core.knowledge.PropertiesBase
addAntisymmetricProperty, addAsymmetricProperty, addDisjointProperties, addDisjointProperty, addDisjointProperty, addEquivalentProperty, addFunctionalProperty, addInverseFunctionalProperty, addInverseProperty, addIrreflexiveProperty, addReflexiveProperty, addSubProperty, addSymmetricProperty, addTransitiveProperty, getAllEquivalentProperties, getAllSubProperties, getAllSuperProperties, getAnnotationProperties, getAnnotations, getAntisymmetricProperties, getAsymmetricProperties, getDataProperties, getDataPropertyValues, getDataPropertyValues, getDataPropertyValues, getDomains, getEquivalentProperties, getFunctionalProperties, getIndividualsWithAnnotation, getIndividualsWithDataProperty, getIndividualsWithObjectProperty, getIndividualsWithProperty, getInverse, getInverseFunctionalProperties, getInverses, getIrreflexiveProperties, getObjectProperties, getObjectPropertyValues, getObjectPropertyValuesSet, getProperties, getPropertyValues, getPropertyValues, getRanges, getReflexiveProperties, getRoleTaxonomy, getRoleTaxonomy, getSubAnnotationProperties, getSubProperties, getSubProperties, getSuperProperties, getSuperProperties, getSymmetricProperties, getTransitiveProperties, hasDomain, isAntisymmetricProperty, isAsymmetricProperty, isEquivalentProperty, isFunctionalProperty, isInverse, isInverseFunctionalProperty, isIrreflexiveProperty, isReflexiveProperty, isSubPropertyOf, isSymmetricProperty, isTransitiveProperty, objectPropertyValues
-
-
-
-
Field Detail
-
_logger
public static final java.util.logging.Logger _logger
-
_timers
public final Timers _timers
Timers used in various different parts of KB. There may be many different _timers created here depending on the level of debugging or application requirements. However, there are three major timers that are guaranteed to exist.- main - This is the main timer that exists in any Timers objects. All the other _timers defined in here will have this timer as its dependant so setting a timeout on this timer will put a limit on every operation done inside KB.
- preprocessing - This is the operation where TBox creation, absorbtion and normalization is done. It also includes computing hierarchy of properties in RBox and merging the _individuals in ABox if there are explicit sameAs assertions.
- consistency - This is the timer for ABox consistency check. Putting a timeout will mean that any single consistency check should be completed in a certain amount of time.
-
-
Method Detail
-
getAnnotations
public java.util.Map<openllet.aterm.ATermAppl,java.util.Map<openllet.aterm.ATermAppl,java.util.Set<openllet.aterm.ATermAppl>>> getAnnotations()
- Specified by:
getAnnotationsin interfaceBase
-
getInstances
public java.util.Map<openllet.aterm.ATermAppl,java.util.Set<openllet.aterm.ATermAppl>> getInstances()
- Specified by:
getInstancesin interfaceBase
-
getBuilderProgressMonitor
public ProgressMonitor getBuilderProgressMonitor()
- Specified by:
getBuilderProgressMonitorin interfaceBase
-
setBuilderProgressMonitor
public void setBuilderProgressMonitor(ProgressMonitor builderProgressMonitor)
- Specified by:
setBuilderProgressMonitorin interfaceBase
-
getFullyDefinedVisitor
public FullyDefinedClassVisitor getFullyDefinedVisitor()
- Specified by:
getFullyDefinedVisitorin interfaceBase
-
getDatatypeVisitor
public DatatypeVisitor getDatatypeVisitor()
- Specified by:
getDatatypeVisitorin interfaceBase
-
getOptTaxonomyBuilder
public java.util.Optional<TaxonomyBuilder> getOptTaxonomyBuilder()
- Specified by:
getOptTaxonomyBuilderin interfaceBase
-
setOptTaxonomyBuilder
public void setOptTaxonomyBuilder(java.util.Optional<TaxonomyBuilder> builder)
- Specified by:
setOptTaxonomyBuilderin interfaceBase
-
getChanges
public java.util.EnumSet<KnowledgeBase.ChangeType> getChanges()
- Specified by:
getChangesin interfaceBase
-
setChanges
public void setChanges(java.util.EnumSet<KnowledgeBase.ChangeType> changes)
-
getExpChecker
public ExpressivityChecker getExpChecker()
- Specified by:
getExpCheckerin interfaceBase
-
setExpChecker
public void setExpChecker(ExpressivityChecker expChecker)
-
getKnowledgeBase
public KnowledgeBase getKnowledgeBase()
- Specified by:
getKnowledgeBasein interfaceBase
-
getBuilder
public TaxonomyBuilder getBuilder()
- Specified by:
getBuilderin interfaceBase
-
getLogger
public java.util.logging.Logger getLogger()
- Specified by:
getLoggerin interfaceopenllet.shared.tools.Logging
-
getExpressivity
public Expressivity getExpressivity()
- Specified by:
getExpressivityin interfaceKnowledgeBase
-
getExpressivityChecker
public ExpressivityChecker getExpressivityChecker()
- Specified by:
getExpressivityCheckerin interfaceKnowledgeBase
-
clear
public void clear()
- Specified by:
clearin interfaceKnowledgeBase
-
clearABox
public void clearABox()
- Specified by:
clearABoxin interfaceKnowledgeBase
-
copy
public KnowledgeBase copy(boolean emptyABox)
Create a copy of this KB. Depending on the value ofemptyABoxeither a completely new copy of ABox will be created or the new KB will have an empty ABox. IfemptyABoxparameter is true but the original KB contains nominals in its RBox or TBox the new KB will have the definition of those _individuals (but not ) In either case, the new KB will point to the same RBox and TBox so changing one KB's RBox or TBox will affect other.- Specified by:
copyin interfaceKnowledgeBase- Parameters:
emptyABox- IftrueABox is not copied to the new KB- Returns:
- A copy of this KB
-
addClass
public void addClass(openllet.aterm.ATermAppl c)
- Specified by:
addClassin interfaceKnowledgeBase
-
addSubClass
public void addSubClass(openllet.aterm.ATermAppl sub, openllet.aterm.ATermAppl sup)- Specified by:
addSubClassin interfaceKnowledgeBase
-
addEquivalentClass
public void addEquivalentClass(openllet.aterm.ATermAppl c1, openllet.aterm.ATermAppl c2)- Specified by:
addEquivalentClassin interfaceKnowledgeBase
-
addKey
public void addKey(openllet.aterm.ATermAppl c, java.util.Set<openllet.aterm.ATermAppl> properties)- Specified by:
addKeyin interfaceKnowledgeBase
-
addDisjointClasses
public void addDisjointClasses(openllet.aterm.ATermList classes)
- Specified by:
addDisjointClassesin interfaceKnowledgeBase
-
addDisjointClasses
public void addDisjointClasses(java.util.List<openllet.aterm.ATermAppl> classes)
- Specified by:
addDisjointClassesin interfaceKnowledgeBase
-
addDisjointClass
public void addDisjointClass(openllet.aterm.ATermAppl c1, openllet.aterm.ATermAppl c2)- Specified by:
addDisjointClassin interfaceKnowledgeBase
-
addComplementClass
public void addComplementClass(openllet.aterm.ATermAppl c1, openllet.aterm.ATermAppl c2)- Specified by:
addComplementClassin interfaceKnowledgeBase
-
addIndividual
public Individual addIndividual(openllet.aterm.ATermAppl i)
- Specified by:
addIndividualin interfaceKnowledgeBase
-
addType
public void addType(openllet.aterm.ATermAppl i, openllet.aterm.ATermAppl c)- Specified by:
addTypein interfaceKnowledgeBase
-
addType
public void addType(openllet.aterm.ATermAppl i, openllet.aterm.ATermAppl c, DependencySet ds)- Specified by:
addTypein interfaceKnowledgeBase
-
addSame
public void addSame(openllet.aterm.ATermAppl i1, openllet.aterm.ATermAppl i2)- Specified by:
addSamein interfaceKnowledgeBase
-
addAllDifferent
public void addAllDifferent(openllet.aterm.ATermList list)
- Specified by:
addAllDifferentin interfaceKnowledgeBase
-
addDifferent
public void addDifferent(openllet.aterm.ATermAppl i1, openllet.aterm.ATermAppl i2)- Specified by:
addDifferentin interfaceKnowledgeBase
-
addObjectPropertyValue
@Deprecated public void addObjectPropertyValue(openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl o)Deprecated.2.5.1 Use addPropertyValue instead- Parameters:
p-s-o-
-
addPropertyValue
public boolean addPropertyValue(openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl o)- Specified by:
addPropertyValuein interfaceKnowledgeBase
-
addNegatedPropertyValue
public boolean addNegatedPropertyValue(openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl o)- Specified by:
addNegatedPropertyValuein interfaceKnowledgeBase
-
addProperty
public void addProperty(openllet.aterm.ATermAppl p)
- Specified by:
addPropertyin interfaceKnowledgeBase
-
addObjectProperty
public boolean addObjectProperty(openllet.aterm.ATerm p)
Add a new object property. If property was earlier defined to be a datatype property then this function will simply return without changing the KB.- Specified by:
addObjectPropertyin interfaceKnowledgeBase- Parameters:
p- Name of the property- Returns:
- True if property is added, false if not
-
addDatatypeProperty
public boolean addDatatypeProperty(openllet.aterm.ATerm p)
Add a new object property. If property was earlier defined to be a datatype property then this function will simply return without changing the KB.- Specified by:
addDatatypePropertyin interfaceKnowledgeBase- Parameters:
p-- Returns:
- True if property is added, false if not
-
addOntologyProperty
@Deprecated public void addOntologyProperty(openllet.aterm.ATermAppl p)
Deprecated.
-
addAnnotationProperty
public boolean addAnnotationProperty(openllet.aterm.ATerm p)
- Specified by:
addAnnotationPropertyin interfaceKnowledgeBase
-
addAnnotation
public boolean addAnnotation(openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl o)- Specified by:
addAnnotationin interfaceKnowledgeBase
-
isAnnotation
public boolean isAnnotation(openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl o)- Specified by:
isAnnotationin interfaceKnowledgeBase
-
addDomain
public void addDomain(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c)- Specified by:
addDomainin interfaceKnowledgeBase
-
addDomain
public void addDomain(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c, java.util.Set<openllet.aterm.ATermAppl> explain)For internal use when domain axioms come from TBox absorption- Specified by:
addDomainin interfaceKnowledgeBase
-
addRange
public void addRange(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c)- Specified by:
addRangein interfaceKnowledgeBase
-
addRange
public void addRange(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c, java.util.Set<openllet.aterm.ATermAppl> explain)For internal use when range axioms come from TBox absorption- Specified by:
addRangein interfaceKnowledgeBase
-
addDatatype
public void addDatatype(openllet.aterm.ATermAppl p)
- Specified by:
addDatatypein interfaceKnowledgeBase
-
addDatatypeDefinition
public boolean addDatatypeDefinition(openllet.aterm.ATermAppl name, openllet.aterm.ATermAppl datarange)Adds a new datatype defined to be equivalent to the given data range expression.- Specified by:
addDatatypeDefinitionin interfaceKnowledgeBase- Parameters:
name- name of the datatypedatarange- a data range expression- Returns:
- true if the add success
-
removeDomain
public boolean removeDomain(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c)Removes (if possible) the given property domain axiom from the KB and returntrueif removal was successful. See alsoaddDomain(ATerm, ATermAppl).- Specified by:
removeDomainin interfaceKnowledgeBase- Parameters:
p- Property in domain axiomc- Class in domain axiom- Returns:
trueif axiom is removed,falseif removal failed
-
removePropertyValue
public boolean removePropertyValue(openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl i1, openllet.aterm.ATermAppl i2)- Specified by:
removePropertyValuein interfaceKnowledgeBase
-
removeRange
public boolean removeRange(openllet.aterm.ATerm p, openllet.aterm.ATermAppl c)Removes (if possible) the given property range axiom from the KB and returntrueif removal was successful. See alsoaddRange(ATerm, ATermAppl).- Specified by:
removeRangein interfaceKnowledgeBase- Parameters:
p- Property in range axiomc- Class or datatype in range axiom- Returns:
trueif axiom is removed,falseif removal failed
-
removeType
public boolean removeType(openllet.aterm.ATermAppl ind, openllet.aterm.ATermAppl c)- Specified by:
removeTypein interfaceKnowledgeBase
-
removeAxiom
public boolean removeAxiom(openllet.aterm.ATermAppl axiom)
Removes (if possible) the given TBox axiom from the KB and returntrueif removal was successful.- Specified by:
removeAxiomin interfaceKnowledgeBase- Parameters:
axiom- TBox axiom to remove- Returns:
trueif axiom is removed,falseif removal failed
-
updateExpressivity
public void updateExpressivity(openllet.aterm.ATermAppl i, openllet.aterm.ATermAppl c)This method is used for incremental reasoning. We do not want to recompute the expressivity from scratch.- Parameters:
i-c-
-
getInfo
public java.lang.String getInfo()
-
isConsistencyDone
public boolean isConsistencyDone()
Returns true if the consistency check has been done and nothing in the KB has changed after that.- Specified by:
isConsistencyDonein interfaceKnowledgeBase- Returns:
- true if the consistency check has been done and nothing in the KB has changed after that.
-
isClassified
public boolean isClassified()
Returns true if the classification check has been done and nothing in the KB has changed after that.- Specified by:
isClassifiedin interfaceBase- Returns:
- true if the classification check has been done and nothing in the KB has changed after that.
-
isRealized
public boolean isRealized()
- Specified by:
isRealizedin interfaceBase
-
isChanged
public boolean isChanged()
-
isChanged
public boolean isChanged(KnowledgeBase.ChangeType change)
- Specified by:
isChangedin interfaceKnowledgeBase
-
isTBoxChanged
public boolean isTBoxChanged()
-
isRBoxChanged
public boolean isRBoxChanged()
-
isABoxChanged
public boolean isABoxChanged()
-
getUnsatisfiableClasses
public java.util.Set<openllet.aterm.ATermAppl> getUnsatisfiableClasses()
Returns all unsatisfiable classes in the KB excluding the BOTTOM concept. The result may be empty if there is no user-defined concept in the KB that is unsatisfiable.- Specified by:
getUnsatisfiableClassesin interfaceKnowledgeBase- Returns:
- all unsatisfiable classes in the KB excluding the BOTTOM concept
-
getAllUnsatisfiableClasses
public java.util.Set<openllet.aterm.ATermAppl> getAllUnsatisfiableClasses()
Returns all unsatisfiable classes in the KB including the BOTTOM concept. Since BOTTOM concept is built-in the result will always have at least one element.- Specified by:
getAllUnsatisfiableClassesin interfaceKnowledgeBase- Returns:
- all unsatisfiable classes in the KB including the BOTTOM concept
-
isConsistent
public boolean isConsistent()
- Specified by:
isConsistentin interfaceKnowledgeBase
-
getToldTaxonomy
public Taxonomy<openllet.aterm.ATermAppl> getToldTaxonomy()
- Specified by:
getToldTaxonomyin interfaceKnowledgeBase
-
getToldDisjoints
public java.util.Map<openllet.aterm.ATermAppl,java.util.Set<openllet.aterm.ATermAppl>> getToldDisjoints()
- Specified by:
getToldDisjointsin interfaceKnowledgeBase
-
ensureConsistency
public void ensureConsistency()
- Specified by:
ensureConsistencyin interfaceBase
-
currentIndividuals
public java.util.Set<openllet.aterm.ATermAppl> currentIndividuals()
- Specified by:
currentIndividualsin interfacePropertiesBase- Returns:
- the actual set individuals.
-
getIndividuals
public java.util.Set<openllet.aterm.ATermAppl> getIndividuals()
- Specified by:
getIndividualsin interfaceBase- Returns:
- the set of all _individuals. Returned set is unmodifiable!
-
getIndividualsCount
public int getIndividualsCount()
- Specified by:
getIndividualsCountin interfaceKnowledgeBase- Returns:
- the total number of individuals in kb.
-
individuals
public java.util.stream.Stream<openllet.aterm.ATermAppl> individuals()
- Specified by:
individualsin interfaceKnowledgeBase- Returns:
- all individuals.
-
isSatisfiable
public boolean isSatisfiable(openllet.aterm.ATermAppl c)
- Specified by:
isSatisfiablein interfaceBase
-
hasInstance
public boolean hasInstance(openllet.aterm.ATerm d)
- Specified by:
hasInstancein interfaceKnowledgeBase- Parameters:
d-- Returns:
- true if there is at least one named individual that belongs to the given class
-
isSameAs
public boolean isSameAs(openllet.aterm.ATermAppl t1, openllet.aterm.ATermAppl t2)- Specified by:
isSameAsin interfaceKnowledgeBase
-
isDifferentFrom
public boolean isDifferentFrom(openllet.aterm.ATermAppl t1, openllet.aterm.ATermAppl t2)- Specified by:
isDifferentFromin interfaceKnowledgeBase
-
getDifferents
public java.util.Set<openllet.aterm.ATermAppl> getDifferents(openllet.aterm.ATermAppl name)
- Specified by:
getDifferentsin interfaceKnowledgeBase
-
hasPropertyValue
public boolean hasPropertyValue(openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl o)- Specified by:
hasPropertyValuein interfaceKnowledgeBase
-
hasKnownPropertyValue
public Bool hasKnownPropertyValue(openllet.aterm.ATermAppl s, openllet.aterm.ATermAppl p, openllet.aterm.ATermAppl o)
Description copied from interface:KnowledgeBaseAnswers the hasPropertyValue question without doing any satisfiability check. It might returnBoolean.TRUE,Boolean.FALSE, ornull(unknown). If the null value is returnedhasPropertyValuefunction needs to be called to get the answer.- Specified by:
hasKnownPropertyValuein interfaceKnowledgeBase- Parameters:
s- Subjectp- Predicateo- Object (nullcan be used as wildcard)- Returns:
- true if the hasPropertyValue question without doing any satisfiability check.
-
getDisjoints
public java.util.Set<java.util.Set<openllet.aterm.ATermAppl>> getDisjoints(openllet.aterm.ATermAppl c)
-
getDisjointProperties
public java.util.Set<java.util.Set<openllet.aterm.ATermAppl>> getDisjointProperties(openllet.aterm.ATermAppl p)
- Specified by:
getDisjointPropertiesin interfaceKnowledgeBase
-
getDisjointProperties
public java.util.Set<java.util.Set<openllet.aterm.ATermAppl>> getDisjointProperties(openllet.aterm.ATermAppl p, boolean direct)
-
getComplements
public java.util.Set<openllet.aterm.ATermAppl> getComplements(openllet.aterm.ATermAppl c)
- Specified by:
getComplementsin interfaceKnowledgeBase
-
getSames
public java.util.Set<openllet.aterm.ATermAppl> getSames(openllet.aterm.ATermAppl name)
- Specified by:
getSamesin interfaceKnowledgeBase- Returns:
- all the individuals asserted to be equal to the given individual but not the the individual itself.
-
printClassTree
public void printClassTree(java.io.PrintWriter out)
-
setDoDependencyAxioms
@Deprecated public void setDoDependencyAxioms(boolean doDepAxioms)
Deprecated.Use setDoExplanation instead- Parameters:
doDepAxioms-
-
getDoDependencyAxioms
@Deprecated public boolean getDoDependencyAxioms()
Deprecated.Use getExplanation instead- Returns:
- DO NOT USE
-
chooseStrategy
public CompletionStrategy chooseStrategy(ABox abox)
- Specified by:
chooseStrategyin interfaceKnowledgeBase
-
chooseStrategy
public CompletionStrategy chooseStrategy(ABox abox, Expressivity expressivity)
Choose a completion strategy based on the expressivity of the KB. The _abox given is not necessarily the ABox that belongs to this KB but can be a derivative.- Specified by:
chooseStrategyin interfaceKnowledgeBase- Returns:
- the completion strategy choosen
-
setTimeout
public void setTimeout(long timeout)
Set a timeout for the main timer. Used to stop an automated test after a reasonable amount of time has passed.- Specified by:
setTimeoutin interfaceKnowledgeBase- Parameters:
timeout-
-
getTaxonomy
public Taxonomy<openllet.aterm.ATermAppl> getTaxonomy()
Get the classification results.- Specified by:
getTaxonomyin interfaceKnowledgeBase- Returns:
- the classification results.
-
setTaxonomyBuilderProgressMonitor
public void setTaxonomyBuilderProgressMonitor(ProgressMonitor progressMonitor)
- Specified by:
setTaxonomyBuilderProgressMonitorin interfaceKnowledgeBase
-
getSizeEstimate
public SizeEstimate getSizeEstimate()
- Specified by:
getSizeEstimatein interfaceKnowledgeBase
-
addRule
public boolean addRule(Rule rule)
Add a rule to the KB.- Specified by:
addRulein interfaceKnowledgeBase- Returns:
- true if the add success
-
getRules
public java.util.Set<Rule> getRules()
Return all the asserted rules.- Specified by:
getRulesin interfaceKnowledgeBase- Returns:
- all the asserted rules.
-
getNormalizedRules
public java.util.Map<Rule,Rule> getNormalizedRules()
Return the asserted rules with their normalized form. A normalized rule is a rule where any class expression occurring in the rules is in normalized form.- Specified by:
getNormalizedRulesin interfaceKnowledgeBase- Returns:
- set of rules where
-
ensureIncConsistency
public void ensureIncConsistency(boolean aboxDeletion)
-
getDependencyIndex
public DependencyIndex getDependencyIndex()
- Specified by:
getDependencyIndexin interfaceKnowledgeBase- Returns:
- the dependency index for syntactic assertions in this kb
-
getSyntacticAssertions
public java.util.Set<openllet.aterm.ATermAppl> getSyntacticAssertions()
- Specified by:
getSyntacticAssertionsin interfaceKnowledgeBase- Returns:
- syntactic assertions in the kb
-
getABoxAssertions
public java.util.Set<openllet.aterm.ATermAppl> getABoxAssertions(KnowledgeBaseImpl.AssertionType assertionType)
-
getDeletedAssertions
public java.util.Set<openllet.aterm.ATermAppl> getDeletedAssertions()
- Specified by:
getDeletedAssertionsin interfaceKnowledgeBase- Returns:
- the deletedAssertions
-
isExplainOnlyInconsistency
public boolean isExplainOnlyInconsistency()
Returns _current value of explainOnlyInconsistency option.- Returns:
- current value of explainOnlyInconsistency option
- See Also:
setExplainOnlyInconsistency(boolean)
-
setExplainOnlyInconsistency
public void setExplainOnlyInconsistency(boolean explainOnlyInconsistency)
Controls what kind of explanations can be generated using this KB. With this option enabled explanations for inconsistent ontologies will be returned. But if the ontology is _consistent, it will not be possible to retrieve explanations for inferences about _instances. This option is disabled by default. It should be turned on if explanations are only needed for inconsistencies but not other inferences. Turning this option on improves the performance of consistency checking for _consistent ontologies.- Parameters:
explainOnlyInconsistency- new value for _explainOnlyInconsistency option
-
-