├── .gitignore ├── .travis.yml ├── pom.xml └── src ├── main ├── java │ ├── conformance │ │ ├── FaCTRevision.txt │ │ ├── Original.java │ │ ├── PortedFrom.java │ │ ├── header.txt │ │ ├── package-info.java │ │ └── todo.txt │ ├── jfact │ │ └── plugin │ │ │ └── protege │ │ │ ├── JFactProtegeFactory.java │ │ │ ├── JFactRenderingViewComponent.java │ │ │ └── package-info.java │ └── uk │ │ └── ac │ │ └── manchester │ │ └── cs │ │ └── jfact │ │ ├── AxiomTranslator.java │ │ ├── ClassExpressionTranslator.java │ │ ├── ComplexObjectPropertyTranslator.java │ │ ├── DataPropertyTranslator.java │ │ ├── DataRangeTranslator.java │ │ ├── DeclarationVisitorEx.java │ │ ├── EntailmentChecker.java │ │ ├── EntityVisitorEx.java │ │ ├── IndividualTranslator.java │ │ ├── JFactFactory.java │ │ ├── JFactReasoner.java │ │ ├── KnowledgeExplorer.java │ │ ├── OWLEntityTranslator.java │ │ ├── ObjectPropertyTranslator.java │ │ ├── TranslationMachinery.java │ │ ├── datatypes │ │ ├── ANYURIDatatype.java │ │ ├── AbstractDatatype.java │ │ ├── AbstractNumericDatatype.java │ │ ├── BASE64BINARYDatatype.java │ │ ├── BOOLEANDatatype.java │ │ ├── BYTEDatatype.java │ │ ├── DATETIMEDatatype.java │ │ ├── DATETIMESTAMPDatatype.java │ │ ├── DECIMALDatatype.java │ │ ├── DOUBLEDatatype.java │ │ ├── DataTypeReasoner.java │ │ ├── DataTypeSituation.java │ │ ├── Datatype.java │ │ ├── DatatypeClashes.java │ │ ├── DatatypeCombination.java │ │ ├── DatatypeEntry.java │ │ ├── DatatypeEnumeration.java │ │ ├── DatatypeExpression.java │ │ ├── DatatypeExpressionImpl.java │ │ ├── DatatypeFactory.java │ │ ├── DatatypeIntersection.java │ │ ├── DatatypeNegation.java │ │ ├── DatatypeNumericEnumeration.java │ │ ├── DatatypeNumericExpressionImpl.java │ │ ├── DatatypeOrderedExpressionImpl.java │ │ ├── DatatypeUnion.java │ │ ├── FLOATDatatype.java │ │ ├── Facet.java │ │ ├── Facets.java │ │ ├── HEXBINARYDatatype.java │ │ ├── INTDatatype.java │ │ ├── INTEGERDatatype.java │ │ ├── LANGUAGEDatatype.java │ │ ├── LITERALDatatype.java │ │ ├── LONGDatatype.java │ │ ├── Literal.java │ │ ├── LiteralEntry.java │ │ ├── LiteralImpl.java │ │ ├── NAMEDatatype.java │ │ ├── NCNAMEDatatype.java │ │ ├── NEGATIVEINTEGERDatatype.java │ │ ├── NMTOKENDatatype.java │ │ ├── NMTOKENSDatatype.java │ │ ├── NONNEGATIVEINTEGERDatatype.java │ │ ├── NONPOSITIVEINTEGERDatatype.java │ │ ├── NORMALIZEDSTRINGDatatype.java │ │ ├── NumericDatatype.java │ │ ├── NumericDatatypeWrapper.java │ │ ├── NumericLiteral.java │ │ ├── NumericLiteralImpl.java │ │ ├── OrderedDatatype.java │ │ ├── PLAINLITERALDatatype.java │ │ ├── POSITIVEINTEGERDatatype.java │ │ ├── RATIONALDatatype.java │ │ ├── REALDatatype.java │ │ ├── SHORTDatatype.java │ │ ├── STRINGDatatype.java │ │ ├── TOKENDatatype.java │ │ ├── UNSIGNEDBYTEDatatype.java │ │ ├── UNSIGNEDINTDatatype.java │ │ ├── UNSIGNEDLONGDatatype.java │ │ ├── UNSIGNEDSHORTDatatype.java │ │ ├── UnsignedByteForShort.java │ │ ├── Utils.java │ │ ├── XMLLITERALDatatype.java │ │ ├── cardinality.java │ │ ├── ordered.java │ │ ├── package-info.java │ │ └── schema.xsd │ │ ├── dep │ │ ├── DepSet.java │ │ └── package-info.java │ │ ├── helpers │ │ ├── ArrayIntMap.java │ │ ├── Assertions.java │ │ ├── DLTree.java │ │ ├── DLTreeFactory.java │ │ ├── DLVertex.java │ │ ├── DLVertexTagDFS.java │ │ ├── Helper.java │ │ ├── LogAdapter.java │ │ ├── Pair.java │ │ ├── Reference.java │ │ ├── SaveStack.java │ │ ├── SortedIntList.java │ │ ├── StatIndex.java │ │ ├── Stats.java │ │ ├── Templates.java │ │ ├── Timer.java │ │ ├── UnreachableSituationException.java │ │ └── package-info.java │ │ ├── kernel │ │ ├── AbsorptionActions.java │ │ ├── AddConceptResult.java │ │ ├── Axiom.java │ │ ├── AxiomSet.java │ │ ├── CGLabel.java │ │ ├── CWDArray.java │ │ ├── CacheStatus.java │ │ ├── ClassifiableEntry.java │ │ ├── Concept.java │ │ ├── ConceptWDep.java │ │ ├── DIOp.java │ │ ├── DLConceptTaxonomy.java │ │ ├── DLDag.java │ │ ├── DLVTable.java │ │ ├── DagTag.java │ │ ├── DlCompletionGraph.java │ │ ├── DlCompletionTree.java │ │ ├── DlCompletionTreeArc.java │ │ ├── DlSatTester.java │ │ ├── DumpInterface.java │ │ ├── DumpLisp.java │ │ ├── EdgeCompare.java │ │ ├── ExpressionCache.java │ │ ├── ExpressionManager.java │ │ ├── ExpressionTranslator.java │ │ ├── InAx.java │ │ ├── Individual.java │ │ ├── KBFlags.java │ │ ├── KBStatus.java │ │ ├── KnownSubsumers.java │ │ ├── Lexeme.java │ │ ├── LogicFeatures.java │ │ ├── MergableLabel.java │ │ ├── NameSet.java │ │ ├── NamedEntry.java │ │ ├── NamedEntryCollection.java │ │ ├── NominalReasoner.java │ │ ├── Ontology.java │ │ ├── OntologyLoader.java │ │ ├── RAStateTransitions.java │ │ ├── RATransition.java │ │ ├── ReasonerFreshEntityException.java │ │ ├── ReasoningKernel.java │ │ ├── Redo.java │ │ ├── Related.java │ │ ├── Restorer.java │ │ ├── Role.java │ │ ├── RoleAutomaton.java │ │ ├── RoleCompare.java │ │ ├── RoleMaster.java │ │ ├── SaveStackRare.java │ │ ├── SimpleRule.java │ │ ├── TBox.java │ │ ├── TDag2Interface.java │ │ ├── Taxonomy.java │ │ ├── TaxonomyCreator.java │ │ ├── TaxonomyVertex.java │ │ ├── Token.java │ │ ├── ToldSubsumers.java │ │ ├── UnMerge.java │ │ ├── actors │ │ │ ├── Actor.java │ │ │ ├── ActorImpl.java │ │ │ ├── AddRoleActor.java │ │ │ ├── ClassPolicy.java │ │ │ ├── DataPropertyPolicy.java │ │ │ ├── IndividualPolicy.java │ │ │ ├── ObjectPropertyPolicy.java │ │ │ ├── Policy.java │ │ │ ├── RIActor.java │ │ │ ├── SupConceptActor.java │ │ │ ├── TaxGatheringWalker.java │ │ │ ├── TaxonomyActor.java │ │ │ ├── WalkerInterface.java │ │ │ └── package-info.java │ │ ├── dl │ │ │ ├── AbstractConceptDataCardinality.java │ │ │ ├── ConceptAnd.java │ │ │ ├── ConceptBottom.java │ │ │ ├── ConceptDataExactCardinality.java │ │ │ ├── ConceptDataExists.java │ │ │ ├── ConceptDataForall.java │ │ │ ├── ConceptDataMaxCardinality.java │ │ │ ├── ConceptDataMinCardinality.java │ │ │ ├── ConceptDataValue.java │ │ │ ├── ConceptName.java │ │ │ ├── ConceptNot.java │ │ │ ├── ConceptObjectExactCardinality.java │ │ │ ├── ConceptObjectExists.java │ │ │ ├── ConceptObjectForall.java │ │ │ ├── ConceptObjectMaxCardinality.java │ │ │ ├── ConceptObjectMinCardinality.java │ │ │ ├── ConceptObjectSelf.java │ │ │ ├── ConceptObjectValue.java │ │ │ ├── ConceptOneOf.java │ │ │ ├── ConceptOr.java │ │ │ ├── ConceptTop.java │ │ │ ├── DataAnd.java │ │ │ ├── DataBottom.java │ │ │ ├── DataNot.java │ │ │ ├── DataOneOf.java │ │ │ ├── DataOr.java │ │ │ ├── DataRoleBottom.java │ │ │ ├── DataRoleName.java │ │ │ ├── DataRoleTop.java │ │ │ ├── DataTop.java │ │ │ ├── IndividualName.java │ │ │ ├── NAryExpressionImpl.java │ │ │ ├── NamedEntityImpl.java │ │ │ ├── ObjectRoleBottom.java │ │ │ ├── ObjectRoleChain.java │ │ │ ├── ObjectRoleInverse.java │ │ │ ├── ObjectRoleName.java │ │ │ ├── ObjectRoleProjectionFrom.java │ │ │ ├── ObjectRoleProjectionInto.java │ │ │ ├── ObjectRoleTop.java │ │ │ ├── axioms │ │ │ │ ├── AbstractNaryAxiom.java │ │ │ │ ├── AxiomConceptInclusion.java │ │ │ │ ├── AxiomDRoleDomain.java │ │ │ │ ├── AxiomDRoleFunctional.java │ │ │ │ ├── AxiomDRoleRange.java │ │ │ │ ├── AxiomDRoleSubsumption.java │ │ │ │ ├── AxiomDeclaration.java │ │ │ │ ├── AxiomDifferentIndividuals.java │ │ │ │ ├── AxiomDisjointConcepts.java │ │ │ │ ├── AxiomDisjointDRoles.java │ │ │ │ ├── AxiomDisjointORoles.java │ │ │ │ ├── AxiomDisjointUnion.java │ │ │ │ ├── AxiomEquivalentConcepts.java │ │ │ │ ├── AxiomEquivalentDRoles.java │ │ │ │ ├── AxiomEquivalentORoles.java │ │ │ │ ├── AxiomFairnessConstraint.java │ │ │ │ ├── AxiomImpl.java │ │ │ │ ├── AxiomIndividual.java │ │ │ │ ├── AxiomInstanceOf.java │ │ │ │ ├── AxiomORoleDomain.java │ │ │ │ ├── AxiomORoleFunctional.java │ │ │ │ ├── AxiomORoleRange.java │ │ │ │ ├── AxiomORoleSubsumption.java │ │ │ │ ├── AxiomRelatedTo.java │ │ │ │ ├── AxiomRelatedToNot.java │ │ │ │ ├── AxiomRoleAsymmetric.java │ │ │ │ ├── AxiomRoleInverse.java │ │ │ │ ├── AxiomRoleInverseFunctional.java │ │ │ │ ├── AxiomRoleIrreflexive.java │ │ │ │ ├── AxiomRoleReflexive.java │ │ │ │ ├── AxiomRoleSymmetric.java │ │ │ │ ├── AxiomRoleTransitive.java │ │ │ │ ├── AxiomSameIndividuals.java │ │ │ │ ├── AxiomSingleDRole.java │ │ │ │ ├── AxiomSingleORole.java │ │ │ │ ├── AxiomValueOf.java │ │ │ │ ├── AxiomValueOfNot.java │ │ │ │ ├── Axioms.java │ │ │ │ └── package-info.java │ │ │ ├── interfaces │ │ │ │ ├── ConceptArg.java │ │ │ │ ├── ConceptDataCardinalityExpression.java │ │ │ │ ├── ConceptDataRVExpression.java │ │ │ │ ├── ConceptDataRoleExpression.java │ │ │ │ ├── ConceptExpression.java │ │ │ │ ├── ConceptObjectCardinalityExpression.java │ │ │ │ ├── ConceptObjectRCExpression.java │ │ │ │ ├── ConceptObjectRoleExpression.java │ │ │ │ ├── DataExpression.java │ │ │ │ ├── DataExpressionArg.java │ │ │ │ ├── DataRoleArg.java │ │ │ │ ├── DataRoleExpression.java │ │ │ │ ├── Entity.java │ │ │ │ ├── Expression.java │ │ │ │ ├── IndividualExpression.java │ │ │ │ ├── NAryExpression.java │ │ │ │ ├── NamedEntity.java │ │ │ │ ├── NumberArg.java │ │ │ │ ├── ObjectRoleArg.java │ │ │ │ ├── ObjectRoleComplexExpression.java │ │ │ │ ├── ObjectRoleExpression.java │ │ │ │ ├── RoleExpression.java │ │ │ │ └── package-info.java │ │ │ └── package-info.java │ │ ├── modelcaches │ │ │ ├── ModelCacheConst.java │ │ │ ├── ModelCacheIan.java │ │ │ ├── ModelCacheInterface.java │ │ │ ├── ModelCacheSingleton.java │ │ │ ├── ModelCacheState.java │ │ │ ├── ModelCacheType.java │ │ │ └── package-info.java │ │ ├── options │ │ │ ├── JFactReasonerConfiguration.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ ├── state │ │ │ ├── DLCompletionGraphSaveState.java │ │ │ ├── DLCompletionTreeSaveState.java │ │ │ ├── SaveList.java │ │ │ ├── SaveState.java │ │ │ └── package-info.java │ │ └── todolist │ │ │ ├── ArrayQueue.java │ │ │ ├── QueueQueue.java │ │ │ ├── TODOListSaveState.java │ │ │ ├── ToDoEntry.java │ │ │ ├── ToDoList.java │ │ │ ├── ToDoPriorMatrix.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ └── visitors │ │ ├── DLAxiomVisitor.java │ │ ├── DLAxiomVisitorEx.java │ │ ├── DLExpressionVisitor.java │ │ ├── DLExpressionVisitorAdapter.java │ │ ├── DLExpressionVisitorEx.java │ │ ├── DLExpressionVisitorExAdapter.java │ │ └── package-info.java └── resources │ └── plugin.xml └── test ├── java ├── EnsureMavenAndReasonerVersionInSyncTest.java ├── bugs │ ├── AddIndividualsAfterLoadingTestCase.java │ ├── DateLiteralTest.java │ ├── DebugVerifyComplianceUniversityTestCase.java │ ├── StringsTestCase.java │ ├── VerifyComplianceBase.java │ ├── VerifyComplianceHostTestCase.java │ ├── VerifyComplianceMereologyTestCase.java │ ├── VerifyComplianceMiniTambisTestcase.java │ ├── VerifyComplianceOWLSNewFeaturesTestCase.java │ ├── VerifyComplianceOWLSTestCase.java │ ├── VerifyCompliancePeopleTestCase.java │ ├── VerifyComplianceUniversityTestCase.java │ ├── debug │ │ ├── BrokenTestCase.java │ │ ├── EquivalentTestCase.java │ │ ├── ReplicateOREFailuresTest.java │ │ ├── VerifyCorrectnessOfClassificationTest.java │ │ └── package-info.java │ └── package-info.java ├── conformancetests │ ├── ChangedTestCase.java │ ├── DateTimeTestCase.java │ ├── DebugWineTest.java │ ├── FixedTestCase.java │ ├── HasSelfSupportTestCase.java │ ├── JUnitRunner.java │ ├── NewFeaturesTestCase.java │ ├── OWL2TestCase.java │ ├── ProcessesTestCase.java │ ├── RDFBasedTestCase.java │ ├── StrangeTestCase.java │ ├── TestClasses.java │ ├── TopObjectPropertyTestCase.java │ ├── WebOnt208TestCase.java │ ├── WebOnt661TestCase.java │ ├── WebOntTestCase.java │ ├── WebOnt_AnnotationProperty_002TestCase.java │ ├── WebOnt_allValuesFrom_001TestCase.java │ ├── WebOnt_description_logic_209TestCase.java │ ├── WebOnt_description_logic_602_TestCase.java │ ├── WebOnt_miscellaneous_002TestCase.java │ ├── WebOnt_miscellaneous_wineTestCase.java │ └── package-info.java ├── datatypetests │ ├── DatatypesTestCase.java │ └── package-info.java └── testbase │ ├── TestBase.java │ └── package-info.java └── resources ├── AF_OWLS.owl.xml ├── AF_miniTambis.owl.xml ├── WebOnt_I4_5_001.owl ├── WebOnt_I4_5_002.owl ├── WebOnt_I5_21_002.owl ├── WebOnt_I5_2_003.owl ├── WebOnt_I5_2_004.owl ├── WebOnt_I5_2_005.owl ├── WebOnt_I5_2_006.owl ├── WebOnt_InverseFunctionalProperty_001.owl ├── WebOnt_description_logic_001.owl ├── WebOnt_description_logic_002.owl ├── WebOnt_description_logic_003.owl ├── WebOnt_description_logic_004.owl ├── WebOnt_description_logic_005.owl ├── WebOnt_description_logic_006.owl ├── WebOnt_description_logic_007.owl ├── WebOnt_description_logic_008.owl ├── WebOnt_description_logic_009.owl ├── WebOnt_description_logic_010.owl ├── WebOnt_description_logic_011.owl ├── WebOnt_description_logic_012.owl ├── WebOnt_description_logic_013.owl ├── WebOnt_description_logic_014.owl ├── WebOnt_description_logic_015.owl ├── WebOnt_description_logic_016.owl ├── WebOnt_description_logic_017.owl ├── WebOnt_description_logic_018.owl ├── WebOnt_description_logic_019.owl ├── WebOnt_description_logic_020.owl ├── WebOnt_description_logic_021.owl ├── WebOnt_description_logic_022.owl ├── WebOnt_description_logic_023.owl ├── WebOnt_description_logic_024.owl ├── WebOnt_description_logic_025.owl ├── WebOnt_description_logic_026.owl ├── WebOnt_description_logic_027.owl ├── WebOnt_description_logic_028.owl ├── WebOnt_description_logic_029.owl ├── WebOnt_description_logic_030.owl ├── WebOnt_description_logic_031.owl ├── WebOnt_description_logic_032.owl ├── WebOnt_description_logic_033.owl ├── WebOnt_description_logic_034.owl ├── WebOnt_description_logic_035.owl ├── WebOnt_description_logic_040.owl ├── WebOnt_description_logic_101.owl ├── WebOnt_description_logic_102.owl ├── WebOnt_description_logic_103.owl ├── WebOnt_description_logic_104.owl ├── WebOnt_description_logic_105.owl ├── WebOnt_description_logic_106.owl ├── WebOnt_description_logic_107.owl ├── WebOnt_description_logic_108.owl ├── WebOnt_description_logic_109.owl ├── WebOnt_description_logic_110.owl ├── WebOnt_description_logic_111.owl ├── WebOnt_description_logic_201.owl ├── WebOnt_description_logic_205.owl ├── WebOnt_description_logic_207.owl ├── WebOnt_description_logic_208.owl ├── WebOnt_description_logic_501.owl ├── WebOnt_description_logic_502.owl ├── WebOnt_description_logic_503.owl ├── WebOnt_description_logic_504.owl ├── WebOnt_description_logic_601.owl ├── WebOnt_description_logic_603.owl ├── WebOnt_description_logic_604.owl ├── WebOnt_description_logic_605.owl ├── WebOnt_description_logic_606.owl ├── WebOnt_description_logic_608.owl ├── WebOnt_description_logic_609.owl ├── WebOnt_description_logic_610.owl ├── WebOnt_description_logic_611.owl ├── WebOnt_description_logic_612.owl ├── WebOnt_description_logic_613.owl ├── WebOnt_description_logic_614.owl ├── WebOnt_description_logic_615.owl ├── WebOnt_description_logic_616.owl ├── WebOnt_description_logic_617.owl ├── WebOnt_description_logic_623.owl ├── WebOnt_description_logic_624.owl ├── WebOnt_description_logic_625.owl ├── WebOnt_description_logic_626.owl ├── WebOnt_description_logic_627.owl ├── WebOnt_description_logic_628.owl ├── WebOnt_description_logic_629.owl ├── WebOnt_description_logic_630.owl ├── WebOnt_description_logic_631.owl ├── WebOnt_description_logic_632.owl ├── WebOnt_description_logic_633.owl ├── WebOnt_description_logic_634.owl ├── WebOnt_description_logic_641.owl ├── WebOnt_description_logic_642.owl ├── WebOnt_description_logic_643.owl ├── WebOnt_description_logic_644.owl ├── WebOnt_description_logic_646.owl ├── WebOnt_description_logic_650.owl ├── WebOnt_description_logic_665.owl ├── WebOnt_description_logic_667.owl ├── WebOnt_description_logic_901.owl ├── WebOnt_description_logic_905.owl ├── WebOnt_description_logic_908.owl ├── WebOnt_disjointWith_003.owl ├── WebOnt_disjointWith_004.owl ├── WebOnt_disjointWith_005.owl ├── WebOnt_disjointWith_006.owl ├── WebOnt_disjointWith_007.owl ├── WebOnt_maxCardinality_001.owl ├── host.owl ├── rdfbased_sem_restrict_allvalues_cmp_class.owl ├── rdfbased_sem_restrict_allvalues_cmp_prop.owl ├── rdfbased_sem_restrict_hasvalue_cmp_prop.owl ├── rdfbased_sem_restrict_maxqcr_inst_obj_one.owl ├── rdfbased_sem_restrict_somevalues_cmp_class.owl ├── rdfbased_sem_restrict_somevalues_cmp_prop.owl ├── simplelogger.properties ├── webont002.owl ├── webont209.owl └── wine.fss /.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /bin 3 | /target 4 | /.classpath 5 | /.project 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | -------------------------------------------------------------------------------- /src/main/java/conformance/FaCTRevision.txt: -------------------------------------------------------------------------------- 1 | FaCT++ revision to which this code refers: 16 September 2016 d7f377351d82ea5243262538e43ddc4f0312ecdf https://bitbucket.org/dtsarkov/factplusplus/commits/d7f377351d82ea5243262538e43ddc4f0312ecdf 2 | -------------------------------------------------------------------------------- /src/main/java/conformance/Original.java: -------------------------------------------------------------------------------- 1 | package conformance; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.lang.annotation.Documented; 9 | import java.lang.annotation.Retention; 10 | import java.lang.annotation.RetentionPolicy; 11 | 12 | /** 13 | * Mark a field, method, method argument or type as original - not ported from 14 | * FaCT++, or with no simple correspondence. 15 | * 16 | * @author ignazio 17 | */ 18 | @Documented 19 | @Retention(RetentionPolicy.RUNTIME) 20 | public @interface Original {} 21 | -------------------------------------------------------------------------------- /src/main/java/conformance/PortedFrom.java: -------------------------------------------------------------------------------- 1 | package conformance; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.lang.annotation.Documented; 9 | import java.lang.annotation.Retention; 10 | import java.lang.annotation.RetentionPolicy; 11 | 12 | /** 13 | * Mark a field, method, method argument or type with the original file and 14 | * original name in FaCT++. 15 | * 16 | * @author ignazio 17 | */ 18 | @Documented 19 | @Retention(RetentionPolicy.RUNTIME) 20 | public @interface PortedFrom { 21 | 22 | /** 23 | * the file with the definition. 24 | * 25 | * @return file 26 | */ 27 | String file(); 28 | 29 | /** 30 | * the original name. 31 | * 32 | * @return name 33 | */ 34 | String name(); 35 | 36 | /** 37 | * optional method name, for method arguments. 38 | * 39 | * @return argument 40 | */ 41 | String argumentFor() default ""; 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/conformance/header.txt: -------------------------------------------------------------------------------- 1 | /* This file is part of the JFact DL reasoner 2 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 3 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 4 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 5 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ -------------------------------------------------------------------------------- /src/main/java/conformance/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package conformance; 3 | -------------------------------------------------------------------------------- /src/main/java/conformance/todo.txt: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------- 2 | // Kernel management (like newKB/curKB/releaseKB) 3 | //------------------------------------------------------------- 4 | 5 | /// try to load configuration from FILE; @return false if successful 6 | bool loadConfiguration ( ReasoningKernel* K, const char* file ) 7 | { 8 | Configuration Config; 9 | 10 | if ( Config.Load(file) ) 11 | return true; 12 | if ( K->getOptions()->initByConfigure ( Config, "Tuning" ) ) 13 | return true; 14 | std::cerr << "Using options from file " << file << "\n"; 15 | return false; 16 | } 17 | 18 | /* 19 | * Class: uk_ac_manchester_cs_factplusplus_FaCTPlusPlus 20 | * Method: initKernel 21 | * Signature: ()V 22 | */ 23 | JNIEXPORT void JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_initKernel 24 | (JNIEnv * env, jobject obj) 25 | { 26 | // create new kernel and save it in an FaCTPlusPlus object 27 | ReasoningKernel* Kernel = new ReasoningKernel(); 28 | env->SetLongField ( obj, KernelFID, (jlong)Kernel ); 29 | 30 | // try to load configuration 31 | if ( loadConfiguration ( Kernel, ".fpp-options" ) ) 32 | loadConfiguration ( Kernel, "fpp-options.txt" ); 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/java/jfact/plugin/protege/JFactProtegeFactory.java: -------------------------------------------------------------------------------- 1 | package jfact.plugin.protege; 2 | 3 | import org.protege.editor.owl.model.inference.AbstractProtegeOWLReasonerInfo; 4 | import org.semanticweb.owlapi.reasoner.BufferingMode; 5 | import org.semanticweb.owlapi.reasoner.OWLReasonerFactory; 6 | 7 | import uk.ac.manchester.cs.jfact.JFactFactory; 8 | 9 | /** 10 | * @author ignazio 11 | */ 12 | public class JFactProtegeFactory extends AbstractProtegeOWLReasonerInfo { 13 | 14 | private JFactFactory fac; 15 | 16 | @Override 17 | public void initialise() { 18 | fac = new JFactFactory(); 19 | } 20 | 21 | @Override 22 | public void dispose() { 23 | fac = null; 24 | } 25 | 26 | @Override 27 | public BufferingMode getRecommendedBuffering() { 28 | return BufferingMode.BUFFERING; 29 | } 30 | 31 | @Override 32 | public OWLReasonerFactory getReasonerFactory() { 33 | return fac; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/jfact/plugin/protege/JFactRenderingViewComponent.java: -------------------------------------------------------------------------------- 1 | package jfact.plugin.protege; 2 | 3 | import java.io.Writer; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | import org.protege.editor.owl.ui.view.ontology.AbstractOntologyRenderingViewComponent; 8 | import org.semanticweb.owlapi.model.OWLOntology; 9 | 10 | /** 11 | * @author ignazio 12 | */ 13 | public class JFactRenderingViewComponent extends AbstractOntologyRenderingViewComponent { 14 | 15 | @Override 16 | protected void renderOntology(@Nullable OWLOntology ontology, @Nullable Writer writer) 17 | throws Exception { 18 | if (writer != null) { 19 | writer.append("Not implemented for owlapi v3"); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/jfact/plugin/protege/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package jfact.plugin.protege; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/EntityVisitorEx.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact; 2 | 3 | import java.io.Serializable; 4 | 5 | import org.semanticweb.owlapi.model.OWLAnnotationProperty; 6 | import org.semanticweb.owlapi.model.OWLClass; 7 | import org.semanticweb.owlapi.model.OWLDataProperty; 8 | import org.semanticweb.owlapi.model.OWLDatatype; 9 | import org.semanticweb.owlapi.model.OWLEntityVisitorEx; 10 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 11 | import org.semanticweb.owlapi.model.OWLObjectProperty; 12 | 13 | import uk.ac.manchester.cs.jfact.kernel.dl.axioms.Axioms; 14 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.Expression; 15 | 16 | class EntityVisitorEx implements OWLEntityVisitorEx, Serializable { 17 | 18 | 19 | private TranslationMachinery tr; 20 | 21 | public EntityVisitorEx(TranslationMachinery em) { 22 | tr = em; 23 | } 24 | 25 | @Override 26 | public Expression visit(OWLClass cls) { 27 | return tr.pointer(cls); 28 | } 29 | 30 | @Override 31 | public Expression visit(OWLObjectProperty property) { 32 | return tr.pointer(property); 33 | } 34 | 35 | @Override 36 | public Expression visit(OWLDataProperty property) { 37 | return tr.pointer(property); 38 | } 39 | 40 | @Override 41 | public Expression visit(OWLNamedIndividual individual) { 42 | return tr.pointer(individual); 43 | } 44 | 45 | @Override 46 | public Expression visit(OWLDatatype datatype) { 47 | return Axioms.dummyExpression(); 48 | } 49 | 50 | @Override 51 | public Expression visit(OWLAnnotationProperty property) { 52 | return Axioms.dummyExpression(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/ANYURIDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.LITERAL; 4 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.STRINGFACETS; 5 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.WHITESPACE; 6 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whiteSpace; 7 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whitespace.COLLAPSE; 8 | 9 | import java.net.URI; 10 | 11 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 12 | 13 | class ANYURIDatatype extends AbstractDatatype { 14 | 15 | ANYURIDatatype() { 16 | super(XSDVocabulary.ANY_URI, STRINGFACETS, Utils.generateAncestors(LITERAL)); 17 | knownNonNumericFacetValues.putAll(LITERAL.getKnownNonNumericFacetValues()); 18 | knownNumericFacetValues.putAll(LITERAL.getKnownNumericFacetValues()); 19 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 20 | } 21 | 22 | @Override 23 | public String parseValue(String s) { 24 | return COLLAPSE.normalize(s); 25 | } 26 | 27 | @Override 28 | public boolean isInValueSpace(String l) { 29 | try { 30 | URI.create(l); 31 | return true; 32 | } catch (@SuppressWarnings("unused") IllegalArgumentException e) { 33 | return false; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/BASE64BINARYDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whiteSpace; 5 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whitespace.COLLAPSE; 6 | 7 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 8 | 9 | class BASE64BINARYDatatype extends AbstractDatatype { 10 | 11 | BASE64BINARYDatatype() { 12 | super(XSDVocabulary.BASE_64_BINARY, STRINGFACETS, Utils.generateAncestors(LITERAL)); 13 | knownNonNumericFacetValues.putAll(LITERAL.getKnownNonNumericFacetValues()); 14 | knownNumericFacetValues.putAll(LITERAL.getKnownNumericFacetValues()); 15 | knownNonNumericFacetValues.put(whiteSpace, COLLAPSE); 16 | } 17 | 18 | @Override 19 | public String parseValue(String s) { 20 | return COLLAPSE.normalize(s); 21 | } 22 | 23 | @Override 24 | public boolean isInValueSpace(String s) { 25 | // all characters are letters, numbers, or +/= 26 | return s.chars().allMatch(c -> Character.isLetterOrDigit((char) c) || "+/=".indexOf(c) > -1); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/BOOLEANDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.util.ArrayList; 7 | import java.util.Collection; 8 | import java.util.List; 9 | 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | import uk.ac.manchester.cs.jfact.datatypes.Facets.whitespace; 13 | 14 | class BOOLEANDatatype extends AbstractDatatype { 15 | 16 | BOOLEANDatatype() { 17 | super(XSDVocabulary.BOOLEAN, Utils.getFacets(pattern, whiteSpace), Utils.generateAncestors(LITERAL)); 18 | knownNonNumericFacetValues.putAll(LITERAL.getKnownNonNumericFacetValues()); 19 | knownNumericFacetValues.putAll(LITERAL.getKnownNumericFacetValues()); 20 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 21 | } 22 | 23 | @Override 24 | public cardinality getCardinality() { 25 | return cardinality.FINITE; 26 | } 27 | 28 | @Override 29 | public Collection> listValues() { 30 | // if all datatypes are compatible, the intersection is the two 31 | // booleans minu any restriction 32 | List> toReturn = new ArrayList<>(2); 33 | toReturn.add(buildLiteral(Boolean.toString(true))); 34 | toReturn.add(buildLiteral(Boolean.toString(false))); 35 | return toReturn; 36 | } 37 | 38 | @Override 39 | public Boolean parseValue(String s) { 40 | whitespace facet = (whitespace) whiteSpace.parse(knownNonNumericFacetValues.get(whiteSpace)); 41 | return Boolean.valueOf(facet.normalize(s)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/BYTEDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | 8 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 9 | 10 | class BYTEDatatype extends SHORTDatatype { 11 | 12 | protected BYTEDatatype() { 13 | super(XSDVocabulary.BYTE, Utils.generateAncestors(SHORT)); 14 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 15 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 16 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 17 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 18 | knownNumericFacetValues.put(minInclusive, new BigDecimal(Byte.MIN_VALUE)); 19 | knownNumericFacetValues.put(maxInclusive, new BigDecimal(Byte.MAX_VALUE)); 20 | } 21 | 22 | @Override 23 | public Byte parseValue(String s) { 24 | return Byte.valueOf(s); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/DATETIMESTAMPDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.DATETIME; 4 | 5 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 6 | 7 | class DATETIMESTAMPDatatype extends DATETIMEDatatype { 8 | 9 | DATETIMESTAMPDatatype() { 10 | super(XSDVocabulary.DATE_TIME_STAMP, Utils.generateAncestors(DATETIME)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/DECIMALDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whiteSpace; 5 | 6 | import java.math.BigDecimal; 7 | import java.util.Set; 8 | 9 | import org.semanticweb.owlapi.model.HasIRI; 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | class DECIMALDatatype> extends RATIONALDatatype { 13 | 14 | DECIMALDatatype() { 15 | this(XSDVocabulary.DECIMAL, Utils.generateAncestors(RATIONAL)); 16 | } 17 | 18 | DECIMALDatatype(HasIRI uri, Set> ancestors) { 19 | super(uri, Utils.getFacets(DIGS, PEW, MINMAX), ancestors); 20 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 21 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 22 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 23 | } 24 | 25 | @Override 26 | @SuppressWarnings("unchecked") 27 | public R parseValue(String s) { 28 | return (R) new BigDecimal(s); 29 | } 30 | 31 | @Override 32 | public ordered getOrdered() { 33 | return ordered.TOTAL; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/DOUBLEDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whiteSpace; 5 | 6 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 7 | 8 | class DOUBLEDatatype extends AbstractNumericDatatype { 9 | 10 | DOUBLEDatatype() { 11 | super(XSDVocabulary.DOUBLE, Utils.getFacets(PEW, MINMAX), Utils.generateAncestors(LITERAL)); 12 | knownNonNumericFacetValues.putAll(LITERAL.getKnownNonNumericFacetValues()); 13 | knownNumericFacetValues.putAll(LITERAL.getKnownNumericFacetValues()); 14 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 15 | } 16 | 17 | @Override 18 | public boolean getBounded() { 19 | return true; 20 | } 21 | 22 | @Override 23 | public cardinality getCardinality() { 24 | return cardinality.FINITE; 25 | } 26 | 27 | @Override 28 | public boolean getNumeric() { 29 | return true; 30 | } 31 | 32 | @Override 33 | public Double parseValue(String s) { 34 | return Double.valueOf(s); 35 | } 36 | 37 | @Override 38 | public boolean isCompatible(Datatype type) { 39 | return isDatatypeCompatible(type); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/DatatypeClashes.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | /** datatype clashes */ 9 | public enum DatatypeClashes { 10 | /** DT_TT */ 11 | DT_TT(" DT-TT"), 12 | /** DT_Empty_interval */ 13 | DT_EMPTY_INTERVAL(" DT-Empty_interval"), 14 | /** DT_C_MM */ 15 | DT_C_MM(" DT-C-MM"), 16 | /** DT_TNT */ 17 | DT_TNT(" DT-TNT"), 18 | /** DT_C_IT */ 19 | DT_C_IT(" DT-C-IT"); 20 | 21 | private String label; 22 | 23 | DatatypeClashes(String s) { 24 | label = s; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return label; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/Facet.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import java.io.Serializable; 4 | 5 | import org.semanticweb.owlapi.vocab.OWLFacet; 6 | 7 | /* This file is part of the JFact DL reasoner 8 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 9 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 10 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 12 | /** 13 | * @author ignazio 14 | */ 15 | public interface Facet extends Serializable { 16 | 17 | /** 18 | * This is a convenience method that enables each facet to parse its values without client code 19 | * having to worry whether the values are literals or strings - the typing is known to the facet 20 | * implementation 21 | * 22 | * @param value value 23 | * @param type 24 | * @return value that is assigned to this facet 25 | */ 26 | > T parseNumber(Object value); 27 | 28 | /** 29 | * @param value value 30 | * @return the typed value for value 31 | */ 32 | @SuppressWarnings("rawtypes") 33 | Comparable parse(Object value); 34 | 35 | /** @return true if number facet */ 36 | boolean isNumberFacet(); 37 | 38 | /** @return the facet uri */ 39 | String getURI(); 40 | 41 | /** @return OWLFacet vale */ 42 | OWLFacet facet(); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/HEXBINARYDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whiteSpace; 5 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whitespace.COLLAPSE; 6 | 7 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 8 | 9 | class HEXBINARYDatatype extends AbstractDatatype { 10 | 11 | HEXBINARYDatatype() { 12 | super(XSDVocabulary.HEX_BINARY, STRINGFACETS, Utils.generateAncestors(LITERAL)); 13 | knownNonNumericFacetValues.putAll(LITERAL.getKnownNonNumericFacetValues()); 14 | knownNumericFacetValues.putAll(LITERAL.getKnownNumericFacetValues()); 15 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 16 | } 17 | 18 | @Override 19 | public String parseValue(String s) { 20 | return COLLAPSE.normalize(s); 21 | } 22 | 23 | @Override 24 | public boolean isInValueSpace(String s) { 25 | // all characters are numbers, or ABCDEF 26 | return s.chars().allMatch(c -> Character.isDigit((char) c) || "ABCDEF".indexOf(c) > -1); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/INTDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | import java.util.Set; 8 | 9 | import org.semanticweb.owlapi.model.HasIRI; 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | class INTDatatype> extends LONGDatatype { 13 | 14 | protected INTDatatype() { 15 | this(XSDVocabulary.INT, Utils.generateAncestors(LONG)); 16 | } 17 | 18 | protected INTDatatype(HasIRI uri, Set> ancestors) { 19 | super(uri, ancestors); 20 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 21 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 22 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 23 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 24 | knownNumericFacetValues.put(minInclusive, new BigDecimal(Integer.MIN_VALUE)); 25 | knownNumericFacetValues.put(maxInclusive, new BigDecimal(Integer.MAX_VALUE)); 26 | } 27 | 28 | @Override 29 | @SuppressWarnings("unchecked") 30 | public R parseValue(String s) { 31 | return (R) Integer.valueOf(s); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/INTEGERDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigInteger; 7 | import java.util.Set; 8 | 9 | import org.semanticweb.owlapi.model.HasIRI; 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | class INTEGERDatatype> extends DECIMALDatatype { 13 | 14 | protected INTEGERDatatype() { 15 | this(XSDVocabulary.INTEGER, Utils.generateAncestors(DECIMAL)); 16 | } 17 | 18 | protected INTEGERDatatype(HasIRI uri, Set> ancestors) { 19 | super(uri, ancestors); 20 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 21 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 22 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 23 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 24 | knownNonNumericFacetValues.put(fractionDigits, Integer.valueOf(0)); 25 | } 26 | 27 | @Override 28 | @SuppressWarnings("unchecked") 29 | public R parseValue(String s) { 30 | return (R) new BigInteger(s); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/LANGUAGEDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 7 | 8 | class LANGUAGEDatatype extends TOKENDatatype { 9 | 10 | protected LANGUAGEDatatype() { 11 | super(XSDVocabulary.LANGUAGE, Utils.generateAncestors(TOKEN)); 12 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 13 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 14 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 15 | knownNonNumericFacetValues.put(pattern, "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/LITERALDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import java.util.Collections; 4 | 5 | import org.semanticweb.owlapi.vocab.OWLRDFVocabulary; 6 | 7 | class LITERALDatatype extends AbstractDatatype { 8 | 9 | LITERALDatatype() { 10 | super(OWLRDFVocabulary.RDFS_LITERAL, Collections. emptySet(), Collections.> emptySet()); 11 | } 12 | 13 | @Override 14 | public String parseValue(String s) { 15 | return s; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/LONGDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | import java.util.Set; 8 | 9 | import org.semanticweb.owlapi.model.HasIRI; 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | class LONGDatatype> extends INTEGERDatatype { 13 | 14 | protected LONGDatatype() { 15 | this(XSDVocabulary.LONG, Utils.generateAncestors(INTEGER)); 16 | } 17 | 18 | protected LONGDatatype(HasIRI uri, Set> ancestors) { 19 | super(uri, ancestors); 20 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 21 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 22 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 23 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 24 | knownNumericFacetValues.put(minInclusive, new BigDecimal(Long.MIN_VALUE)); 25 | knownNumericFacetValues.put(maxInclusive, new BigDecimal(Long.MAX_VALUE)); 26 | } 27 | 28 | @Override 29 | @SuppressWarnings({ "unchecked" }) 30 | public R parseValue(String s) { 31 | return (R) Long.valueOf(s); 32 | } 33 | 34 | @Override 35 | public boolean getBounded() { 36 | return true; 37 | } 38 | 39 | @Override 40 | public cardinality getCardinality() { 41 | return cardinality.FINITE; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/Literal.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import java.io.Serializable; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.DataExpression; 11 | 12 | /** 13 | * @author ignazio 14 | * @param 15 | * type 16 | */ 17 | public interface Literal> extends DataExpression, Comparable>, Serializable { 18 | 19 | /** @return datatype */ 20 | Datatype getDatatypeExpression(); 21 | 22 | /** @return value as string */ 23 | String value(); 24 | 25 | /** @return value */ 26 | T typedValue(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NAMEDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.util.Set; 7 | 8 | import org.semanticweb.owlapi.model.HasIRI; 9 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 10 | 11 | class NAMEDatatype extends TOKENDatatype { 12 | 13 | public NAMEDatatype() { 14 | this(XSDVocabulary.NAME, Utils.generateAncestors(TOKEN)); 15 | } 16 | 17 | protected NAMEDatatype(HasIRI uri, Set> ancestors) { 18 | super(uri, ancestors); 19 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 20 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 21 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 22 | knownNonNumericFacetValues.put(pattern, "\\i\\c*"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NCNAMEDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import org.semanticweb.owlapi.model.IRI; 7 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 8 | 9 | class NCNAMEDatatype extends NAMEDatatype { 10 | 11 | protected NCNAMEDatatype() { 12 | super(XSDVocabulary.NCNAME, Utils.generateAncestors(NAME)); 13 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 14 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 15 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 16 | knownNonNumericFacetValues.put(pattern, "[\\i-[:]][\\c-[:]]*"); 17 | } 18 | 19 | @Override 20 | public IRI getDatatypeIRI() { 21 | return uri; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NEGATIVEINTEGERDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.NONPOSITIVEINTEGER; 4 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.NUMBER_EXPRESSION; 5 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.WHITESPACE; 6 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.maxInclusive; 7 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.pattern; 8 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whiteSpace; 9 | 10 | import java.math.BigDecimal; 11 | import java.math.BigInteger; 12 | 13 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 14 | 15 | class NEGATIVEINTEGERDatatype> extends NONPOSITIVEINTEGERDatatype { 16 | 17 | protected NEGATIVEINTEGERDatatype() { 18 | super(XSDVocabulary.NEGATIVE_INTEGER, Utils.generateAncestors(NONPOSITIVEINTEGER)); 19 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 20 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 21 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 22 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 23 | knownNumericFacetValues.put(maxInclusive, new BigDecimal(-1L)); 24 | } 25 | 26 | @Override 27 | @SuppressWarnings("unchecked") 28 | public R parseValue(String s) { 29 | BigInteger parse = new BigInteger(s); 30 | if (parse.signum() > -1) { 31 | throw new ArithmeticException("Negative integer required, but found: " + s); 32 | } 33 | return (R) parse; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NMTOKENDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.util.Set; 7 | 8 | import org.semanticweb.owlapi.model.HasIRI; 9 | import org.semanticweb.owlapi.model.IRI; 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | class NMTOKENDatatype extends TOKENDatatype { 13 | 14 | protected NMTOKENDatatype() { 15 | this(XSDVocabulary.NMTOKEN, Utils.generateAncestors(TOKEN)); 16 | } 17 | 18 | protected NMTOKENDatatype(HasIRI uri, Set> ancestors) { 19 | super(uri, ancestors); 20 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 21 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 22 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 23 | knownNonNumericFacetValues.put(pattern, "\\c+"); 24 | } 25 | 26 | @Override 27 | public IRI getDatatypeIRI() { 28 | return uri; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NMTOKENSDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 7 | 8 | class NMTOKENSDatatype extends NMTOKENDatatype { 9 | 10 | protected NMTOKENSDatatype() { 11 | super(XSDVocabulary.NMTOKENS, Utils.generateAncestors(NMTOKEN)); 12 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 13 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 14 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 15 | knownNonNumericFacetValues.put(minLength, Integer.valueOf(1)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NONNEGATIVEINTEGERDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | import java.math.BigInteger; 8 | import java.util.Set; 9 | 10 | import org.semanticweb.owlapi.model.HasIRI; 11 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 12 | 13 | class NONNEGATIVEINTEGERDatatype> extends INTEGERDatatype { 14 | 15 | protected NONNEGATIVEINTEGERDatatype() { 16 | this(XSDVocabulary.NON_NEGATIVE_INTEGER, Utils.generateAncestors(INTEGER)); 17 | } 18 | 19 | protected NONNEGATIVEINTEGERDatatype(HasIRI uri, Set> ancestors) { 20 | super(uri, ancestors); 21 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 22 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 23 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 24 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 25 | knownNumericFacetValues.put(minInclusive, new BigDecimal(0L)); 26 | } 27 | 28 | @Override 29 | @SuppressWarnings("unchecked") 30 | public R parseValue(String s) { 31 | BigInteger parseValue = new BigInteger(s); 32 | if (parseValue.compareTo(BigInteger.ZERO) < 0) { 33 | throw new ArithmeticException("Non negative integer required, but found: " + s); 34 | } 35 | return (R) parseValue; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NONPOSITIVEINTEGERDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | import java.math.BigInteger; 8 | import java.util.Set; 9 | 10 | import org.semanticweb.owlapi.model.HasIRI; 11 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 12 | 13 | class NONPOSITIVEINTEGERDatatype> extends INTEGERDatatype { 14 | 15 | protected NONPOSITIVEINTEGERDatatype() { 16 | this(XSDVocabulary.NON_POSITIVE_INTEGER, Utils.generateAncestors(INTEGER)); 17 | } 18 | 19 | protected NONPOSITIVEINTEGERDatatype(HasIRI uri, Set> ancestors) { 20 | super(uri, ancestors); 21 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 22 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 23 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 24 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 25 | knownNumericFacetValues.put(maxInclusive, new BigDecimal(0L)); 26 | } 27 | 28 | @Override 29 | @SuppressWarnings("unchecked") 30 | public R parseValue(String s) { 31 | BigInteger parse = new BigInteger(s); 32 | if (parse.compareTo(BigInteger.ZERO) > 0) { 33 | throw new ArithmeticException("Non positive integer required, but found: " + s); 34 | } 35 | return (R) parse; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NORMALIZEDSTRINGDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.STRING; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whiteSpace; 5 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whitespace.REPLACE; 6 | 7 | import java.util.Set; 8 | 9 | import org.semanticweb.owlapi.model.HasIRI; 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | class NORMALIZEDSTRINGDatatype extends STRINGDatatype { 13 | 14 | protected NORMALIZEDSTRINGDatatype() { 15 | this(XSDVocabulary.NORMALIZED_STRING, Utils.generateAncestors(STRING)); 16 | } 17 | 18 | protected NORMALIZEDSTRINGDatatype(HasIRI uri, Set> ancestors) { 19 | super(uri, ancestors); 20 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 21 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 22 | knownNonNumericFacetValues.put(whiteSpace, REPLACE); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NumericDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | /** 11 | * all Datatypes whose getNumeric() method returns true implement this interface 12 | * 13 | * @param 14 | * type 15 | */ 16 | public interface NumericDatatype> extends Datatype, OrderedDatatype { 17 | 18 | @Override 19 | boolean hasMinExclusive(); 20 | 21 | @Override 22 | boolean hasMinInclusive(); 23 | 24 | @Override 25 | boolean hasMaxExclusive(); 26 | 27 | @Override 28 | boolean hasMaxInclusive(); 29 | 30 | @Override 31 | boolean hasMin(); 32 | 33 | @Override 34 | boolean hasMax(); 35 | 36 | @Nullable 37 | @Override 38 | R getMin(); 39 | 40 | @Nullable 41 | @Override 42 | R getMax(); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NumericLiteral.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | /** 9 | * all literals whose datatype is numeric 10 | * 11 | * @param 12 | * type 13 | */ 14 | public interface NumericLiteral> extends Literal {} 15 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/NumericLiteralImpl.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | /** 9 | * all literals whose datatype is numeric 10 | * 11 | * @param 12 | * type 13 | */ 14 | public class NumericLiteralImpl> extends LiteralImpl 15 | implements NumericLiteral { 16 | 17 | 18 | 19 | /** 20 | * @param type 21 | * type 22 | * @param value 23 | * value 24 | */ 25 | public NumericLiteralImpl(NumericDatatype type, 26 | String value) { 27 | super(type, value); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/OrderedDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | /** 11 | * all Datatypes whose getNumeric() method returns true implement this interface 12 | * 13 | * @param 14 | * type 15 | */ 16 | public interface OrderedDatatype> { 17 | 18 | /** @return true if min exclusive facet applies */ 19 | boolean hasMinExclusive(); 20 | 21 | /** @return true if min inclusive facet applies */ 22 | boolean hasMinInclusive(); 23 | 24 | /** @return true if max exclusive facet applies */ 25 | boolean hasMaxExclusive(); 26 | 27 | /** @return true if max inclusive facet applies */ 28 | boolean hasMaxInclusive(); 29 | 30 | /** @return true if min exists */ 31 | boolean hasMin(); 32 | 33 | /** @return true if max exists */ 34 | boolean hasMax(); 35 | 36 | /** @return value for min */ 37 | @Nullable 38 | R getMin(); 39 | 40 | /** @return value for max */ 41 | @Nullable 42 | R getMax(); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/PLAINLITERALDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.LITERAL; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import org.semanticweb.owlapi.vocab.OWLRDFVocabulary; 7 | 8 | class PLAINLITERALDatatype extends AbstractDatatype { 9 | 10 | PLAINLITERALDatatype() { 11 | super(OWLRDFVocabulary.RDF_PLAIN_LITERAL, Utils.getFacets(length, minLength, maxLength, pattern, enumeration), 12 | Utils.generateAncestors(LITERAL)); 13 | knownNonNumericFacetValues.putAll(LITERAL.getKnownNonNumericFacetValues()); 14 | knownNumericFacetValues.putAll(LITERAL.getKnownNumericFacetValues()); 15 | } 16 | 17 | @Override 18 | public String parseValue(String s) { 19 | return s; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/POSITIVEINTEGERDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | import java.math.BigInteger; 8 | 9 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 10 | 11 | class POSITIVEINTEGERDatatype> extends NONNEGATIVEINTEGERDatatype { 12 | 13 | protected POSITIVEINTEGERDatatype() { 14 | super(XSDVocabulary.POSITIVE_INTEGER, Utils.generateAncestors(NONNEGATIVEINTEGER)); 15 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 16 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 17 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 18 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 19 | knownNumericFacetValues.put(minInclusive, new BigDecimal(1L)); 20 | } 21 | 22 | @Override 23 | @SuppressWarnings("unchecked") 24 | public R parseValue(String s) { 25 | BigInteger parseValue = new BigInteger(s); 26 | if (parseValue.compareTo(BigInteger.ZERO) <= 0) { 27 | throw new ArithmeticException("Positive integer required, but found: " + s); 28 | } 29 | return (R) parseValue; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/RATIONALDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.REAL; 4 | 5 | import java.math.BigDecimal; 6 | import java.util.Collections; 7 | import java.util.Set; 8 | 9 | import org.semanticweb.owlapi.model.HasIRI; 10 | import org.semanticweb.owlapi.vocab.OWL2Datatype; 11 | 12 | class RATIONALDatatype> extends REALDatatype { 13 | 14 | protected RATIONALDatatype(HasIRI uri, Set f, Set> ancestors) { 15 | super(uri, f, ancestors); 16 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 17 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 18 | } 19 | 20 | protected RATIONALDatatype() { 21 | this(OWL2Datatype.OWL_RATIONAL); 22 | } 23 | 24 | protected RATIONALDatatype(HasIRI uri) { 25 | this(uri, Collections. emptySet(), Utils.generateAncestors(REAL)); 26 | } 27 | 28 | @Override 29 | @SuppressWarnings("unchecked") 30 | public R parseValue(String s) { 31 | return (R) new BigDecimal(s); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/SHORTDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | import java.util.Set; 8 | 9 | import org.semanticweb.owlapi.model.HasIRI; 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | class SHORTDatatype> extends INTDatatype { 13 | 14 | protected SHORTDatatype() { 15 | this(XSDVocabulary.SHORT, Utils.generateAncestors(INT)); 16 | } 17 | 18 | protected SHORTDatatype(HasIRI uri, Set> ancestors) { 19 | super(uri, ancestors); 20 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 21 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 22 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 23 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 24 | knownNumericFacetValues.put(minInclusive, new BigDecimal(Short.MIN_VALUE)); 25 | knownNumericFacetValues.put(maxInclusive, new BigDecimal(Short.MAX_VALUE)); 26 | } 27 | 28 | @Override 29 | @SuppressWarnings({ "unchecked" }) 30 | public R parseValue(String s) { 31 | return (R) Short.valueOf(s); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/STRINGDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whiteSpace; 5 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whitespace.PRESERVE; 6 | 7 | import java.util.Set; 8 | 9 | import org.semanticweb.owlapi.model.HasIRI; 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | class STRINGDatatype extends AbstractDatatype { 13 | 14 | public STRINGDatatype() { 15 | this(XSDVocabulary.STRING, Utils.generateAncestors(PLAINLITERAL)); 16 | } 17 | 18 | STRINGDatatype(HasIRI uri, Set> ancestors) { 19 | super(uri, STRINGFACETS, ancestors); 20 | knownNonNumericFacetValues.putAll(LITERAL.getKnownNonNumericFacetValues()); 21 | knownNumericFacetValues.putAll(LITERAL.getKnownNumericFacetValues()); 22 | knownNonNumericFacetValues.put(whiteSpace, PRESERVE); 23 | } 24 | 25 | @Override 26 | public String parseValue(String s) { 27 | return s; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/TOKENDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.whiteSpace; 5 | 6 | import java.util.Set; 7 | 8 | import org.semanticweb.owlapi.model.HasIRI; 9 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 10 | 11 | class TOKENDatatype extends NORMALIZEDSTRINGDatatype { 12 | 13 | protected TOKENDatatype() { 14 | this(XSDVocabulary.TOKEN, Utils.generateAncestors(NORMALIZEDSTRING)); 15 | } 16 | 17 | protected TOKENDatatype(HasIRI uri, Set> ancestors) { 18 | super(uri, ancestors); 19 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 20 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 21 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/UNSIGNEDBYTEDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | 8 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 9 | 10 | abstract class UNSIGNEDBYTEDatatype> extends UNSIGNEDSHORTDatatype { 11 | 12 | protected UNSIGNEDBYTEDatatype() { 13 | super(XSDVocabulary.UNSIGNED_BYTE, Utils.generateAncestors(UNSIGNEDSHORT)); 14 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 15 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 16 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 17 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 18 | knownNumericFacetValues.put(minInclusive, new BigDecimal((short) 0)); 19 | knownNumericFacetValues.put(maxInclusive, new BigDecimal((short) 255)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/UNSIGNEDINTDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | import java.util.Set; 8 | 9 | import org.semanticweb.owlapi.model.HasIRI; 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | class UNSIGNEDINTDatatype> extends UNSIGNEDLONGDatatype { 13 | 14 | protected UNSIGNEDINTDatatype() { 15 | this(XSDVocabulary.UNSIGNED_INT, Utils.generateAncestors(UNSIGNEDLONG)); 16 | } 17 | 18 | protected UNSIGNEDINTDatatype(HasIRI uri, Set> ancestors) { 19 | super(uri, ancestors); 20 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 21 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 22 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 23 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 24 | knownNumericFacetValues.put(minInclusive, new BigDecimal(0L)); 25 | knownNumericFacetValues.put(maxInclusive, new BigDecimal(4294967295L)); 26 | } 27 | 28 | @Override 29 | @SuppressWarnings("unchecked") 30 | public R parseValue(String s) { 31 | Long parseInt = Long.valueOf(s); 32 | if (parseInt.longValue() < 0) { 33 | throw new ArithmeticException("Unsigned int required, but found: " + s); 34 | } 35 | return (R) parseInt; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/UNSIGNEDLONGDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | import java.math.BigInteger; 8 | import java.util.Set; 9 | 10 | import org.semanticweb.owlapi.model.HasIRI; 11 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 12 | 13 | class UNSIGNEDLONGDatatype> extends NONNEGATIVEINTEGERDatatype { 14 | 15 | protected UNSIGNEDLONGDatatype() { 16 | this(XSDVocabulary.UNSIGNED_LONG, Utils.generateAncestors(NONNEGATIVEINTEGER)); 17 | } 18 | 19 | protected UNSIGNEDLONGDatatype(HasIRI uri, Set> ancestors) { 20 | super(uri, ancestors); 21 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 22 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 23 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 24 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 25 | knownNumericFacetValues.put(minInclusive, BigDecimal.ZERO); 26 | knownNumericFacetValues.put(maxInclusive, new BigDecimal("18446744073709551615")); 27 | } 28 | 29 | @Override 30 | @SuppressWarnings("unchecked") 31 | public R parseValue(String s) { 32 | BigInteger b = new BigInteger(s); 33 | if (b.compareTo(BigInteger.ZERO) < 0) { 34 | throw new ArithmeticException("Unsigned long required, but found: " + s); 35 | } 36 | return (R) b; 37 | } 38 | 39 | @Override 40 | public boolean getBounded() { 41 | return true; 42 | } 43 | 44 | @Override 45 | public cardinality getCardinality() { 46 | return cardinality.FINITE; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/UNSIGNEDSHORTDatatype.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static uk.ac.manchester.cs.jfact.datatypes.DatatypeFactory.*; 4 | import static uk.ac.manchester.cs.jfact.datatypes.Facets.*; 5 | 6 | import java.math.BigDecimal; 7 | import java.util.Set; 8 | 9 | import org.semanticweb.owlapi.model.HasIRI; 10 | import org.semanticweb.owlapi.vocab.XSDVocabulary; 11 | 12 | class UNSIGNEDSHORTDatatype> extends UNSIGNEDINTDatatype { 13 | 14 | protected UNSIGNEDSHORTDatatype() { 15 | this(XSDVocabulary.UNSIGNED_SHORT, Utils.generateAncestors(UNSIGNEDINT)); 16 | } 17 | 18 | protected UNSIGNEDSHORTDatatype(HasIRI uri, Set> ancestors) { 19 | super(uri, ancestors); 20 | knownNonNumericFacetValues.putAll(super.getKnownNonNumericFacetValues()); 21 | knownNumericFacetValues.putAll(super.getKnownNumericFacetValues()); 22 | knownNonNumericFacetValues.put(whiteSpace, WHITESPACE); 23 | knownNonNumericFacetValues.put(pattern, NUMBER_EXPRESSION); 24 | knownNumericFacetValues.put(minInclusive, BigDecimal.ZERO); 25 | knownNumericFacetValues.put(maxInclusive, new BigDecimal(65535)); 26 | } 27 | 28 | @Override 29 | @SuppressWarnings("unchecked") 30 | public R parseValue(String s) { 31 | Integer parseShort = Integer.valueOf(s); 32 | if (parseShort.intValue() < 0) { 33 | throw new ArithmeticException("Unsigned short required, but found: " + s); 34 | } 35 | return (R) parseShort; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/UnsignedByteForShort.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | class UnsignedByteForShort extends UNSIGNEDBYTEDatatype { 4 | 5 | @Override 6 | public Short parseValue(String s) { 7 | short parseByte = Short.parseShort(s); 8 | if (parseByte < 0) { 9 | throw new ArithmeticException("Unsigned short required, but found: " + s); 10 | } 11 | return Short.valueOf(parseByte); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/Utils.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import static org.semanticweb.owlapi.util.OWLAPIStreamUtils.asSet; 4 | 5 | import java.io.Serializable; 6 | import java.util.HashSet; 7 | import java.util.Set; 8 | import java.util.stream.Stream; 9 | 10 | /** @author ignazio */ 11 | public class Utils implements Serializable { 12 | 13 | private Utils() {} 14 | 15 | /** 16 | * @param facets 17 | * facets 18 | * @return set of facets 19 | */ 20 | public static Set getFacets(Facet... facets) { 21 | return asSet(Stream.of(facets)); 22 | } 23 | 24 | /** 25 | * @param facets 26 | * facets 27 | * @return set of facets 28 | */ 29 | public static Set getFacets(Facet[]... facets) { 30 | return asSet(Stream.of(facets).flatMap(Stream::of)); 31 | } 32 | 33 | /** 34 | * @param d 35 | * d 36 | * @return ancestors 37 | */ 38 | public static Set> generateAncestors(Datatype d) { 39 | Set> toReturn = new HashSet<>(d.getAncestors()); 40 | toReturn.add(d); 41 | return toReturn; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/cardinality.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | /** cardinality */ 9 | public enum cardinality { 10 | //@formatter:off 11 | /** FINITE */ FINITE, 12 | /** COUNTABLYINFINITE */ COUNTABLYINFINITE; 13 | //@formatter:on 14 | /** 15 | * @param string 16 | * string 17 | * @return cardinality 18 | */ 19 | public static cardinality parse(String string) { 20 | if ("countably infinite".equals(string)) { 21 | return COUNTABLYINFINITE; 22 | } 23 | // XXX not the best solution but should work 24 | return FINITE; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/ordered.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.datatypes; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | /** ordered */ 11 | public enum ordered { 12 | /** not ordered */ 13 | FALSE("false"), /** partially ordered */ 14 | PARTIAL("partial"), /** totally ordered */ 15 | TOTAL("total"); 16 | 17 | private final String name; 18 | 19 | private ordered(String s) { 20 | name = s; 21 | } 22 | 23 | /** 24 | * @param string 25 | * string 26 | * @return ordered 27 | */ 28 | @Nullable 29 | public static ordered parse(String string) { 30 | for (ordered o : values()) { 31 | if (o.name.equals(string)) { 32 | return o; 33 | } 34 | } 35 | return null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/datatypes/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.datatypes; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/dep/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.dep; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/helpers/Assertions.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.helpers; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /** 6 | * @author ignazio Assertions utility. 7 | */ 8 | public final class Assertions { 9 | private Assertions() { 10 | // no instances 11 | } 12 | 13 | /** 14 | * Check that the argument is not null; if the argument is null, throw an IllegalStateException. 15 | * This method is meant to be used to verify conditions on member variables rather than input 16 | * parameters. 17 | * 18 | * @param object reference to check 19 | * @param reference type 20 | * @return the input reference if not null 21 | * @throws IllegalStateException if object is null 22 | */ 23 | public static T verifyNotNull(@Nullable T object) { 24 | return verifyNotNull(object, "value cannot be null at this stage"); 25 | } 26 | 27 | /** 28 | * Check that the argument is not null; if the argument is null, throw an IllegalStateException. 29 | * This method is meant to be used to verify conditions on member variables rather than input 30 | * parameters. 31 | * 32 | * @param object reference to check 33 | * @param message message to use for the error 34 | * @param reference type 35 | * @return the input reference if not null 36 | * @throws IllegalStateException if object is null 37 | */ 38 | public static T verifyNotNull(@Nullable T object, String message) { 39 | if (object == null) { 40 | throw new IllegalStateException(message); 41 | } 42 | return object; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/helpers/Pair.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.helpers; 2 | 3 | import java.io.Serializable; 4 | 5 | import uk.ac.manchester.cs.jfact.kernel.Individual; 6 | 7 | /* This file is part of the JFact DL reasoner 8 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 9 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 10 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 12 | /** The Class Pair. */ 13 | public class Pair implements Serializable { 14 | 15 | 16 | /** The first. */ 17 | public final Individual first; 18 | /** The second. */ 19 | public final boolean second; 20 | 21 | /** 22 | * Instantiates a new pair. 23 | * 24 | * @param d 25 | * d 26 | * @param c 27 | * c 28 | */ 29 | public Pair(Individual d, boolean c) { 30 | first = d; 31 | second = c; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/helpers/UnreachableSituationException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.helpers; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import org.semanticweb.owlapi.reasoner.ReasonerInternalException; 9 | 10 | /** The Class UnreachableSituationException. */ 11 | public class UnreachableSituationException extends ReasonerInternalException { 12 | 13 | 14 | 15 | /** Instantiates a new unreachable situation exception. */ 16 | public UnreachableSituationException() { 17 | super("Unreachable situation!"); 18 | } 19 | 20 | /** 21 | * Instantiates a new unreachable situation exception. 22 | * 23 | * @param text 24 | * the text 25 | */ 26 | public UnreachableSituationException(String text) { 27 | super("Unreachable situation!\n" + text); 28 | } 29 | 30 | /** 31 | * Instantiates a new unreachable situation exception. 32 | * 33 | * @param text 34 | * the text 35 | * @param cause 36 | * the cause 37 | */ 38 | public UnreachableSituationException(String text, Throwable cause) { 39 | super("Unreachable situation!\n" + text, cause); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/helpers/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.helpers; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/AddConceptResult.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | /** add concept result */ 9 | public enum AddConceptResult { 10 | /** acrClash */ 11 | CLASH, 12 | /** acrExist */ 13 | EXIST, 14 | /** acrDone */ 15 | DONE 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/CacheStatus.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | enum CacheStatus { 9 | EMPTY, SAT, CLASSIFIED 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/DIOp.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | enum DIOp { 9 | // concept expressions 10 | NOT("not"), 11 | AND("and"), 12 | OR("or"), 13 | EXISTS("some"), 14 | FORALL("all"), 15 | GE("atleast"), 16 | LE("atmost"), 17 | // role expressions 18 | INV, 19 | // individual expressions 20 | ONEOF, 21 | // end of the enum 22 | ENDOP, 23 | // concept axioms 24 | DEFINEC("defprimconcept"), 25 | IMPLIESC("implies_c"), 26 | EQUALSC("equal_c"), 27 | DISJOINTC, 28 | // role axioms 29 | DEFINER("defprimrole"), 30 | TRANSITIVER("transitive"), 31 | FUNCTIONALR("functional"), 32 | IMPLIESR("implies_r"), 33 | EQUALSR("equal_r"), 34 | DOMAINR("domain"), 35 | RANGER("range"), 36 | // individual axioms 37 | INSTANCEOF; 38 | 39 | private final String s; 40 | 41 | private DIOp() { 42 | s = ""; 43 | } 44 | 45 | private DIOp(String s) { 46 | this.s = s; 47 | } 48 | 49 | public String getString() { 50 | return s; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/EdgeCompare.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | import static uk.ac.manchester.cs.jfact.helpers.Assertions.verifyNotNull; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | import java.io.Serializable; 11 | import java.util.Comparator; 12 | 13 | import javax.annotation.Nullable; 14 | 15 | import conformance.PortedFrom; 16 | 17 | @PortedFrom(file = "Tactic.cpp", name = "EdgeCompare") 18 | class EdgeCompare implements Comparator, Serializable { 19 | 20 | @Override 21 | @PortedFrom(file = "Tactic.cpp", name = "compare") 22 | public int compare(@Nullable DlCompletionTreeArc o1, @Nullable DlCompletionTreeArc o2) { 23 | return verifyNotNull(o1).getArcEnd().compareTo(verifyNotNull(o2).getArcEnd()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/KBStatus.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | /** KB status */ 9 | public enum KBStatus { 10 | //@formatter:off 11 | /** no axioms loaded yet; not used in TBox */ KBEMPTY, 12 | /** axioms are added to the KB, no preprocessing done */ KBLOADING, 13 | /** KB is preprocessed and consistency checked */ KBCHECKED, 14 | /** KB is classified */ KBCLASSIFIED, 15 | /** KB is realised */ KBREALISED 16 | //@formatter:on 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/KnownSubsumers.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.io.Serializable; 9 | import java.util.List; 10 | 11 | /** abstract class to represent the known subsumers of a concept */ 12 | public interface KnownSubsumers extends Serializable { 13 | 14 | /** @return begin of the Sure subsumers interval */ 15 | List sure(); 16 | 17 | /** @return begin of the Possible subsumers interval */ 18 | List possible(); 19 | 20 | // flags 21 | /** @return whether there are no sure subsumers */ 22 | default boolean sureEmpty() { 23 | return sure().isEmpty(); 24 | } 25 | 26 | /** @return whether there are no possible subsumers */ 27 | default boolean possibleEmpty() { 28 | return possible().isEmpty(); 29 | } 30 | 31 | /** 32 | * @param ce 33 | * class expression 34 | * @return true iff CE is the possible subsumer 35 | */ 36 | default boolean isPossibleSub(@SuppressWarnings("unused") ClassifiableEntry ce) { 37 | return true; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/Redo.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | /** possible flags of re-checking ALL-like expressions in new nodes */ 9 | enum Redo { 10 | REDOFORALL(1), REDOFUNC(2), REDOATMOST(4), REDOIRR(8); 11 | 12 | private final int value; 13 | 14 | Redo(int i) { 15 | value = i; 16 | } 17 | 18 | public boolean match(int flags) { 19 | return (flags & value) > 0; 20 | } 21 | 22 | protected int getValue() { 23 | return value; 24 | } 25 | 26 | public static int redoForallFuncAtmostIrr() { 27 | return REDOFORALL.value | REDOFUNC.value | REDOATMOST.value 28 | | REDOIRR.value; 29 | } 30 | 31 | public static int redoForallAtmost() { 32 | return REDOFORALL.value | REDOATMOST.value; 33 | } 34 | 35 | public static int redoForallFunc() { 36 | return REDOFORALL.value | REDOFUNC.value; 37 | } 38 | 39 | public static int redoForallFuncAtMost() { 40 | return REDOFORALL.value | REDOFUNC.value | REDOATMOST.value; 41 | } 42 | 43 | public static int redoFuncAtMost() { 44 | return REDOFUNC.value | REDOATMOST.value; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/Restorer.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | import java.io.Serializable; 4 | 5 | import conformance.PortedFrom; 6 | 7 | /* This file is part of the JFact DL reasoner 8 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 9 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 10 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 12 | /** restorer */ 13 | @PortedFrom(file = "tRestorer.h", name = "TRestorer") 14 | public abstract class Restorer implements Serializable { 15 | 16 | 17 | @PortedFrom(file = "tRestorer.h", name = "lev") 18 | private int raresavestackLevel; 19 | 20 | /** restore an object based on saved information */ 21 | @PortedFrom(file = "tRestorer.h", name = "restore") 22 | public abstract void restore(); 23 | 24 | /** @return for accessing the level on TRareSaveStack */ 25 | @PortedFrom(file = "tRestorer.h", name = "getLevel") 26 | public int getRaresavestackLevel() { 27 | return raresavestackLevel; 28 | } 29 | 30 | /** 31 | * for accessing the level on TRareSaveStack 32 | * 33 | * @param raresavestackLevel 34 | * raresavestackLevel 35 | */ 36 | @PortedFrom(file = "tRestorer.h", name = "setLevel") 37 | public void setRaresavestackLevel(int raresavestackLevel) { 38 | this.raresavestackLevel = raresavestackLevel; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/RoleCompare.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | import static uk.ac.manchester.cs.jfact.helpers.Assertions.verifyNotNull; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | import java.io.Serializable; 11 | 12 | import javax.annotation.Nullable; 13 | 14 | import conformance.PortedFrom; 15 | 16 | @PortedFrom(file = "tRole.cpp", name = "TRoleCompare") 17 | final class RoleCompare implements Serializable { 18 | private RoleCompare() { 19 | // no instances 20 | } 21 | 22 | @PortedFrom(file = "tRole.cpp", name = "compare") 23 | public static int compare(@Nullable Role p, @Nullable Role q) { 24 | return Integer.compare(verifyNotNull(p).getId(), verifyNotNull(q).getId()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/ToldSubsumers.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.util.ArrayList; 9 | import java.util.Collection; 10 | import java.util.Collections; 11 | import java.util.List; 12 | 13 | import javax.annotation.Nullable; 14 | 15 | /** class to represent the TS's */ 16 | public class ToldSubsumers implements KnownSubsumers { 17 | 18 | /** two iterators for the TS of a concept */ 19 | private final List beg; 20 | 21 | /** 22 | * @param b 23 | * b 24 | */ 25 | public ToldSubsumers(@Nullable Collection b) { 26 | if (b != null) { 27 | beg = new ArrayList<>(b); 28 | } else { 29 | beg = Collections.emptyList(); 30 | } 31 | } 32 | 33 | /** begin of the Sure subsumers interval */ 34 | @Override 35 | public List sure() { 36 | return beg; 37 | } 38 | 39 | /** end of the Sure subsumers interval */ 40 | /** begin of the Possible subsumers interval */ 41 | @Override 42 | public List possible() { 43 | return Collections.emptyList(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/UnMerge.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import org.roaringbitmap.RoaringBitmap; 9 | 10 | import uk.ac.manchester.cs.jfact.dep.DepSet; 11 | import conformance.PortedFrom; 12 | 13 | @PortedFrom(file = "CWDArray.cpp", name = "UnMerge") 14 | class UnMerge extends Restorer { 15 | 16 | 17 | @PortedFrom(file = "CWDArray.cpp", name = "label") 18 | private final CWDArray label; 19 | @PortedFrom(file = "CWDArray.cpp", name = "offset") 20 | private final int offset; 21 | @PortedFrom(file = "CWDArray.cpp", name = "dep") 22 | private final RoaringBitmap dep; 23 | 24 | UnMerge(CWDArray lab, ConceptWDep p, int offset) { 25 | label = lab; 26 | this.offset = offset; 27 | dep = p.getDep().getDelegate(); 28 | } 29 | 30 | @Override 31 | @PortedFrom(file = "CWDArray.h", name = "restore") 32 | public void restore() { 33 | int concept = label.getBase().get(offset).getConcept(); 34 | ConceptWDep conceptWDep = new ConceptWDep(concept, DepSet.create(dep)); 35 | label.getBase().set(offset, conceptWDep); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/actors/Actor.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.actors; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.util.Collection; 9 | 10 | import conformance.PortedFrom; 11 | import uk.ac.manchester.cs.jfact.kernel.TaxonomyVertex; 12 | 13 | /** Actor interface */ 14 | @PortedFrom(file = "Actor.h", name = "Actor") 15 | public interface Actor extends WalkerInterface { 16 | 17 | /** clear collections */ 18 | default void clear() { 19 | // nothing to do as default 20 | } 21 | 22 | /** 23 | * @param v 24 | * vertex to check 25 | * @return true if applicable 26 | */ 27 | boolean applicable(TaxonomyVertex v); 28 | 29 | /** 30 | * @param pastBoundary 31 | * nodes to remove 32 | */ 33 | default void removePastBoundaries(@SuppressWarnings("unused") Collection pastBoundary) {} 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/actors/AddRoleActor.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.actors; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.util.List; 9 | 10 | import uk.ac.manchester.cs.jfact.kernel.Role; 11 | import uk.ac.manchester.cs.jfact.kernel.TaxonomyVertex; 12 | import conformance.PortedFrom; 13 | 14 | /** actor that accumulates primers */ 15 | @PortedFrom(file = "tRole.cpp", name = "AddRoleActor") 16 | public class AddRoleActor extends ActorImpl { 17 | 18 | 19 | @PortedFrom(file = "tRole.cpp", name = "rset") 20 | private final List rset; 21 | 22 | /** 23 | * @param v 24 | * lit to accumulate primers 25 | */ 26 | public AddRoleActor(List v) { 27 | rset = v; 28 | } 29 | 30 | @Override 31 | @PortedFrom(file = "tRole.cpp", name = "apply") 32 | public boolean apply(TaxonomyVertex v) { 33 | if (v.getPrimer().getId() == 0) { 34 | return false; 35 | } 36 | rset.add((Role) v.getPrimer()); 37 | return true; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/actors/DataPropertyPolicy.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.actors; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.io.Serializable; 9 | 10 | import javax.annotation.Nullable; 11 | 12 | import uk.ac.manchester.cs.jfact.kernel.ClassifiableEntry; 13 | import uk.ac.manchester.cs.jfact.kernel.ExpressionCache; 14 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.Expression; 15 | 16 | /** policy for data properties */ 17 | public class DataPropertyPolicy implements Policy, Serializable { 18 | 19 | @Override 20 | public boolean applicable(ClassifiableEntry p) { 21 | return p.getId() > -1; 22 | } 23 | 24 | @Override 25 | public boolean needPlain() { 26 | return false; 27 | } 28 | 29 | @Nullable 30 | @Override 31 | public Expression buildTree(ExpressionCache em, ClassifiableEntry p) { 32 | return em.dataRole(p.getEntity().getEntity()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/actors/IndividualPolicy.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.actors; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.io.Serializable; 9 | 10 | import javax.annotation.Nullable; 11 | 12 | import uk.ac.manchester.cs.jfact.kernel.ClassifiableEntry; 13 | import uk.ac.manchester.cs.jfact.kernel.Concept; 14 | import uk.ac.manchester.cs.jfact.kernel.ExpressionCache; 15 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.Expression; 16 | 17 | /** policy for individuals */ 18 | public class IndividualPolicy implements Policy, Serializable { 19 | 20 | private final boolean plain; 21 | 22 | /** 23 | * @param plain 24 | * plain 25 | */ 26 | public IndividualPolicy(boolean plain) { 27 | this.plain = plain; 28 | } 29 | 30 | @Override 31 | public boolean applicable(ClassifiableEntry p) { 32 | return ((Concept) p).isSingleton(); 33 | } 34 | 35 | @Override 36 | public boolean needPlain() { 37 | return plain; 38 | } 39 | 40 | @Nullable 41 | @Override 42 | public Expression buildTree(ExpressionCache em, ClassifiableEntry p) { 43 | return em.individual(p.getEntity().getEntity()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/actors/ObjectPropertyPolicy.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.actors; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.io.Serializable; 9 | 10 | import javax.annotation.Nullable; 11 | 12 | import uk.ac.manchester.cs.jfact.kernel.ClassifiableEntry; 13 | import uk.ac.manchester.cs.jfact.kernel.ExpressionCache; 14 | import uk.ac.manchester.cs.jfact.kernel.Role; 15 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.Expression; 16 | 17 | /** policy for object properties */ 18 | public class ObjectPropertyPolicy implements Policy, Serializable { 19 | 20 | @Override 21 | public boolean applicable(ClassifiableEntry p) { 22 | return true; 23 | } 24 | 25 | @Override 26 | public boolean needPlain() { 27 | return false; 28 | } 29 | 30 | @Nullable 31 | @Override 32 | public Expression buildTree(ExpressionCache em, ClassifiableEntry p) { 33 | return p.getId() >= 0 ? em.objectRole(p.getEntity().getEntity()) 34 | : em.inverse(em.objectRole(((Role) p).realInverse().getEntity().getEntity())); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/actors/Policy.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.actors; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | /* This file is part of the JFact DL reasoner 8 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 9 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 10 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 12 | import uk.ac.manchester.cs.jfact.kernel.ClassifiableEntry; 13 | import uk.ac.manchester.cs.jfact.kernel.ExpressionCache; 14 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.Expression; 15 | 16 | /** policy */ 17 | public interface Policy extends Serializable { 18 | 19 | /** 20 | * @param p 21 | * p 22 | * @return true if applicable 23 | */ 24 | boolean applicable(ClassifiableEntry p); 25 | 26 | /** @return true if plain is needed */ 27 | boolean needPlain(); 28 | 29 | /** 30 | * @param em 31 | * EM 32 | * @param p 33 | * p 34 | * @return expression for p 35 | */ 36 | @Nullable 37 | Expression buildTree(ExpressionCache em, ClassifiableEntry p); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/actors/SupConceptActor.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.actors; 2 | 3 | import java.io.Serializable; 4 | 5 | import conformance.PortedFrom; 6 | import uk.ac.manchester.cs.jfact.kernel.ClassifiableEntry; 7 | import uk.ac.manchester.cs.jfact.kernel.TaxonomyVertex; 8 | 9 | /** class for exploring concept taxonomy to find super classes */ 10 | @PortedFrom(file = "Kernel.cpp", name = "SupConceptActor") 11 | public class SupConceptActor implements Actor, Serializable { 12 | 13 | @PortedFrom(file = "Kernel.cpp", name = "pe") protected final ClassifiableEntry pe; 14 | 15 | /** 16 | * @param q 17 | * q 18 | */ 19 | public SupConceptActor(ClassifiableEntry q) { 20 | pe = q; 21 | } 22 | 23 | @PortedFrom(file = "Kernel.cpp", name = "entry") 24 | protected boolean entry(ClassifiableEntry q) { 25 | return !pe.equals(q); 26 | } 27 | 28 | @Override 29 | @PortedFrom(file = "Kernel.cpp", name = "apply") 30 | public boolean apply(TaxonomyVertex v) { 31 | if (!entry(v.getPrimer())) { 32 | return false; 33 | } 34 | return v.synonyms().allMatch(this::entry); 35 | } 36 | 37 | @Override 38 | public boolean applicable(TaxonomyVertex v) { 39 | if (entry(v.getPrimer())) { 40 | return true; 41 | } 42 | return v.synonyms().anyMatch(this::entry); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/actors/TaxGatheringWalker.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.actors; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import conformance.PortedFrom; 7 | import uk.ac.manchester.cs.jfact.kernel.ClassifiableEntry; 8 | import uk.ac.manchester.cs.jfact.kernel.TaxonomyVertex; 9 | 10 | /** taxonomy walkers that gathers all the relevant nodes */ 11 | @PortedFrom(file = "TaxGatheringWalker.h", name = "TaxGatheringWalker") 12 | abstract class TaxGatheringWalker implements Actor { 13 | 14 | /** vertices that satisfy the condition */ 15 | protected List found = new ArrayList<>(); 16 | 17 | /** 18 | * check whether actor is applicable to the ENTRY 19 | * 20 | * @param entry entry to test 21 | * @return true if applicable 22 | */ 23 | protected abstract boolean applicable(ClassifiableEntry entry); 24 | 25 | /** 26 | * @param p entry to test 27 | * @return true iff current entry is visible 28 | */ 29 | protected boolean tryEntry(ClassifiableEntry p) { 30 | return !p.isSystem() && applicable(p); 31 | } 32 | 33 | /** 34 | * @param v vertex to check 35 | * @return true if at least one entry of a vertex V is visible 36 | */ 37 | protected boolean tryVertex(TaxonomyVertex v) { 38 | if (tryEntry(v.getPrimer())) { 39 | return true; 40 | } 41 | return v.synonyms().anyMatch(this::tryEntry); 42 | } 43 | 44 | @Override 45 | public void clear() { 46 | found.clear(); 47 | } 48 | 49 | @Override 50 | public boolean apply(TaxonomyVertex v) { 51 | if (tryVertex(v)) { 52 | found.add(v); 53 | return true; 54 | } 55 | return false; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/actors/WalkerInterface.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.actors; 2 | 3 | import conformance.PortedFrom; 4 | import uk.ac.manchester.cs.jfact.kernel.Taxonomy; 5 | import uk.ac.manchester.cs.jfact.kernel.TaxonomyVertex; 6 | 7 | /** 8 | * Base class for taxonomy walkers that provide necessary interface. 9 | */ 10 | @PortedFrom(file = "WalkerInterface.h", name = "WalkerInterface") 11 | public interface WalkerInterface { 12 | 13 | /** 14 | * Taxonomy walking method. 15 | * 16 | * @param v 17 | * taxonomy vertex 18 | * @return true if node was processed, false if node can not be processed in 19 | * current settings 20 | */ 21 | boolean apply(TaxonomyVertex v); 22 | 23 | /** 24 | * Remove indirect nodes in the given taxonomy according to direction. 25 | * 26 | * @param v 27 | * taxonomy 28 | * @param direction 29 | * up or down 30 | */ 31 | @SuppressWarnings("unused") 32 | default void removeIndirect(Taxonomy v, boolean direction) {} 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/actors/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.kernel.actors; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/ConceptName.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.io.Serializable; 9 | 10 | import org.semanticweb.owlapi.model.OWLEntity; 11 | 12 | import conformance.PortedFrom; 13 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.ConceptExpression; 14 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 15 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitorEx; 16 | 17 | /** named concept */ 18 | @PortedFrom(file = "tDLExpression.h", name = "TDLConceptName") 19 | public class ConceptName extends NamedEntityImpl implements ConceptExpression, Serializable { 20 | 21 | /** 22 | * @param name 23 | * name 24 | */ 25 | public ConceptName(OWLEntity name) { 26 | super(name); 27 | } 28 | 29 | @Override 30 | @PortedFrom(file = "tDLExpression.h", name = "accept") 31 | public void accept(DLExpressionVisitor visitor) { 32 | visitor.visit(this); 33 | } 34 | 35 | @Override 36 | @PortedFrom(file = "tDLExpression.h", name = "accept") 37 | public O accept(DLExpressionVisitorEx visitor) { 38 | return visitor.visit(this); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/DataBottom.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.io.Serializable; 9 | 10 | import org.semanticweb.owlapi.model.IRI; 11 | import org.semanticweb.owlapi.vocab.OWLRDFVocabulary; 12 | 13 | import conformance.PortedFrom; 14 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.DataExpression; 15 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 16 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitorEx; 17 | 18 | /** data bottom concept */ 19 | @PortedFrom(file = "tDLExpression.h", name = "TDLDataBottom") 20 | public class DataBottom implements DataExpression, Serializable { 21 | 22 | @Override 23 | @PortedFrom(file = "tDLExpression.h", name = "accept") 24 | public void accept(DLExpressionVisitor visitor) { 25 | visitor.visit(this); 26 | } 27 | 28 | @Override 29 | @PortedFrom(file = "tDLExpression.h", name = "accept") 30 | public O accept(DLExpressionVisitorEx visitor) { 31 | return visitor.visit(this); 32 | } 33 | 34 | @Override 35 | public IRI getIRI() { 36 | return OWLRDFVocabulary.OWL_BOTTOM_DATA_PROPERTY.getIRI(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/IndividualName.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.io.Serializable; 9 | 10 | import org.semanticweb.owlapi.model.OWLEntity; 11 | 12 | import conformance.PortedFrom; 13 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.IndividualExpression; 14 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 15 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitorEx; 16 | 17 | /** individual name */ 18 | @PortedFrom(file = "tDLExpression.h", name = "TDLIndividualName") 19 | public class IndividualName extends NamedEntityImpl implements IndividualExpression, Serializable { 20 | 21 | /** 22 | * @param name 23 | * name 24 | */ 25 | public IndividualName(OWLEntity name) { 26 | super(name); 27 | } 28 | 29 | @Override 30 | @PortedFrom(file = "tDLExpression.h", name = "accept") 31 | public void accept(DLExpressionVisitor visitor) { 32 | visitor.visit(this); 33 | } 34 | 35 | @Override 36 | @PortedFrom(file = "tDLExpression.h", name = "accept") 37 | public O accept(DLExpressionVisitorEx visitor) { 38 | return visitor.visit(this); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/axioms/AxiomIndividual.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.axioms; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import org.semanticweb.owlapi.model.OWLAxiom; 9 | 10 | import conformance.PortedFrom; 11 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.IndividualExpression; 12 | 13 | @PortedFrom(file = "tDLAxiom.h", name = "TDLAxiomIndividual") 14 | abstract class AxiomIndividual extends AxiomImpl { 15 | 16 | @PortedFrom(file = "tDLAxiom.h", name = "I") protected final IndividualExpression individualExpression; 17 | 18 | protected AxiomIndividual(OWLAxiom ax, IndividualExpression i) { 19 | super(ax); 20 | individualExpression = i; 21 | } 22 | 23 | /** @return individual */ 24 | @PortedFrom(file = "tDLAxiom.h", name = "getIndividual") 25 | public IndividualExpression getIndividual() { 26 | return individualExpression; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/axioms/AxiomSingleDRole.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.axioms; 2 | 3 | import java.util.stream.Stream; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | import org.semanticweb.owlapi.model.OWLAxiom; 11 | 12 | import conformance.PortedFrom; 13 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.DataRoleExpression; 14 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.Expression; 15 | 16 | /** data role axiom */ 17 | @PortedFrom(file = "tDLAxiom.h", name = "TDLAxiomSingleDRole") 18 | public abstract class AxiomSingleDRole extends AxiomImpl { 19 | 20 | @PortedFrom(file = "tDLAxiom.h", name = "Role") protected final DataRoleExpression role; 21 | 22 | @PortedFrom(file = "tDLAxiom.h", name = "Role") 23 | protected AxiomSingleDRole(OWLAxiom ax, DataRoleExpression role) { 24 | super(ax); 25 | this.role = role; 26 | } 27 | 28 | /** @return role */ 29 | @PortedFrom(file = "tDLAxiom.h", name = "getRole") 30 | public DataRoleExpression getRole() { 31 | return role; 32 | } 33 | 34 | @Override 35 | public Stream namedEntitySignature() { 36 | return Stream.of(role); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/axioms/AxiomSingleORole.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.axioms; 2 | 3 | import java.util.stream.Stream; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | import org.semanticweb.owlapi.model.OWLAxiom; 11 | 12 | import conformance.PortedFrom; 13 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.Expression; 14 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.ObjectRoleExpression; 15 | 16 | /** object role axiom */ 17 | @PortedFrom(file = "tDLAxiom.h", name = "TDLAxiomSingleORole") 18 | public abstract class AxiomSingleORole extends AxiomImpl { 19 | 20 | @PortedFrom(file = "tDLAxiom.h", name = "Role") protected final ObjectRoleExpression role; 21 | 22 | @PortedFrom(file = "tDLAxiom.h", name = "Role") 23 | protected AxiomSingleORole(OWLAxiom ax, ObjectRoleExpression role) { 24 | super(ax); 25 | this.role = role; 26 | } 27 | 28 | /** @return role */ 29 | @PortedFrom(file = "tDLAxiom.h", name = "getRole") 30 | public ObjectRoleExpression getRole() { 31 | return role; 32 | } 33 | 34 | @Override 35 | public Stream namedEntitySignature() { 36 | return Stream.of(role); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/axioms/Axioms.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.axioms; 2 | 3 | import javax.annotation.Nonnull; 4 | 5 | import org.semanticweb.owlapitools.decomposition.AxiomWrapper; 6 | 7 | import uk.ac.manchester.cs.jfact.kernel.dl.interfaces.Expression; 8 | 9 | /** 10 | * Axiom utilities. 11 | */ 12 | public class Axioms { 13 | 14 | @Nonnull private static final Expression DUMMY_EXPRESSION = new Expression() {}; 15 | @Nonnull private static final AxiomWrapper DUMMY = new AxiomWrapper(null); 16 | 17 | private Axioms() {} 18 | 19 | /** @return a dummy implementation of Expression */ 20 | public static Expression dummyExpression() { 21 | return DUMMY_EXPRESSION; 22 | } 23 | 24 | /** @return a dummy implementation of AxiomInterface */ 25 | public static AxiomWrapper dummy() { 26 | return DUMMY; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/axioms/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.kernel.dl.axioms; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ConceptArg.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import conformance.PortedFrom; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | /** concept expression */ 11 | @FunctionalInterface 12 | @PortedFrom(file = "tDLExpression.h", name = "TConceptArg") 13 | public interface ConceptArg { 14 | 15 | /** @return access to the argument */ 16 | @PortedFrom(file = "tDLExpression.h", name = "getC") 17 | ConceptExpression getConcept(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ConceptDataCardinalityExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 4 | import conformance.PortedFrom; 5 | 6 | /* This file is part of the JFact DL reasoner 7 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 8 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 10 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 11 | /** general data role cardinality expression */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLConceptDataCardinalityExpression") 13 | public interface ConceptDataCardinalityExpression extends 14 | ConceptDataRVExpression, NumberArg { 15 | 16 | @Override 17 | /** accept method for the visitor pattern */ 18 | @PortedFrom(file = "tDLExpression.h", name = "accept") 19 | void accept(DLExpressionVisitor visitor); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ConceptDataRVExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 4 | import conformance.PortedFrom; 5 | 6 | /* This file is part of the JFact DL reasoner 7 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 8 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 10 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 11 | /** data restriction */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLConceptDataRVExpression") 13 | public interface ConceptDataRVExpression extends ConceptDataRoleExpression, 14 | DataExpressionArg { 15 | 16 | @Override 17 | /** accept method for the visitor pattern */ 18 | @PortedFrom(file = "tDLExpression.h", name = "accept") 19 | void accept(DLExpressionVisitor visitor); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ConceptDataRoleExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 4 | import conformance.PortedFrom; 5 | 6 | /* This file is part of the JFact DL reasoner 7 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 8 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 10 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 11 | /** data role expression */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLConceptDataRoleExpression") 13 | public interface ConceptDataRoleExpression extends ConceptExpression, 14 | DataRoleArg { 15 | 16 | @Override 17 | /** accept method for the visitor pattern */ 18 | @PortedFrom(file = "tDLExpression.h", name = "accept") 19 | void accept(DLExpressionVisitor visitor); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ConceptExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 4 | import conformance.PortedFrom; 5 | 6 | /* This file is part of the JFact DL reasoner 7 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 8 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 10 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 11 | /** concept expression */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLConceptExpression") 13 | public interface ConceptExpression extends Expression { 14 | 15 | @Override 16 | /** accept method for the visitor pattern */ 17 | @PortedFrom(file = "tDLExpression.h", name = "accept") 18 | void accept(DLExpressionVisitor visitor); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ConceptObjectCardinalityExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 4 | import conformance.PortedFrom; 5 | 6 | /* This file is part of the JFact DL reasoner 7 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 8 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 10 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 11 | /** object cardinality expression */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLConceptObjectCardinalityExpression") 13 | public interface ConceptObjectCardinalityExpression extends 14 | ConceptObjectRCExpression, NumberArg { 15 | 16 | @Override 17 | /** accept method for the visitor pattern */ 18 | @PortedFrom(file = "tDLExpression.h", name = "accept") 19 | void accept(DLExpressionVisitor visitor); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ConceptObjectRCExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 4 | import conformance.PortedFrom; 5 | 6 | /* This file is part of the JFact DL reasoner 7 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 8 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 10 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 11 | /** object restriction expression */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLConceptObjectRCExpression") 13 | public interface ConceptObjectRCExpression extends ConceptObjectRoleExpression, 14 | ConceptArg { 15 | 16 | @Override 17 | /** accept method for the visitor pattern */ 18 | @PortedFrom(file = "tDLExpression.h", name = "accept") 19 | void accept(DLExpressionVisitor visitor); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ConceptObjectRoleExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 4 | import conformance.PortedFrom; 5 | 6 | /* This file is part of the JFact DL reasoner 7 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 8 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 10 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 11 | /** general concept expression that contains an object role */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLConceptObjectRoleExpression") 13 | public interface ConceptObjectRoleExpression extends ConceptExpression, 14 | ObjectRoleArg { 15 | 16 | @Override 17 | /** accept method for the visitor pattern */ 18 | @PortedFrom(file = "tDLExpression.h", name = "accept") 19 | void accept(DLExpressionVisitor visitor); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/DataExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import conformance.PortedFrom; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | /** data expression */ 11 | @PortedFrom(file = "tDLExpression.h", name = "TDLDataExpression") 12 | public interface DataExpression extends Expression {} 13 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/DataExpressionArg.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import conformance.PortedFrom; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | /** 11 | * data expression 12 | * 13 | * @param 14 | * type 15 | */ 16 | @FunctionalInterface 17 | @PortedFrom(file = "tDLExpression.h", name = "TDataExpressionArg") 18 | public interface DataExpressionArg { 19 | 20 | /** @return argument */ 21 | @PortedFrom(file = "tDLExpression.h", name = "getExpr") 22 | T getExpr(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/DataRoleArg.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import conformance.PortedFrom; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | /** data role */ 11 | @FunctionalInterface 12 | @PortedFrom(file = "tDLExpression.h", name = "TDataRoleArg") 13 | public interface DataRoleArg { 14 | 15 | /** @return argument */ 16 | @PortedFrom(file = "tDLExpression.h", name = "getDR") 17 | DataRoleExpression getDataRoleExpression(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/DataRoleExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 4 | import conformance.PortedFrom; 5 | 6 | /* This file is part of the JFact DL reasoner 7 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 8 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 10 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 11 | /** data role expression */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLDataRoleExpression") 13 | public interface DataRoleExpression extends RoleExpression { 14 | 15 | @Override 16 | /** accept method for the visitor pattern */ 17 | @PortedFrom(file = "tDLExpression.h", name = "accept") 18 | void accept(DLExpressionVisitor visitor); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/Entity.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import java.io.Serializable; 4 | 5 | import org.semanticweb.owlapi.model.HasIRI; 6 | 7 | import conformance.PortedFrom; 8 | 9 | /* This file is part of the JFact DL reasoner 10 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 11 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 12 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 13 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 14 | /** entity */ 15 | @PortedFrom(file = "KnowledgeExplorer.h", name = "Entity") 16 | public interface Entity extends HasIRI, Serializable {} 17 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/Expression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import org.semanticweb.owlapi.model.IRI; 4 | 5 | import conformance.PortedFrom; 6 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 7 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitorEx; 8 | 9 | /** expression */ 10 | @SuppressWarnings("unused") 11 | @PortedFrom(file = "tNAryQueue.h", name = "Expression") 12 | public interface Expression extends Entity { 13 | 14 | @Override 15 | default IRI getIRI() { 16 | throw new UnsupportedOperationException(); 17 | } 18 | 19 | /** 20 | * accept method for the visitor pattern 21 | * 22 | * @param visitor 23 | * visitor 24 | */ 25 | @PortedFrom(file = "tDLExpression.h", name = "accept") 26 | default void accept(DLExpressionVisitor visitor) {} 27 | 28 | /** 29 | * @param visitor 30 | * visitor 31 | * @param 32 | * visitor type 33 | * @return visitor value 34 | */ 35 | @PortedFrom(file = "tDLExpression.h", name = "accept") 36 | default O accept(DLExpressionVisitorEx visitor) { 37 | return null; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/IndividualExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 4 | import conformance.PortedFrom; 5 | 6 | /* This file is part of the JFact DL reasoner 7 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 8 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 10 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 11 | /** individual expression */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLIndividualExpression") 13 | public interface IndividualExpression extends Expression { 14 | 15 | @Override 16 | /** accept method for the visitor pattern */ 17 | @PortedFrom(file = "tDLExpression.h", name = "accept") 18 | void accept(DLExpressionVisitor visitor); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/NamedEntity.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | import org.semanticweb.owlapi.model.HasIRI; 8 | import org.semanticweb.owlapi.model.OWLEntity; 9 | 10 | import conformance.PortedFrom; 11 | import uk.ac.manchester.cs.jfact.kernel.NamedEntry; 12 | 13 | /* This file is part of the JFact DL reasoner 14 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 15 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 16 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 17 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 18 | /** named entity */ 19 | @PortedFrom(file = "tDLExpression.h", name = "TNamedEntity") 20 | public interface NamedEntity extends HasIRI, Serializable { 21 | 22 | /** @return named entry */ 23 | @Nullable 24 | @PortedFrom(file = "tDLExpression.h", name = "getEntry") 25 | NamedEntry getEntry(); 26 | 27 | /** 28 | * @param e 29 | * e 30 | */ 31 | @PortedFrom(file = "tDLExpression.h", name = "setEntry") 32 | void setEntry(@Nullable NamedEntry e); 33 | 34 | /** @return entity */ 35 | OWLEntity getEntity(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/NumberArg.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import conformance.PortedFrom; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | /** number arg */ 11 | @FunctionalInterface 12 | @PortedFrom(file = "tDLExpression.h", name = "TNumberArg") 13 | public interface NumberArg { 14 | 15 | /** @return cardinality */ 16 | @PortedFrom(file = "tDLExpression.h", name = "getNumber") 17 | int getCardinality(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ObjectRoleArg.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import conformance.PortedFrom; 4 | 5 | /* This file is part of the JFact DL reasoner 6 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 7 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 9 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 10 | /** object role arg */ 11 | @FunctionalInterface 12 | @PortedFrom(file = "tDLExpression.h", name = "TObjectRoleArg") 13 | public interface ObjectRoleArg { 14 | 15 | /** @return object role */ 16 | @PortedFrom(file = "tDLExpression.h", name = "getOR") 17 | ObjectRoleExpression getOR(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ObjectRoleComplexExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 4 | import conformance.PortedFrom; 5 | 6 | /* This file is part of the JFact DL reasoner 7 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 8 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 10 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 11 | /** object role complex expression */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLObjectRoleComplexExpression") 13 | public interface ObjectRoleComplexExpression extends RoleExpression { 14 | 15 | @Override 16 | /** accept method for the visitor pattern */ 17 | @PortedFrom(file = "tDLExpression.h", name = "accept") 18 | void accept(DLExpressionVisitor visitor); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/ObjectRoleExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 9 | import conformance.PortedFrom; 10 | 11 | /** object role expression */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLObjectRoleExpression") 13 | public interface ObjectRoleExpression extends ObjectRoleComplexExpression { 14 | 15 | @Override 16 | /** accept method for the visitor pattern */ 17 | @PortedFrom(file = "tDLExpression.h", name = "accept") 18 | void accept(DLExpressionVisitor visitor); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/RoleExpression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import uk.ac.manchester.cs.jfact.visitors.DLExpressionVisitor; 9 | import conformance.PortedFrom; 10 | 11 | /** role expression */ 12 | @PortedFrom(file = "tDLExpression.h", name = "TDLRoleExpression") 13 | public interface RoleExpression extends Expression { 14 | 15 | @Override 16 | /** accept method for the visitor pattern */ 17 | @PortedFrom(file = "tDLExpression.h", name = "accept") 18 | void accept(DLExpressionVisitor visitor); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/interfaces/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.kernel.dl.interfaces; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/dl/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.kernel.dl; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/modelcaches/ModelCacheState.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.modelcaches; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | /** status of model cache or merge operation */ 9 | public enum ModelCacheState { 10 | //@formatter:off 11 | /** clash in model/merging fails because of direct contradiction; */ INVALID, 12 | /** valid model/success in merging; */ VALID, 13 | /** incorrect model/merging fails because of incompleteness of procedure; */FAILED, 14 | /** untested model cache. */ UNKNOWN; 15 | //@formatter:on 16 | 17 | /** @return is this invalid? */ 18 | public boolean usageByState() { 19 | return this == INVALID; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/modelcaches/ModelCacheType.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.modelcaches; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | /** model cache type */ 9 | public enum ModelCacheType { 10 | //@formatter:off 11 | /** not implemented */ BADTYPE, 12 | /** TOP/BOTTOM */ CONST, 13 | /** contains just one named concept */ SINGLETON, 14 | /** root-level concepts, ER and AR concepts are cached */ IAN 15 | //@formatter:on 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/modelcaches/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.kernel.modelcaches; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/options/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.kernel.options; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.kernel; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/state/SaveList.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.state; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.util.LinkedList; 9 | 10 | import conformance.PortedFrom; 11 | 12 | /** save list */ 13 | @PortedFrom(file = "tSaveList.h", name = "TSaveList") 14 | public class SaveList extends LinkedList { 15 | 16 | 17 | 18 | @Override 19 | @PortedFrom(file = "tSaveList.h", name = "pop") 20 | public DLCompletionTreeSaveState pop() { 21 | if (!isEmpty()) { 22 | return super.pop(); 23 | } 24 | return null; 25 | } 26 | 27 | /** 28 | * @param level 29 | * level 30 | * @return element from stack with given level 31 | */ 32 | @PortedFrom(file = "tSaveList.h", name = "pop") 33 | public DLCompletionTreeSaveState pop(int level) { 34 | DLCompletionTreeSaveState p = isEmpty() ? null : peek(); 35 | while (p != null && p.level() > level) { 36 | this.pop(); 37 | p = peek(); 38 | } 39 | // here p==head and either both == NULL or points to proper element 40 | if (p != null) { 41 | this.pop(); 42 | } 43 | return p; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/state/SaveState.java: -------------------------------------------------------------------------------- 1 | package uk.ac.manchester.cs.jfact.kernel.state; 2 | 3 | import java.io.Serializable; 4 | 5 | import conformance.PortedFrom; 6 | 7 | /* This file is part of the JFact DL reasoner 8 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 9 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 10 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 12 | /** class for save/restore */ 13 | @PortedFrom(file = "CGLabel.h", name = "SaveState") 14 | public class SaveState implements Serializable { 15 | 16 | 17 | /** states for simple-, complex- and extra labels */ 18 | private int sc; 19 | private int cc; 20 | 21 | /** Default constructor. */ 22 | public SaveState() { 23 | sc = Integer.MAX_VALUE; 24 | cc = Integer.MAX_VALUE; 25 | } 26 | 27 | /** @return sc */ 28 | public int getSc() { 29 | return sc; 30 | } 31 | 32 | /** @return cc */ 33 | public int getCc() { 34 | return cc; 35 | } 36 | 37 | /** 38 | * @param sc 39 | * sc 40 | */ 41 | public void setSc(int sc) { 42 | this.sc = sc; 43 | } 44 | 45 | /** 46 | * @param cc 47 | * cc 48 | */ 49 | public void setCc(int cc) { 50 | this.cc = cc; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/state/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.kernel.state; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/kernel/todolist/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.kernel.todolist; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact; 3 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/manchester/cs/jfact/visitors/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package uk.ac.manchester.cs.jfact.visitors; 3 | -------------------------------------------------------------------------------- /src/main/resources/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /src/test/java/EnsureMavenAndReasonerVersionInSyncTest.java: -------------------------------------------------------------------------------- 1 | import static org.junit.jupiter.api.Assertions.assertEquals; 2 | 3 | import java.io.File; 4 | 5 | import javax.xml.parsers.DocumentBuilderFactory; 6 | 7 | import org.junit.jupiter.api.Test; 8 | import org.semanticweb.owlapi.reasoner.OWLReasoner; 9 | import org.semanticweb.owlapi.util.Version; 10 | import org.w3c.dom.Document; 11 | import org.w3c.dom.Element; 12 | 13 | import testbase.TestBase; 14 | 15 | class EnsureMavenAndReasonerVersionInSyncTest extends TestBase { 16 | @Test 17 | void shouldBeInSync() throws Exception { 18 | 19 | OWLReasoner r = factory().createReasoner(m.createOntology()); 20 | Document d = 21 | DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File("pom.xml")); 22 | String mavenVersion = ((Element) ((Element) d.getElementsByTagName("project").item(0)) 23 | .getElementsByTagName("version").item(1)).getTextContent(); 24 | Version rVersion = r.getReasonerVersion(); 25 | String reasonerVersion = 26 | rVersion.getMajor() + "." + rVersion.getMinor() + "." + rVersion.getPatch(); 27 | assertEquals(mavenVersion, reasonerVersion); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/bugs/StringsTestCase.java: -------------------------------------------------------------------------------- 1 | package bugs; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertTrue; 4 | 5 | import org.junit.jupiter.api.Test; 6 | import org.semanticweb.owlapi.model.IRI; 7 | import org.semanticweb.owlapi.model.OWLDataProperty; 8 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 9 | import org.semanticweb.owlapi.model.OWLOntology; 10 | import org.semanticweb.owlapi.model.OWLOntologyCreationException; 11 | import org.semanticweb.owlapi.reasoner.OWLReasoner; 12 | import org.semanticweb.owlapi.vocab.OWL2Datatype; 13 | 14 | import testbase.TestBase; 15 | import uk.ac.manchester.cs.jfact.JFactFactory; 16 | 17 | class StringsTestCase extends TestBase { 18 | 19 | @Test 20 | void shouldFindAllLiteralsEquivalent() throws OWLOntologyCreationException { 21 | OWLOntology o = m.createOntology(); 22 | OWLDataProperty p = df.getOWLDataProperty(IRI.create("urn:test:p")); 23 | o.add(df.getOWLFunctionalDataPropertyAxiom(p)); 24 | OWLNamedIndividual i = df.getOWLNamedIndividual(IRI.create("urn:test:i")); 25 | o.add(df.getOWLDataPropertyAssertionAxiom(p, i, df.getOWLLiteral("test"))); 26 | o.add(df.getOWLDataPropertyAssertionAxiom(p, i, df.getOWLLiteral("test", ""))); 27 | o.add(df.getOWLDataPropertyAssertionAxiom(p, i, 28 | df.getOWLLiteral("test", OWL2Datatype.RDF_PLAIN_LITERAL))); 29 | o.add(df.getOWLDataPropertyAssertionAxiom(p, i, 30 | df.getOWLLiteral("test", OWL2Datatype.XSD_STRING))); 31 | OWLReasoner r = new JFactFactory().createReasoner(o); 32 | assertTrue(r.isConsistent()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/bugs/VerifyComplianceHostTestCase.java: -------------------------------------------------------------------------------- 1 | package bugs; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.semanticweb.owlapi.model.OWLClass; 5 | 6 | class VerifyComplianceHostTestCase extends VerifyComplianceBase { 7 | 8 | @Override 9 | protected String input() { 10 | return "/host.owl"; 11 | } 12 | 13 | @Test 14 | void shouldPassgetSubClassesDbXreftrue() { 15 | OWLClass Nothing = C("http://www.w3.org/2002/07/owl#Nothing"); 16 | OWLClass DbXref = C("http://www.geneontology.org/formats/oboInOwl#DbXref"); 17 | // expected Nothing 18 | // actual__ DbXref, true 19 | equal(reasoner.getSubClasses(DbXref, true), Nothing); 20 | } 21 | 22 | @Test 23 | void shouldPassgetSubClassesSynonymtrue() { 24 | OWLClass Nothing = C("http://www.w3.org/2002/07/owl#Nothing"); 25 | OWLClass Synonym = C("http://www.geneontology.org/formats/oboInOwl#Synonym"); 26 | // expected Nothing 27 | // actual__ Synonym, true 28 | equal(reasoner.getSubClasses(Synonym, true), Nothing); 29 | } 30 | 31 | @Test 32 | void shouldPassgetSubClassesDefinitiontrue() { 33 | OWLClass Nothing = C("http://www.w3.org/2002/07/owl#Nothing"); 34 | OWLClass Definition = C("http://www.geneontology.org/formats/oboInOwl#Definition"); 35 | // expected Nothing 36 | // actual__ Definition, true 37 | equal(reasoner.getSubClasses(Definition, true), Nothing); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/bugs/VerifyComplianceMiniTambisTestcase.java: -------------------------------------------------------------------------------- 1 | package bugs; 2 | 3 | class VerifyComplianceMiniTambisTestcase extends VerifyComplianceBase { 4 | 5 | @Override 6 | protected String input() { 7 | return "/AF_miniTambis.owl.xml"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/java/bugs/debug/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package bugs.debug; 3 | -------------------------------------------------------------------------------- /src/test/java/bugs/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package bugs; 3 | -------------------------------------------------------------------------------- /src/test/java/conformancetests/ChangedTestCase.java: -------------------------------------------------------------------------------- 1 | package conformancetests; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | import java.lang.annotation.Documented; 9 | import java.lang.annotation.Retention; 10 | import java.lang.annotation.RetentionPolicy; 11 | 12 | /** 13 | * Denotes a change in tests. 14 | * 15 | * @author ignazio 16 | */ 17 | @Retention(RetentionPolicy.CLASS) 18 | @Documented 19 | public @interface ChangedTestCase { 20 | 21 | /** @return reason for the change to have happened */ 22 | String reason() default "Not OWL 2 Compliant"; 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/conformancetests/HasSelfSupportTestCase.java: -------------------------------------------------------------------------------- 1 | package conformancetests; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertTrue; 4 | 5 | import org.junit.jupiter.api.Test; 6 | import org.semanticweb.owlapi.io.StringDocumentSource; 7 | import org.semanticweb.owlapi.model.OWLOntology; 8 | import org.semanticweb.owlapi.model.OWLOntologyCreationException; 9 | import org.semanticweb.owlapi.reasoner.InferenceType; 10 | import org.semanticweb.owlapi.reasoner.OWLReasoner; 11 | 12 | import testbase.TestBase; 13 | 14 | class HasSelfSupportTestCase extends TestBase { 15 | 16 | @Test 17 | void shouldBeConsistent() throws OWLOntologyCreationException { 18 | String input = "Prefix(owl:=)\n" 19 | + "Prefix(rdf:=)\n" 20 | + "Prefix(xml:=)\n" 21 | + "Prefix(xsd:=)\n" 22 | + "Prefix(rdfs:=)\n" + "\n" + "\n" 23 | + "Ontology(\n" 24 | + "SubClassOf( ObjectHasSelf())\n" 25 | + ")"; 26 | OWLOntology o = m.loadOntologyFromOntologyDocument(new StringDocumentSource(input)); 27 | OWLReasoner r = factory().createReasoner(o); 28 | r.precomputeInferences(InferenceType.CLASS_HIERARCHY); 29 | assertTrue(r.isConsistent()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/conformancetests/StrangeTestCase.java: -------------------------------------------------------------------------------- 1 | package conformancetests; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.Test; 6 | import org.semanticweb.owlapi.model.IRI; 7 | import org.semanticweb.owlapi.model.OWLClass; 8 | import org.semanticweb.owlapi.model.OWLOntology; 9 | import org.semanticweb.owlapi.model.OWLOntologyCreationException; 10 | import org.semanticweb.owlapi.reasoner.InferenceType; 11 | import org.semanticweb.owlapi.reasoner.NodeSet; 12 | import org.semanticweb.owlapi.reasoner.OWLReasoner; 13 | 14 | import testbase.TestBase; 15 | 16 | class StrangeTestCase extends TestBase { 17 | 18 | @Test 19 | void shouldFindThreeSubclasses() throws OWLOntologyCreationException { 20 | OWLOntology o = m.createOntology(); 21 | o.add(df.getOWLSubClassOfAxiom(df.getOWLClass(IRI.create("urn:b")), 22 | df.getOWLClass(IRI.create("urn:c")))); 23 | o.add(df.getOWLSubClassOfAxiom(df.getOWLClass(IRI.create("urn:a")), 24 | df.getOWLClass(IRI.create("urn:b")))); 25 | OWLReasoner r = factory().createReasoner(o); 26 | r.precomputeInferences(InferenceType.CLASS_HIERARCHY); 27 | NodeSet subClasses = r.getSubClasses(df.getOWLClass(IRI.create("urn:c")), false); 28 | assertEquals(3, subClasses.entities().count()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/conformancetests/TestClasses.java: -------------------------------------------------------------------------------- 1 | package conformancetests; 2 | 3 | /* This file is part of the JFact DL reasoner 4 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 5 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 6 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 7 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 8 | @SuppressWarnings("javadoc") 9 | public enum TestClasses { 10 | POSITIVE_IMPL, NEGATIVE_IMPL, INCONSISTENCY, CONSISTENCY; 11 | } 12 | -------------------------------------------------------------------------------- /src/test/java/conformancetests/WebOnt_miscellaneous_002TestCase.java: -------------------------------------------------------------------------------- 1 | /* This file is part of the JFact DL reasoner 2 | Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester 3 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 4 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 5 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/ 6 | package conformancetests; 7 | 8 | import org.junit.jupiter.api.Test; 9 | 10 | import testbase.TestBase; 11 | 12 | class WebOnt_miscellaneous_002TestCase extends TestBase { 13 | 14 | @Test 15 | @ChangedTestCase 16 | void testWebOnt_miscellaneous_002() { 17 | premise = asString("/webont002.owl"); 18 | test("WebOnt_miscellaneous_002", TestClasses.CONSISTENCY, 19 | "Food example taken from the guide. Note that this is the same as the ontology http://www.w3.org/2002/03owlt/miscellaneous/consistent002 imported in other tests."); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/conformancetests/WebOnt_miscellaneous_wineTestCase.java: -------------------------------------------------------------------------------- 1 | package conformancetests; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.util.concurrent.TimeUnit; 6 | 7 | import org.junit.jupiter.api.Disabled; 8 | import org.junit.jupiter.api.Test; 9 | import org.junit.jupiter.api.Timeout; 10 | import org.semanticweb.owlapi.model.OWLOntology; 11 | import org.semanticweb.owlapi.model.OWLOntologyCreationException; 12 | import org.semanticweb.owlapi.model.OWLRuntimeException; 13 | 14 | import testbase.TestBase; 15 | 16 | @Timeout(value = 15, unit = TimeUnit.SECONDS) 17 | @Disabled("performance changes randomly, investigate interactin with other tests") 18 | class WebOnt_miscellaneous_wineTestCase extends TestBase { 19 | 20 | protected OWLOntology load() { 21 | try (InputStream in = 22 | WebOnt_miscellaneous_wineTestCase.class.getResourceAsStream("/wine.fss")) { 23 | return m.loadOntologyFromOntologyDocument(in); 24 | } catch (OWLOntologyCreationException | IOException e) { 25 | throw new OWLRuntimeException(e); 26 | } 27 | } 28 | 29 | @ChangedTestCase 30 | @Test 31 | void testWebOnt_miscellaneous_001() { 32 | JUnitRunner r = new JUnitRunner(m, load(), conclusion, "WebOnt_miscellaneous_001", 33 | TestClasses.CONSISTENCY, 34 | "Wine example taken from the guide. Note that this is the same as the ontology http://www.w3.org/2002/03owlt/miscellaneous/consistent002 imported in other tests."); 35 | r.setReasonerFactory(factory()); 36 | r.run(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/conformancetests/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package conformancetests; 3 | -------------------------------------------------------------------------------- /src/test/java/datatypetests/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package datatypetests; 3 | -------------------------------------------------------------------------------- /src/test/java/testbase/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | package testbase; 3 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_I4_5_001.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_I4_5_002.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_I5_2_003.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 10 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_I5_2_004.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 10 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_InverseFunctionalProperty_001.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_001.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_002.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_014.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 1 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_033.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_101.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_103.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_104.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_105.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 21 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_106.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_646.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 1 8 | 9 | 10 | 11 | 12 | 13 | 1 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 0 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_description_logic_901.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 23 8 | 5 10 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_disjointWith_003.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_disjointWith_004.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_disjointWith_005.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_disjointWith_006.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_disjointWith_007.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/WebOnt_maxCardinality_001.owl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 2 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/rdfbased_sem_restrict_allvalues_cmp_class.owl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/rdfbased_sem_restrict_allvalues_cmp_prop.owl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/rdfbased_sem_restrict_hasvalue_cmp_prop.owl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/rdfbased_sem_restrict_maxqcr_inst_obj_one.owl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/rdfbased_sem_restrict_somevalues_cmp_class.owl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/rdfbased_sem_restrict_somevalues_cmp_prop.owl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | org.slf4j.simpleLogger.defaultLogLevel=error 2 | org.slf4j.simpleLogger.showDateTime=TRUE 3 | org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z --------------------------------------------------------------------------------