├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── docs ├── allclasses-frame.html ├── allclasses-noframe.html ├── constant-values.html ├── deprecated-list.html ├── help-doc.html ├── index-files │ ├── index-1.html │ ├── index-10.html │ ├── index-11.html │ ├── index-12.html │ ├── index-13.html │ ├── index-14.html │ ├── index-15.html │ ├── index-16.html │ ├── index-17.html │ ├── index-18.html │ ├── index-19.html │ ├── index-2.html │ ├── index-3.html │ ├── index-4.html │ ├── index-5.html │ ├── index-6.html │ ├── index-7.html │ ├── index-8.html │ └── index-9.html ├── index.html ├── it │ └── emarolab │ │ └── owloop │ │ ├── articleExamples │ │ ├── drugOrderExample │ │ │ ├── drugOrder.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── example1 │ │ │ ├── addAxioms.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── example2 │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── useDescriptorBuildMethod.html │ │ ├── example3 │ │ │ ├── RemoveAxioms.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ └── exampleDescriptors │ │ │ ├── CorridorClassDesc.html │ │ │ ├── DefClassDesc.html │ │ │ ├── DefSubClassDesc.html │ │ │ ├── LocationClassDesc.html │ │ │ ├── ObjectLinkIndividualDesc.html │ │ │ ├── RoomClassDesc.html │ │ │ ├── TypeIndividualDesc.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── core │ │ ├── Axiom.Descriptor.OntologyReference.html │ │ ├── Axiom.Descriptor.html │ │ ├── Axiom.EntitySet.SynchronisationIntent.html │ │ ├── Axiom.EntitySet.html │ │ ├── Axiom.ExpressionEntity.html │ │ ├── Axiom.ExpressionEntitySet.SynchronisationMultiIntent.html │ │ ├── Axiom.ExpressionEntitySet.SynchroniseContainedIntent.html │ │ ├── Axiom.ExpressionEntitySet.html │ │ ├── Axiom.Ground.html │ │ ├── Axiom.MappingIntent.html │ │ ├── Axiom.html │ │ ├── Class.Disjoint.html │ │ ├── Class.Equivalent.html │ │ ├── Class.Instance.html │ │ ├── Class.Restriction.html │ │ ├── Class.Sub.html │ │ ├── Class.Super.html │ │ ├── Class.html │ │ ├── DataProperty.Disjoint.html │ │ ├── DataProperty.Domain.html │ │ ├── DataProperty.Equivalent.html │ │ ├── DataProperty.Range.html │ │ ├── DataProperty.Sub.html │ │ ├── DataProperty.Super.html │ │ ├── DataProperty.html │ │ ├── Individual.DataLink.html │ │ ├── Individual.Disjoint.html │ │ ├── Individual.Equivalent.html │ │ ├── Individual.ObjectLink.html │ │ ├── Individual.Type.html │ │ ├── Individual.html │ │ ├── ObjectProperty.Disjoint.html │ │ ├── ObjectProperty.Domain.html │ │ ├── ObjectProperty.Equivalent.html │ │ ├── ObjectProperty.Inverse.html │ │ ├── ObjectProperty.Range.html │ │ ├── ObjectProperty.Sub.html │ │ ├── ObjectProperty.Super.html │ │ ├── ObjectProperty.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── descriptor │ │ ├── construction │ │ │ ├── descriptorEntitySet │ │ │ │ ├── Classes.html │ │ │ │ ├── DataLinkSet.html │ │ │ │ ├── DataLinks.html │ │ │ │ ├── DataProperties.html │ │ │ │ ├── DescriptorEntitySet.EntitySetBase.html │ │ │ │ ├── DescriptorEntitySet.ExpressionEntitySetBase.html │ │ │ │ ├── DescriptorEntitySet.OWLEntitySetBase.html │ │ │ │ ├── DescriptorEntitySet.html │ │ │ │ ├── Individuals.html │ │ │ │ ├── Literals.html │ │ │ │ ├── ObjectLinkSet.html │ │ │ │ ├── ObjectLinks.html │ │ │ │ ├── ObjectProperties.html │ │ │ │ ├── Restrictions.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── descriptorExpression │ │ │ │ ├── ClassExpression.Disjoint.html │ │ │ │ ├── ClassExpression.Equivalent.html │ │ │ │ ├── ClassExpression.EquivalentRestriction.html │ │ │ │ ├── ClassExpression.Instance.html │ │ │ │ ├── ClassExpression.Sub.html │ │ │ │ ├── ClassExpression.Super.html │ │ │ │ ├── ClassExpression.html │ │ │ │ ├── DataPropertyExpression.Disjoint.html │ │ │ │ ├── DataPropertyExpression.Domain.html │ │ │ │ ├── DataPropertyExpression.Equivalent.html │ │ │ │ ├── DataPropertyExpression.Range.html │ │ │ │ ├── DataPropertyExpression.Sub.html │ │ │ │ ├── DataPropertyExpression.Super.html │ │ │ │ ├── DataPropertyExpression.html │ │ │ │ ├── IndividualExpression.DataLink.html │ │ │ │ ├── IndividualExpression.Disjoint.html │ │ │ │ ├── IndividualExpression.Equivalent.html │ │ │ │ ├── IndividualExpression.ObjectLink.html │ │ │ │ ├── IndividualExpression.Type.html │ │ │ │ ├── IndividualExpression.html │ │ │ │ ├── ObjectPropertyExpression.Disjoint.html │ │ │ │ ├── ObjectPropertyExpression.Domain.html │ │ │ │ ├── ObjectPropertyExpression.Equivalent.html │ │ │ │ ├── ObjectPropertyExpression.Inverse.html │ │ │ │ ├── ObjectPropertyExpression.Range.html │ │ │ │ ├── ObjectPropertyExpression.Sub.html │ │ │ │ ├── ObjectPropertyExpression.Super.html │ │ │ │ ├── ObjectPropertyExpression.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ └── descriptorGround │ │ │ │ ├── ClassGround.html │ │ │ │ ├── DataPropertyGround.html │ │ │ │ ├── DescriptorGround.html │ │ │ │ ├── DescriptorGroundInterface.ConceptGroundInstance.html │ │ │ │ ├── DescriptorGroundInterface.DataGroundInstance.html │ │ │ │ ├── DescriptorGroundInterface.GroundInstance.html │ │ │ │ ├── DescriptorGroundInterface.IndividualGroundInstance.html │ │ │ │ ├── DescriptorGroundInterface.ObjectGroundInstance.html │ │ │ │ ├── DescriptorGroundInterface.html │ │ │ │ ├── IndividualGround.html │ │ │ │ ├── ObjectPropertyGround.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ └── utility │ │ │ ├── classDescriptor │ │ │ ├── FullClassDesc.html │ │ │ ├── HierarchicalClassDesc.html │ │ │ ├── InstanceClassDesc.html │ │ │ ├── RestrictionClassDesc.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── dataPropertyDescriptor │ │ │ ├── DomainRangeDataPropertyDesc.html │ │ │ ├── FullDataPropertyDesc.html │ │ │ ├── HierarchicalDataPropertyDesc.html │ │ │ ├── RestrictionDataPropertyDesc.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── individualDescriptor │ │ │ ├── FullIndividualDesc.html │ │ │ ├── LinkIndividualDesc.html │ │ │ ├── RestrictionIndividualDesc.html │ │ │ ├── TypeIndividualDesc.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ └── objectPropertyDescriptor │ │ │ ├── DomainRangeObjectPropertyDesc.html │ │ │ ├── FullObjectPropertyDesc.html │ │ │ ├── HierarchicalObjectPropertyDesc.html │ │ │ ├── RestrictionObjectPropertyDesc.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ └── descriptorDebugging │ │ ├── FullClassDescTest.html │ │ ├── FullDataPropertyDescTest.html │ │ ├── FullIndividualDescTest.html │ │ ├── FullObjectPropertyDescTest.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html ├── overview-frame.html ├── overview-summary.html ├── overview-tree.html ├── package-list ├── script.js ├── serialized-form.html └── stylesheet.css ├── gitRepoResources ├── NotesDuringDevelopment.txt └── images │ ├── add_axioms_and_view_in_protege.gif │ ├── classesAssertedInferred.png │ ├── d_methods.png │ ├── descriptor_methods.png │ ├── g_e_es.png │ ├── inferAndBuildResultConsole.png │ ├── owl.png │ ├── owloopLogo.png │ ├── owloop_setup.gif │ ├── protegeOntoClass.png │ ├── protegeOntoIndividual.png │ ├── protegeOntoObjectProperty.png │ ├── removeAxiomsResultConsole.png │ └── unige_ter_logo.png ├── gradlew ├── gradlew.bat ├── lib ├── amor-2.2.jar └── owloop-2.1.jar ├── settings.gradle └── src ├── main └── java │ └── it │ └── emarolab │ └── owloop │ ├── core │ ├── Axiom.java │ ├── Class.java │ ├── DataProperty.java │ ├── Individual.java │ └── ObjectProperty.java │ └── descriptor │ ├── construction │ ├── descriptorEntitySet │ │ ├── Classes.java │ │ ├── DataLinkSet.java │ │ ├── DataLinks.java │ │ ├── DataProperties.java │ │ ├── DescriptorEntitySet.java │ │ ├── Individuals.java │ │ ├── Literals.java │ │ ├── ObjectLinkSet.java │ │ ├── ObjectLinks.java │ │ ├── ObjectProperties.java │ │ └── Restrictions.java │ ├── descriptorExpression │ │ ├── ClassExpression.java │ │ ├── DataPropertyExpression.java │ │ ├── IndividualExpression.java │ │ └── ObjectPropertyExpression.java │ └── descriptorGround │ │ ├── ClassGround.java │ │ ├── DataPropertyGround.java │ │ ├── DescriptorGround.java │ │ ├── DescriptorGroundInterface.java │ │ ├── IndividualGround.java │ │ └── ObjectPropertyGround.java │ └── utility │ ├── classDescriptor │ ├── FullClassDesc.java │ ├── HierarchicalClassDesc.java │ ├── InstanceClassDesc.java │ └── RestrictionClassDesc.java │ ├── dataPropertyDescriptor │ ├── DomainRangeDataPropertyDesc.java │ ├── FullDataPropertyDesc.java │ ├── HierarchicalDataPropertyDesc.java │ └── RestrictionDataPropertyDesc.java │ ├── individualDescriptor │ ├── FullIndividualDesc.java │ ├── LinkIndividualDesc.java │ ├── RestrictionIndividualDesc.java │ └── TypeIndividualDesc.java │ └── objectPropertyDescriptor │ ├── DomainRangeObjectPropertyDesc.java │ ├── FullObjectPropertyDesc.java │ ├── HierarchicalObjectPropertyDesc.java │ └── RestrictionObjectPropertyDesc.java └── test ├── java └── it │ └── emarolab │ └── owloop │ └── articleExamples │ ├── descriptorDebugging │ ├── FullClassDescTest.java │ ├── FullDataPropertyDescTest.java │ ├── FullIndividualDescTest.java │ └── FullObjectPropertyDescTest.java │ ├── drugOrderExample │ └── drugOrder.java │ ├── example1 │ └── addAxioms.java │ ├── example2 │ └── useDescriptorBuildMethod.java │ ├── example3 │ └── RemoveAxioms.java │ └── exampleDescriptors │ ├── CorridorClassDesc.java │ ├── DefClassDesc.java │ ├── DefSubClassDesc.java │ ├── LocationClassDesc.java │ ├── ObjectLinkIndividualDesc.java │ ├── RoomClassDesc.java │ └── TypeIndividualDesc.java └── resources ├── debug ├── individualTest.owl ├── objectPropertyTest.owl ├── ontology4debugging.owl └── robotHomeTesting.owl ├── drug.owl └── robotAtHomeOntology.owl /.gitignore: -------------------------------------------------------------------------------- 1 | ## From https://github.com/github/gitignore/blob/master/Gradle.gitignore 2 | .gradle 3 | /build/ 4 | 5 | ## Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | 19 | # From https://github.com/github/gitignore/blob/master/Java.gitignore 20 | *.class 21 | 22 | # Mobile Tools for Java (J2ME) 23 | .mtj.tmp/ 24 | 25 | # Package Files # 26 | *.war 27 | *.ear 28 | 29 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 30 | hs_err_pid* 31 | 32 | 33 | # From https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore 34 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 35 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 36 | 37 | # User-specific stuff: 38 | .idea/workspace.xml 39 | .idea/tasks.xml 40 | .idea/dictionaries 41 | .idea/vcs.xml 42 | .idea/jsLibraryMappings.xml 43 | 44 | # Sensitive or high-churn files: 45 | .idea/dataSources.ids 46 | .idea/dataSources.xml 47 | .idea/dataSources.local.xml 48 | .idea/sqlDataSources.xml 49 | .idea/dynamic.xml 50 | .idea/uiDesigner.xml 51 | 52 | # Gradle: 53 | .idea/gradle.xml 54 | .idea/libraries 55 | 56 | # Mongo Explorer plugin: 57 | .idea/mongoSettings.xml 58 | 59 | ## File-based project format: 60 | *.iws 61 | 62 | .idea/ 63 | 64 | ## Plugin-specific files: 65 | 66 | # IntelliJ 67 | /out/ 68 | 69 | # mpeltonen/sbt-idea plugin 70 | .idea_modules/ 71 | 72 | # JIRA plugin 73 | atlassian-ide-plugin.xml 74 | 75 | # Crashlytics plugin (for Android Studio and IntelliJ) 76 | com_crashlytics_export_strings.xml 77 | crashlytics.properties 78 | crashlytics-build.properties 79 | fabric.properties 80 | 81 | 82 | *.DS_Store 83 | .AppleDouble 84 | .LSOverride 85 | 86 | # Icon must end with two \r 87 | Icon 88 | 89 | 90 | # Thumbnails 91 | ._* 92 | 93 | # Files that might appear in the root of a volume 94 | .DocumentRevisions-V100 95 | .fseventsd 96 | .Spotlight-V100 97 | .TemporaryItems 98 | .Trashes 99 | .VolumeIcon.icns 100 | .com.apple.timemachine.donotpresent 101 | 102 | # Directories potentially created on remote AFP share 103 | .AppleDB 104 | .AppleDesktop 105 | Network Trash Folder 106 | Temporary Items 107 | .apdisk 108 | 109 | # Created by IntelliJ (hold path dependencies etc.) 110 | *.iml 111 | 112 | !javadoc.zip 113 | !UML.zip 114 | !amor-1.0.jar 115 | !owloop-1.0.jar 116 | !owloop-1.0-with-dependecies.jar 117 | 118 | !build.gradle 119 | 120 | catalog-v001.xml 121 | 122 | gradle/* 123 | 124 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Luca Buoncompagni, Syed Yusha kareem. 3 | * 4 | * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0. 5 | * You may obtain a copy of the License at https://www.gnu.org/licenses/gpl-3.0.en.html 6 | * 7 | */ 8 | 9 | group 'it.emarolab.owloop' 10 | version '2.1' 11 | 12 | apply plugin: 'java' 13 | apply plugin: 'idea' 14 | 15 | repositories { 16 | mavenCentral() 17 | 18 | flatDir { 19 | dirs 'lib' 20 | } 21 | } 22 | 23 | dependencies { 24 | 25 | /* Dependencies are commented in this build.gradle file and instead are added to pom.xml file 26 | because owloop is now using the Maven build tool. */ 27 | 28 | compile 'it.emarolab.amor:amor:2.2' 29 | compile group: 'net.sourceforge.owlapi', name: 'owlapi-distribution', version: '5.0.5' 30 | compile group: 'com.github.galigator.openllet', name: 'openllet-owlapi', version: '2.5.1' 31 | testCompile group: 'junit', name: 'junit', version: '4.12' 32 | } 33 | -------------------------------------------------------------------------------- /docs/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Constant Field Values 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 42 |
43 | 70 | 71 |
72 |

Constant Field Values

73 |

Contents

74 |
75 | 76 |
77 | 78 | 79 |
Skip navigation links
80 | 81 | 82 | 83 | 92 |
93 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /docs/index-files/index-12.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | N-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 42 |
43 | 70 | 71 |
A B C D E F G H I L M N O Q R S T U W  72 | 73 | 74 |

N

75 |
76 |
NL - Static variable in class it.emarolab.owloop.descriptor.construction.descriptorGround.DescriptorGround
77 |
 
78 |
79 | A B C D E F G H I L M N O Q R S T U W 
80 | 81 |
82 | 83 | 84 |
Skip navigation links
85 | 86 | 87 | 88 | 97 |
98 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Generated Documentation (Untitled) 7 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | <noscript> 69 | <div>JavaScript is disabled on your browser.</div> 70 | </noscript> 71 | <h2>Frame Alert</h2> 72 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/drugOrderExample/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.drugOrderExample 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.articleExamples.drugOrderExample

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/drugOrderExample/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.drugOrderExample 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 42 |
43 | 70 | 71 |
72 |

Package it.emarolab.owloop.articleExamples.drugOrderExample

73 |
74 |
75 | 95 |
96 | 97 |
98 | 99 | 100 |
Skip navigation links
101 | 102 | 103 | 104 | 113 |
114 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/drugOrderExample/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.drugOrderExample Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 42 |
43 | 70 | 71 |
72 |

Hierarchy For Package it.emarolab.owloop.articleExamples.drugOrderExample

73 | Package Hierarchies: 74 | 77 |
78 |
79 |

Class Hierarchy

80 | 87 |
88 | 89 |
90 | 91 | 92 |
Skip navigation links
93 | 94 | 95 | 96 | 105 |
106 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/example1/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.example1 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.articleExamples.example1

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/example1/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.example1 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 42 |
43 | 70 | 71 |
72 |

Package it.emarolab.owloop.articleExamples.example1

73 |
74 |
75 | 94 |
95 | 96 |
97 | 98 | 99 |
Skip navigation links
100 | 101 | 102 | 103 | 112 |
113 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/example1/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.example1 Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 42 |
43 | 70 | 71 |
72 |

Hierarchy For Package it.emarolab.owloop.articleExamples.example1

73 | Package Hierarchies: 74 | 77 |
78 |
79 |

Class Hierarchy

80 | 87 |
88 | 89 |
90 | 91 | 92 |
Skip navigation links
93 | 94 | 95 | 96 | 105 |
106 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/example2/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.example2 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.articleExamples.example2

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/example2/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.example2 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 42 |
43 | 70 | 71 |
72 |

Package it.emarolab.owloop.articleExamples.example2

73 |
74 |
75 | 94 |
95 | 96 |
97 | 98 | 99 |
Skip navigation links
100 | 101 | 102 | 103 | 112 |
113 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/example2/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.example2 Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 42 |
43 | 70 | 71 |
72 |

Hierarchy For Package it.emarolab.owloop.articleExamples.example2

73 | Package Hierarchies: 74 | 77 |
78 |
79 |

Class Hierarchy

80 | 87 |
88 | 89 |
90 | 91 | 92 |
Skip navigation links
93 | 94 | 95 | 96 | 105 |
106 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/example3/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.example3 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.articleExamples.example3

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/example3/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.example3 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 42 |
43 | 70 | 71 |
72 |

Package it.emarolab.owloop.articleExamples.example3

73 |
74 |
75 | 94 |
95 | 96 |
97 | 98 | 99 |
Skip navigation links
100 | 101 | 102 | 103 | 112 |
113 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/example3/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.example3 Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 42 |
43 | 70 | 71 |
72 |

Hierarchy For Package it.emarolab.owloop.articleExamples.example3

73 | Package Hierarchies: 74 | 77 |
78 |
79 |

Class Hierarchy

80 | 87 |
88 | 89 |
90 | 91 | 92 |
Skip navigation links
93 | 94 | 95 | 96 | 105 |
106 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/articleExamples/exampleDescriptors/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.articleExamples.exampleDescriptors 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.articleExamples.exampleDescriptors

13 |
14 |

Classes

15 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/descriptor/construction/descriptorEntitySet/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.descriptor.construction.descriptorEntitySet 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.descriptor.construction.descriptorEntitySet

13 |
14 |

Interfaces

15 | 18 |

Classes

19 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/descriptor/construction/descriptorGround/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.descriptor.construction.descriptorGround 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.descriptor.construction.descriptorGround

13 |
14 |

Interfaces

15 | 18 |

Classes

19 | 31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/descriptor/utility/classDescriptor/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.descriptor.utility.classDescriptor 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.descriptor.utility.classDescriptor

13 |
14 |

Classes

15 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/descriptor/utility/dataPropertyDescriptor/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.descriptor.utility.dataPropertyDescriptor 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.descriptor.utility.dataPropertyDescriptor

13 |
14 |

Classes

15 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/descriptor/utility/individualDescriptor/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.descriptor.utility.individualDescriptor 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.descriptor.utility.individualDescriptor

13 |
14 |

Classes

15 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/descriptor/utility/objectPropertyDescriptor/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.descriptor.utility.objectPropertyDescriptor 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.descriptor.utility.objectPropertyDescriptor

13 |
14 |

Classes

15 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/it/emarolab/owloop/descriptorDebugging/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | it.emarolab.owloop.descriptorDebugging 7 | 8 | 9 | 10 | 11 | 12 |

it.emarolab.owloop.descriptorDebugging

13 |
14 |

Classes

15 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overview List 7 | 8 | 9 | 10 | 11 | 12 |
All Classes
13 |
14 |

Packages

15 | 31 |
32 |

 

33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/package-list: -------------------------------------------------------------------------------- 1 | it.emarolab.owloop.articleExamples.drugOrderExample 2 | it.emarolab.owloop.articleExamples.example1 3 | it.emarolab.owloop.articleExamples.example2 4 | it.emarolab.owloop.articleExamples.example3 5 | it.emarolab.owloop.articleExamples.exampleDescriptors 6 | it.emarolab.owloop.core 7 | it.emarolab.owloop.descriptor.construction.descriptorEntitySet 8 | it.emarolab.owloop.descriptor.construction.descriptorExpression 9 | it.emarolab.owloop.descriptor.construction.descriptorGround 10 | it.emarolab.owloop.descriptor.utility.classDescriptor 11 | it.emarolab.owloop.descriptor.utility.dataPropertyDescriptor 12 | it.emarolab.owloop.descriptor.utility.individualDescriptor 13 | it.emarolab.owloop.descriptor.utility.objectPropertyDescriptor 14 | it.emarolab.owloop.descriptorDebugging 15 | -------------------------------------------------------------------------------- /docs/script.js: -------------------------------------------------------------------------------- 1 | function show(type) 2 | { 3 | count = 0; 4 | for (var key in methods) { 5 | var row = document.getElementById(key); 6 | if ((methods[key] & type) != 0) { 7 | row.style.display = ''; 8 | row.className = (count++ % 2) ? rowColor : altColor; 9 | } 10 | else 11 | row.style.display = 'none'; 12 | } 13 | updateTabs(type); 14 | } 15 | 16 | function updateTabs(type) 17 | { 18 | for (var value in tabs) { 19 | var sNode = document.getElementById(tabs[value][0]); 20 | var spanNode = sNode.firstChild; 21 | if (value == type) { 22 | sNode.className = activeTableTab; 23 | spanNode.innerHTML = tabs[value][1]; 24 | } 25 | else { 26 | sNode.className = tableTab; 27 | spanNode.innerHTML = "" + tabs[value][1] + ""; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /gitRepoResources/NotesDuringDevelopment.txt: -------------------------------------------------------------------------------- 1 | ######################################################## 2 | 3 | Notes taken during development of this (OWLOOP) project. 4 | 5 | ######################################################## 6 | 7 | This document is mainly for keeping track on how we overcome some critical/common problems when we find them. 8 | Because as you know, when we leave the code for a week or two, and come back to it, we forget how we made it. :) 9 | 10 | Moreover, this document can also be used to note ideas for future development, and the prerequisites that can bring them to life. 11 | 12 | The structure for tracking the problems is as follows: 13 | 14 | [Date - Author] 15 | [Problem] 16 | [Fix] 17 | 18 | The structure for tracking the ideas is as follows: 19 | 20 | [Date - Author] 21 | [Idea] 22 | [Prerequisites] 23 | 24 | ################################################################################################################ 25 | 26 | [Date - Author] 21/05/2019 - Syed Yusha Kareem 27 | [Problem] Axioms do not get removed, if some are added by hand in protege and others added from the code. To delete something, need to delete everything (i.e, IndividualExpressionAxioms). 28 | [Fix] 29 | 30 | /* 31 | QUICK THOUGHTS: 32 | 33 | // Regarding the use of readExpressionAxioms() 34 | 35 | 36 | d1.addObject( "hasProp1", "X"); 37 | d1.addObject( "hasProp2", "X"); 38 | d1.writeExpressionAxioms(); 39 | 40 | FullIndividualDesc d1 = new FullIndividualDesc("Robot1", ontoref); 41 | d1.readExpressionAxioms(); //at this point the descriptor reads all knowledge 42 | System.out.println( " 11 " + d1); 43 | 44 | FullIndividualDesc d2 = new FullIndividualDesc("Robot1", ontoref); 45 | d2.addObject( "hasProp1"); 46 | d2.addObject( "hasProp2"); 47 | d2.readExpressionAxioms(); //at this point the descriptor reads only particular knowledge 48 | System.out.println( " 22 " + d2); 49 | */ 50 | 51 | 52 | /* 53 | We need ..OWLRefCreated.. to make an ontology which does not exist 54 | We need ..OWLRefFromFile.. to interact with an ontology which already exists 55 | From the ..OWLRefCreated.. file we can write/save in both ways (ontoref.save(), descriptor.save(path)) and CAN-READ in both ways (same descriptor, new descriptor). 56 | From the ..OWLRefFromFile.. we can write/save in one way (descriptor.save(path)) and CAN-READ in both ways (same descriptor, new descriptor). 57 | SynchronizeReasoner() to be in sync with the latest state of the ontology (else the descriptor reads the state of the ontology, when it was instantiated) 58 | readExpressionAxioms(), when called for the first time, reads all (asserted and inferred) axioms because when the descriptor is initialized, syncOnto() is called. 59 | With newOWLReferenceFromFileWithPellet(), decriptor.saveOntology(path), IS WORKING 60 | With newOWLReferenceFromFileWithPellet(), ontoRef.saveOntology(path), IS WORKING 61 | TODO: [Make developer's life easier] Make ontoRef.saveOntology() work with newOWLReferenceFromFileWithPellet() 62 | Its nice to (sync and save) after writing something to the ontology. 63 | */ 64 | 65 | /* 66 | Regarding mandatory usage of OWLReferencesContainer from aMOR 67 | 68 | Note that: First and foremost it is important to instantiate an object such that we load ontology into memory (An in-memory representation - Abstract Syntax Tree). 69 | To do this aMOR provides a class called OWLReferencesContainer that initializes the ontology by loading it into memory and gives an OWLReference object. 70 | */ 71 | 72 | /* 73 | UNEXPECTED BEHAVIOUR AND THEIR FIXES 74 | 75 | (If) Ontology is not updated properly 76 | (Then) Try using writeAxiomsReasonReadAxioms() 77 | 78 | (If) Descriptor's internal state is not updating properly 79 | (Then) Make AMORLogging(True) and check is there is an error (because the ontology could be inconsistent) 80 | 81 | (If) OWLReferences object 'ontoRef' is instantiated with newOWLReferenceFromFileWithPellet() and ontoRef.saveOntology() is not saving axioms to .owl file 82 | (Then) Provide file-path, i.e., ontoRef.saveOntology(ontoRef.getFilePath()) 83 | */ 84 | 85 | TODO [Find out] what is the use of ontoRef.getReasonerExplainer(); -------------------------------------------------------------------------------- /gitRepoResources/images/add_axioms_and_view_in_protege.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/add_axioms_and_view_in_protege.gif -------------------------------------------------------------------------------- /gitRepoResources/images/classesAssertedInferred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/classesAssertedInferred.png -------------------------------------------------------------------------------- /gitRepoResources/images/d_methods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/d_methods.png -------------------------------------------------------------------------------- /gitRepoResources/images/descriptor_methods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/descriptor_methods.png -------------------------------------------------------------------------------- /gitRepoResources/images/g_e_es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/g_e_es.png -------------------------------------------------------------------------------- /gitRepoResources/images/inferAndBuildResultConsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/inferAndBuildResultConsole.png -------------------------------------------------------------------------------- /gitRepoResources/images/owl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/owl.png -------------------------------------------------------------------------------- /gitRepoResources/images/owloopLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/owloopLogo.png -------------------------------------------------------------------------------- /gitRepoResources/images/owloop_setup.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/owloop_setup.gif -------------------------------------------------------------------------------- /gitRepoResources/images/protegeOntoClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/protegeOntoClass.png -------------------------------------------------------------------------------- /gitRepoResources/images/protegeOntoIndividual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/protegeOntoIndividual.png -------------------------------------------------------------------------------- /gitRepoResources/images/protegeOntoObjectProperty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/protegeOntoObjectProperty.png -------------------------------------------------------------------------------- /gitRepoResources/images/removeAxiomsResultConsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/removeAxiomsResultConsole.png -------------------------------------------------------------------------------- /gitRepoResources/images/unige_ter_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/gitRepoResources/images/unige_ter_logo.png -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 165 | if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then 166 | cd "$(dirname "$0")" 167 | fi 168 | 169 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 170 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /lib/amor-2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/lib/amor-2.2.jar -------------------------------------------------------------------------------- /lib/owloop-2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheEngineRoom-UniGe/OWLOOP/1e1a8e48407098361a4656d1ba0bad0cbe535775/lib/owloop-2.1.jar -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Luca Buoncompagni, Syed Yusha Kareem. 3 | * 4 | * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0. 5 | * You may obtain a copy of the License at https://www.gnu.org/licenses/gpl-3.0.en.html 6 | * 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | * License for the specific language governing permissions and limitations under 11 | * the License. 12 | */ 13 | 14 | rootProject.name = 'owloop' 15 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorEntitySet/Classes.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorEntitySet; 2 | 3 | import it.emarolab.owloop.core.Axiom; 4 | import org.semanticweb.owlapi.model.OWLClass; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * An extension of {@link DescriptorEntitySet.EntitySetBase} for {@link OWLClass}. 10 | *

11 | * It represent the {@link Axiom.EntitySet} which contains OWL-Classes. 12 | *

13 | * 14 | *

15 | *

16 | * File: it.emarolab.owloop.core.Axiom
17 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
18 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
19 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
20 | * date: 01/05/19
21 | *
22 | */ 23 | public class Classes 24 | extends DescriptorEntitySet.OWLEntitySetBase 25 | implements Axiom.EntitySet { 26 | public Classes() { 27 | } 28 | public Classes(Collection c) { 29 | super(c); 30 | } 31 | public Classes(int initialCapacity, float loadFactor) { 32 | super(initialCapacity, loadFactor); 33 | } 34 | public Classes(int initialCapacity) { 35 | super(initialCapacity); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorEntitySet/DataLinkSet.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorEntitySet; 2 | 3 | import it.emarolab.owloop.core.Axiom; 4 | import org.semanticweb.owlapi.model.OWLDataProperty; 5 | import org.semanticweb.owlapi.model.OWLLiteral; 6 | 7 | import java.util.Collection; 8 | 9 | /** 10 | * An extension of {@link DescriptorEntitySet.EntitySetBase} for {@link Axiom.ExpressionEntitySet} for DataLinks. 11 | *

12 | * It represents a set of OWL-DataProperties and related OWL-Literals, as a collection of {@link DataLinks}. 13 | *

14 | * 15 | *

16 | *

17 | * File: it.emarolab.owloop.core.Axiom
18 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
19 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
20 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
21 | * date: 01/05/19
22 | *
23 | */ 24 | public class DataLinkSet 25 | extends DescriptorEntitySet.ExpressionEntitySetBase 26 | implements Axiom.ExpressionEntitySet { 27 | 28 | public DataLinkSet() { 29 | } 30 | public DataLinkSet(Collection c) { 31 | super(c); 32 | } 33 | public DataLinkSet(int initialCapacity, float loadFactor) { 34 | super(initialCapacity, loadFactor); 35 | } 36 | public DataLinkSet(int initialCapacity) { 37 | super(initialCapacity); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorEntitySet/DataProperties.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorEntitySet; 2 | 3 | import it.emarolab.owloop.core.Axiom; 4 | import org.semanticweb.owlapi.model.OWLDataProperty; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * An extension of {@link DescriptorEntitySet.EntitySetBase} for {@link OWLDataProperty}. 10 | *

11 | * It represent the {@link Axiom.EntitySet} which contains OWL-DataProperties. 12 | *

13 | * 14 | *

15 | *

16 | * File: it.emarolab.owloop.core.Axiom
17 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
18 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
19 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
20 | * date: 01/05/19
21 | *
22 | */ 23 | public class DataProperties 24 | extends DescriptorEntitySet.OWLEntitySetBase 25 | implements Axiom.EntitySet { 26 | 27 | public DataProperties() { 28 | } 29 | public DataProperties(Collection c) { 30 | super(c); 31 | } 32 | public DataProperties(int initialCapacity, float loadFactor) { 33 | super(initialCapacity, loadFactor); 34 | } 35 | public DataProperties(int initialCapacity) { 36 | super(initialCapacity); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorEntitySet/Individuals.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorEntitySet; 2 | 3 | import it.emarolab.owloop.core.Axiom; 4 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * An extension of {@link DescriptorEntitySet.EntitySetBase} for {@link OWLNamedIndividual}. 10 | *

11 | * It represents the {@link Axiom.EntitySet} which contains OWL-Individuals. 12 | *

13 | * 14 | *

15 | *

16 | * File: it.emarolab.owloop.core.Axiom
17 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
18 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
19 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
20 | * date: 01/05/19
21 | *
22 | */ 23 | public class Individuals 24 | extends DescriptorEntitySet.OWLEntitySetBase 25 | implements Axiom.EntitySet { 26 | public Individuals() { 27 | } 28 | public Individuals(Collection c) { 29 | super(c); 30 | } 31 | public Individuals(int initialCapacity, float loadFactor) { 32 | super(initialCapacity, loadFactor); 33 | } 34 | public Individuals(int initialCapacity) { 35 | super(initialCapacity); 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorEntitySet/Literals.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorEntitySet; 2 | 3 | import it.emarolab.owloop.core.Axiom; 4 | import org.semanticweb.owlapi.model.OWLLiteral; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * An extension of {@link DescriptorEntitySet.EntitySetBase} for {@link OWLLiteral}. 10 | *

11 | * It represent the {@link Axiom.EntitySet} which contains OWL-literals. 12 | *

13 | * 14 | *

15 | *

16 | * File: it.emarolab.owloop.core.Axiom
17 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
18 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
19 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
20 | * date: 01/05/19
21 | *
22 | */ 23 | public class Literals 24 | extends DescriptorEntitySet.OWLEntitySetBase 25 | implements Axiom.EntitySet { 26 | 27 | public Literals() { 28 | } 29 | public Literals(Collection c) { 30 | super(c); 31 | } 32 | public Literals(int initialCapacity, float loadFactor) { 33 | super(initialCapacity, loadFactor); 34 | } 35 | public Literals(int initialCapacity) { 36 | super(initialCapacity); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorEntitySet/ObjectLinkSet.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorEntitySet; 2 | 3 | import it.emarolab.owloop.core.Axiom; 4 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 5 | import org.semanticweb.owlapi.model.OWLObjectProperty; 6 | 7 | import java.util.Collection; 8 | 9 | /** 10 | * An extension of {@link DescriptorEntitySet.EntitySetBase} for {@link Axiom.ExpressionEntitySet} for ObjectLinks. 11 | *

12 | * It represents a set of OWL-ObjectProperties and related OWL-Individuals, as a collection of {@link ObjectLinks}. 13 | *

14 | * 15 | *

16 | *

17 | * File: it.emarolab.owloop.core.Axiom
18 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
19 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
20 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
21 | * date: 01/05/19
22 | *
23 | */ 24 | public class ObjectLinkSet 25 | extends DescriptorEntitySet.ExpressionEntitySetBase 26 | implements Axiom.ExpressionEntitySet { 27 | 28 | public ObjectLinkSet() { 29 | } 30 | public ObjectLinkSet(Collection c) { 31 | super(c); 32 | } 33 | public ObjectLinkSet(int initialCapacity, float loadFactor) { 34 | super(initialCapacity, loadFactor); 35 | } 36 | public ObjectLinkSet(int initialCapacity) { 37 | super(initialCapacity); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorEntitySet/ObjectProperties.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorEntitySet; 2 | 3 | import it.emarolab.owloop.core.Axiom; 4 | import org.semanticweb.owlapi.model.OWLObjectProperty; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * An extension of {@link DescriptorEntitySet.EntitySetBase} for {@link OWLObjectProperty}. 10 | *

11 | * It represent the {@link Axiom.EntitySet} which contains OWL-ObjectProperties. 12 | *

13 | * 14 | *

15 | *

16 | * File: it.emarolab.owloop.core.Axiom
17 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
18 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
19 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
20 | * date: 01/05/19
21 | *
22 | */ 23 | public class ObjectProperties 24 | extends DescriptorEntitySet.OWLEntitySetBase 25 | implements Axiom.EntitySet { 26 | 27 | public ObjectProperties() { 28 | } 29 | public ObjectProperties(Collection c) { 30 | super(c); 31 | } 32 | public ObjectProperties(int initialCapacity, float loadFactor) { 33 | super(initialCapacity, loadFactor); 34 | } 35 | public ObjectProperties(int initialCapacity) { 36 | super(initialCapacity); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorEntitySet/Restrictions.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorEntitySet; 2 | 3 | import it.emarolab.amor.owlInterface.SemanticRestriction; 4 | import it.emarolab.owloop.core.Axiom; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * An extension of {@link DescriptorEntitySet.EntitySetBase} for {@link SemanticRestriction}. 10 | *

11 | * It represent the {@link Axiom.EntitySet} which contains OWL-Restrictions. 12 | *

13 | * 14 | *

15 | *

16 | * File: it.emarolab.owloop.core.Axiom
17 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
18 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
19 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
20 | * date: 01/05/19
21 | *
22 | */ 23 | public class Restrictions 24 | extends DescriptorEntitySet.EntitySetBase 25 | implements Axiom.EntitySet { 26 | 27 | public Restrictions() { 28 | } 29 | public Restrictions(Collection c) { 30 | super(c); 31 | } 32 | public Restrictions(int initialCapacity, float loadFactor) { 33 | super(initialCapacity, loadFactor); 34 | } 35 | public Restrictions(int initialCapacity) { 36 | super(initialCapacity); 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorGround/ClassGround.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorGround; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.ClassExpression; 5 | import org.semanticweb.owlapi.model.OWLClass; 6 | 7 | /** 8 | * This abstract class is used to instantiate a {@link DescriptorGround} for a {@link ConceptGroundInstance} 9 | * linked to {@link ClassExpression}s. 10 | * 11 | *

12 | *

13 | * File: it.emarolab.owloop.core.Axiom
14 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
15 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
16 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
17 | * date: 01/05/19
18 | *
19 | */ 20 | abstract public class ClassGround 21 | extends DescriptorGround 22 | implements ClassExpression { 23 | 24 | public ClassGround(OWLClass instance, OWLReferences onto) { 25 | super(instance, onto); 26 | } 27 | public ClassGround(String instanceName, OWLReferences onto) { 28 | super(instanceName, onto); 29 | } 30 | public ClassGround(OWLClass instance, String ontoName) { 31 | super(instance, ontoName); 32 | } 33 | public ClassGround(OWLClass instance, String ontoName, String filePath, String iriPath) { 34 | super(instance, ontoName, filePath, iriPath); 35 | } 36 | public ClassGround(OWLClass instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 37 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 38 | } 39 | public ClassGround(String instanceName, String ontoName) { 40 | super(instanceName, ontoName); 41 | } 42 | public ClassGround(String instanceName, String ontoName, String filePath, String iriPath) { 43 | super(instanceName, ontoName, filePath, iriPath); 44 | } 45 | public ClassGround(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 46 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 47 | } 48 | 49 | @Override 50 | protected GroundInstance getNewGround(OWLReferences ontology, OWLClass instance) { 51 | return new ConceptGroundInstance(ontology, instance); 52 | } 53 | 54 | @Override 55 | protected GroundInstance getNewGround(OWLReferences ontology, String instance) { 56 | return new ConceptGroundInstance( ontology, ontology.getOWLClass( instance)); 57 | } 58 | 59 | @Override 60 | public ConceptGroundInstance getGround() { 61 | return (ConceptGroundInstance) super.getGround(); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorGround/DataPropertyGround.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorGround; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.DataPropertyExpression; 5 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.ObjectPropertyExpression; 6 | import org.semanticweb.owlapi.model.OWLDataProperty; 7 | 8 | /** 9 | * This abstract class is used to instantiate a {@link DescriptorGround} for a {@link DataGroundInstance} 10 | * linked to {@link DataPropertyExpression}s. 11 | * 12 | *

13 | *

14 | * File: it.emarolab.owloop.core.Axiom
15 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
16 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
17 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
18 | * date: 01/05/19
19 | *
20 | */ 21 | abstract public class DataPropertyGround 22 | extends DescriptorGround 23 | implements DataPropertyExpression { 24 | 25 | public DataPropertyGround(OWLDataProperty instance, OWLReferences onto) { 26 | super(instance, onto); 27 | } 28 | public DataPropertyGround(String instanceName, OWLReferences onto) { 29 | super(instanceName, onto); 30 | } 31 | public DataPropertyGround(OWLDataProperty instance, String ontoName) { 32 | super(instance, ontoName); 33 | } 34 | public DataPropertyGround(OWLDataProperty instance, String ontoName, String filePath, String iriPath) { 35 | super(instance, ontoName, filePath, iriPath); 36 | } 37 | public DataPropertyGround(OWLDataProperty instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 38 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 39 | } 40 | public DataPropertyGround(String instanceName, String ontoName) { 41 | super(instanceName, ontoName); 42 | } 43 | public DataPropertyGround(String instanceName, String ontoName, String filePath, String iriPath) { 44 | super(instanceName, ontoName, filePath, iriPath); 45 | } 46 | public DataPropertyGround(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 47 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 48 | } 49 | 50 | @Override 51 | protected GroundInstance getNewGround(OWLReferences ontology, OWLDataProperty instance) { 52 | return new DataGroundInstance(ontology, instance); 53 | } 54 | @Override 55 | protected GroundInstance getNewGround(OWLReferences ontology, String instance) { 56 | return new DataGroundInstance( ontology, ontology.getOWLDataProperty( instance)); 57 | } 58 | 59 | @Override 60 | public DataGroundInstance getGround() { 61 | return (DataGroundInstance) super.getGround(); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorGround/IndividualGround.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorGround; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.IndividualExpression; 5 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 6 | 7 | /** 8 | * This abstract class is used to instantiate a {@link DescriptorGround} for a {@link IndividualGroundInstance} 9 | * linked to {@link IndividualExpression}s. 10 | * 11 | *

12 | *

13 | * File: it.emarolab.owloop.core.Axiom
14 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
15 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
16 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
17 | * date: 01/05/19
18 | *
19 | */ 20 | abstract public class IndividualGround 21 | extends DescriptorGround 22 | implements IndividualExpression { 23 | 24 | public IndividualGround(OWLNamedIndividual instance, OWLReferences onto) { 25 | super(instance, onto); 26 | } 27 | 28 | public IndividualGround(String instanceName, OWLReferences onto) { 29 | super(instanceName, onto); 30 | } 31 | 32 | public IndividualGround(OWLNamedIndividual instance, String ontoName) { 33 | super(instance, ontoName); 34 | } 35 | 36 | public IndividualGround(OWLNamedIndividual instance, String ontoName, String filePath, String iriPath) { 37 | super(instance, ontoName, filePath, iriPath); 38 | } 39 | 40 | public IndividualGround(OWLNamedIndividual instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 41 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 42 | } 43 | 44 | public IndividualGround(String instanceName, String ontoName) { 45 | super(instanceName, ontoName); 46 | } 47 | 48 | public IndividualGround(String instanceName, String ontoName, String filePath, String iriPath) { 49 | super(instanceName, ontoName, filePath, iriPath); 50 | } 51 | 52 | public IndividualGround(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 53 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 54 | } 55 | 56 | @Override 57 | protected GroundInstance getNewGround(OWLReferences ontology, OWLNamedIndividual instance) { 58 | return new IndividualGroundInstance(ontology, instance); 59 | } 60 | 61 | @Override 62 | protected GroundInstance getNewGround(OWLReferences ontology, String instance) { 63 | return new IndividualGroundInstance( ontology, ontology.getOWLIndividual( instance)); 64 | } 65 | 66 | @Override 67 | public IndividualGroundInstance getGround() { 68 | return (IndividualGroundInstance) super.getGround(); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/construction/descriptorGround/ObjectPropertyGround.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.construction.descriptorGround; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.ObjectPropertyExpression; 5 | import org.semanticweb.owlapi.model.OWLObjectProperty; 6 | 7 | /** 8 | * This abstract class is used to instantiate a {@link DescriptorGround} for a {@link ObjectGroundInstance} 9 | * linked to {@link ObjectPropertyExpression}s. 10 | * 11 | *

12 | *

13 | * File: it.emarolab.owloop.core.Axiom
14 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
15 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
16 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
17 | * date: 01/05/19
18 | *
19 | */ 20 | abstract public class ObjectPropertyGround 21 | extends DescriptorGround 22 | implements ObjectPropertyExpression { 23 | 24 | public ObjectPropertyGround(OWLObjectProperty instance, OWLReferences onto) { 25 | super(instance, onto); 26 | } 27 | public ObjectPropertyGround(String instanceName, OWLReferences onto) { 28 | super(instanceName, onto); 29 | } 30 | public ObjectPropertyGround(OWLObjectProperty instance, String ontoName) { 31 | super(instance, ontoName); 32 | } 33 | public ObjectPropertyGround(OWLObjectProperty instance, String ontoName, String filePath, String iriPath) { 34 | super(instance, ontoName, filePath, iriPath); 35 | } 36 | public ObjectPropertyGround(OWLObjectProperty instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 37 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 38 | } 39 | public ObjectPropertyGround(String instanceName, String ontoName) { 40 | super(instanceName, ontoName); 41 | } 42 | public ObjectPropertyGround(String instanceName, String ontoName, String filePath, String iriPath) { 43 | super(instanceName, ontoName, filePath, iriPath); 44 | } 45 | public ObjectPropertyGround(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 46 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 47 | } 48 | 49 | @Override 50 | protected GroundInstance getNewGround(OWLReferences ontology, OWLObjectProperty instance) { 51 | return new ObjectGroundInstance(ontology, instance); 52 | } 53 | @Override 54 | protected GroundInstance getNewGround(OWLReferences ontology, String instance) { 55 | return new ObjectGroundInstance( ontology, ontology.getOWLObjectProperty( instance)); 56 | } 57 | 58 | @Override 59 | public ObjectGroundInstance getGround() { 60 | return (ObjectGroundInstance) super.getGround(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/utility/classDescriptor/HierarchicalClassDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.utility.classDescriptor; 2 | 3 | 4 | import it.emarolab.amor.owlInterface.OWLReferences; 5 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Classes; 6 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.ClassExpression; 7 | import it.emarolab.owloop.descriptor.construction.descriptorGround.ClassGround; 8 | import org.semanticweb.owlapi.model.OWLClass; 9 | 10 | import java.util.List; 11 | 12 | 13 | /** 14 | * This is an example of a 'compound' Class Descriptor that implements 2 ClassExpression (aka {@link ClassExpression}) interfaces: 15 | *
    16 | *
  • {@link ClassExpression.Sub}: to describe that a Class subsumes another Class.
  • 17 | *
  • {@link ClassExpression.Super}: to describe that a Class is a super-class of another Class.
  • 18 | *
19 | * 20 | * See {@link FullClassDesc} for an example of a 'compound' Class Descriptor that implements all ClassExpressions (aka {@link ClassExpression}). 21 | * 22 | *

23 | *

24 | * File: it.emarolab.owloop.core.Axiom
25 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
26 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
27 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
28 | * date: 01/05/19
29 | *
30 | */ 31 | public class HierarchicalClassDesc 32 | extends ClassGround 33 | implements ClassExpression.Sub, 34 | ClassExpression.Super{ 35 | 36 | private Classes subClasses = new Classes(); 37 | private Classes superClasses = new Classes(); 38 | 39 | /* Constructors from class: ClassGround */ 40 | 41 | public HierarchicalClassDesc(OWLClass instance, OWLReferences onto) { 42 | super(instance, onto); 43 | } 44 | public HierarchicalClassDesc(String instanceName, OWLReferences onto) { 45 | super(instanceName, onto); 46 | } 47 | public HierarchicalClassDesc(OWLClass instance, String ontoName) { 48 | super(instance, ontoName); 49 | } 50 | public HierarchicalClassDesc(OWLClass instance, String ontoName, String filePath, String iriPath) { 51 | super(instance, ontoName, filePath, iriPath); 52 | } 53 | public HierarchicalClassDesc(OWLClass instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 54 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 55 | } 56 | public HierarchicalClassDesc(String instanceName, String ontoName) { 57 | super(instanceName, ontoName); 58 | } 59 | public HierarchicalClassDesc(String instanceName, String ontoName, String filePath, String iriPath) { 60 | super(instanceName, ontoName, filePath, iriPath); 61 | } 62 | public HierarchicalClassDesc(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 63 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 64 | } 65 | 66 | /* Overriding methods in class: ClassGround */ 67 | 68 | 69 | // To read axioms from an ontology 70 | @Override 71 | public List readAxioms() { 72 | List r = ClassExpression.Sub.super.readAxioms(); 73 | r.addAll( ClassExpression.Super.super.readAxioms()); 74 | return r; 75 | } 76 | // To write axioms to an ontology 77 | @Override 78 | public List writeAxioms() { 79 | List r = ClassExpression.Sub.super.writeAxioms(); 80 | r.addAll( ClassExpression.Super.super.writeAxioms()); 81 | return r; 82 | } 83 | 84 | /* Overriding methods in classes: Class and ClassExpression */ 85 | 86 | 87 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 88 | @Override 89 | public HierarchicalClassDesc getSubClassDescriptor(OWLClass instance, OWLReferences ontology) { 90 | return new HierarchicalClassDesc( instance, ontology); 91 | } 92 | // It returns subClasses from the EntitySet (after being read from the ontology) 93 | @Override 94 | public Classes getSubClasses() { 95 | return subClasses; 96 | } 97 | 98 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 99 | @Override 100 | public HierarchicalClassDesc getSuperClassDescriptor(OWLClass instance, OWLReferences ontology) { 101 | return new HierarchicalClassDesc( instance, ontology); 102 | } 103 | // It returns superClasses from the EntitySet (after being read from the ontology) 104 | @Override 105 | public Classes getSuperClasses() { 106 | return superClasses; 107 | } 108 | 109 | /* Overriding method in class: Object */ 110 | 111 | 112 | // To show internal state of the Descriptor 113 | @Override 114 | public String toString() { 115 | return getClass().getSimpleName() + "{" + "\n" + 116 | "\n" + 117 | "\t" + getGround() + ":" + "\n" + 118 | "\n" + 119 | "\t\t⊃ " + subClasses + "\n" + 120 | "\t\t⊂ " + superClasses + "\n" + 121 | "}" + "\n"; 122 | } 123 | } -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/utility/classDescriptor/InstanceClassDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.utility.classDescriptor; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Individuals; 5 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.ClassExpression; 6 | import it.emarolab.owloop.descriptor.construction.descriptorGround.ClassGround; 7 | import it.emarolab.owloop.descriptor.utility.individualDescriptor.LinkIndividualDesc; 8 | import org.semanticweb.owlapi.model.OWLClass; 9 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 10 | 11 | import java.util.List; 12 | 13 | 14 | /** 15 | * This is an example of a 'simple' Class Descriptor that implements 1 ClassExpression (aka {@link ClassExpression}) interface: 16 | *
    17 | *
  • {@link ClassExpression.Instance}: to describe an Individual of a Class.
  • 18 | *
19 | * 20 | * See {@link FullClassDesc} for an example of a 'compound' Class Descriptor that implements all ClassExpressions (aka {@link ClassExpression}). 21 | *

22 | *

23 | * File: it.emarolab.owloop.core.Axiom
24 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
25 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
26 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
27 | * date: 01/05/19
28 | *
29 | */ 30 | public class InstanceClassDesc 31 | extends ClassGround 32 | implements ClassExpression.Instance { 33 | 34 | private Individuals individuals = new Individuals(); 35 | 36 | /* Constructors from class: ClassGround */ 37 | 38 | public InstanceClassDesc(OWLClass instance, OWLReferences onto) { 39 | super(instance, onto); 40 | } 41 | public InstanceClassDesc(String instanceName, OWLReferences onto) { 42 | super(instanceName, onto); 43 | } 44 | public InstanceClassDesc(OWLClass instance, String ontoName) { 45 | super(instance, ontoName); 46 | } 47 | public InstanceClassDesc(OWLClass instance, String ontoName, String filePath, String iriPath) { 48 | super(instance, ontoName, filePath, iriPath); 49 | } 50 | public InstanceClassDesc(OWLClass instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 51 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 52 | } 53 | public InstanceClassDesc(String instanceName, String ontoName) { 54 | super(instanceName, ontoName); 55 | } 56 | public InstanceClassDesc(String instanceName, String ontoName, String filePath, String iriPath) { 57 | super(instanceName, ontoName, filePath, iriPath); 58 | } 59 | public InstanceClassDesc(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 60 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 61 | } 62 | 63 | /* Overriding methods in class: ClassGround */ 64 | 65 | 66 | // To read axioms from an ontology 67 | @Override 68 | public List readAxioms() { 69 | return Instance.super.readAxioms(); 70 | } 71 | // To write axioms to an ontology 72 | @Override 73 | public List writeAxioms() { 74 | return Instance.super.writeAxioms(); 75 | } 76 | 77 | /* Overriding methods in classes: Class and ClassExpression */ 78 | 79 | 80 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 81 | @Override 82 | public LinkIndividualDesc getIndividualDescriptor(OWLNamedIndividual instance, OWLReferences ontology) { 83 | return new LinkIndividualDesc( instance, ontology); 84 | } 85 | // It returns Individuals from the EntitySet (after being read from the ontology) 86 | @Override 87 | public Individuals getIndividuals() { 88 | return individuals; 89 | } 90 | 91 | /* Overriding method in class: Object */ 92 | 93 | 94 | // To show internal state of the Descriptor 95 | @Override 96 | public String toString() { 97 | return getClass().getSimpleName() + "{" + "\n" + 98 | "\n" + 99 | "\t" + getGround() + ":" + "\n" + 100 | "\n" + 101 | "\t\t⇐ " + individuals + "\n" + 102 | "}" + "\n"; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/utility/dataPropertyDescriptor/DomainRangeDataPropertyDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.utility.dataPropertyDescriptor; 2 | 3 | 4 | import it.emarolab.amor.owlInterface.OWLReferences; 5 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Restrictions; 6 | import it.emarolab.owloop.descriptor.construction.descriptorGround.DataPropertyGround; 7 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.DataPropertyExpression; 8 | import org.semanticweb.owlapi.model.OWLDataProperty; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * This is an example of a 'compound' DataProperty Descriptor which implements 2 {@link DataPropertyExpression} interfaces: 14 | * 15 | *
    16 | *
  • {@link DataPropertyExpression.Domain}: to describe the domain restrictions of a DataProperty.
  • 17 | *
  • {@link DataPropertyExpression.Range}: to describe the range restrictions of a DataProperty.
  • 18 | *
19 | * 20 | * See {@link FullDataPropertyDesc} for an example of a 'compound' DataProperty Descriptor that implements all DataPropertyExpressions. 21 | * 22 | *

23 | *

24 | * File: it.emarolab.owloop.core.Axiom
25 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
26 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
27 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
28 | * date: 01/05/19
29 | *
30 | */ 31 | public class DomainRangeDataPropertyDesc 32 | extends DataPropertyGround 33 | implements DataPropertyExpression.Domain, 34 | DataPropertyExpression.Range { 35 | 36 | private Restrictions domainRestrictions = new Restrictions(); 37 | private Restrictions rangeRestrictions = new Restrictions(); 38 | 39 | /* Constructors from class: DataPropertyGround */ 40 | 41 | public DomainRangeDataPropertyDesc(OWLDataProperty instance, OWLReferences onto) { 42 | super(instance, onto); 43 | } 44 | public DomainRangeDataPropertyDesc(String instanceName, OWLReferences onto) { 45 | super(instanceName, onto); 46 | } 47 | public DomainRangeDataPropertyDesc(OWLDataProperty instance, String ontoName) { 48 | super(instance, ontoName); 49 | } 50 | public DomainRangeDataPropertyDesc(OWLDataProperty instance, String ontoName, String filePath, String iriPath) { 51 | super(instance, ontoName, filePath, iriPath); 52 | } 53 | public DomainRangeDataPropertyDesc(OWLDataProperty instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 54 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 55 | } 56 | public DomainRangeDataPropertyDesc(String instanceName, String ontoName) { 57 | super(instanceName, ontoName); 58 | } 59 | public DomainRangeDataPropertyDesc(String instanceName, String ontoName, String filePath, String iriPath) { 60 | super(instanceName, ontoName, filePath, iriPath); 61 | } 62 | public DomainRangeDataPropertyDesc(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 63 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 64 | } 65 | 66 | /* Overriding methods in class: DataPropertyGround */ 67 | 68 | 69 | // To read axioms from an ontology 70 | @Override 71 | public List readAxioms() { 72 | List r = DataPropertyExpression.Domain.super.readAxioms(); 73 | r.addAll( DataPropertyExpression.Range.super.readAxioms()); 74 | return r; 75 | } 76 | // To write axioms to an ontology 77 | @Override 78 | public List writeAxioms() { 79 | List r = DataPropertyExpression.Range.super.writeAxioms(); 80 | r.addAll( DataPropertyExpression.Domain.super.writeAxioms()); 81 | return r; 82 | } 83 | 84 | /* Overriding methods in classes: DataProperty and DataPropertyExpression */ 85 | 86 | 87 | // It returns domainRestrictions from the EntitySet (after being read from the ontology) 88 | @Override 89 | public Restrictions getDomainRestrictions() { 90 | return domainRestrictions; 91 | } 92 | // It returns rangeRestrictions from the EntitySet (after being read from the ontology) 93 | @Override 94 | public Restrictions getRangeRestrictions() { 95 | return rangeRestrictions; 96 | } 97 | 98 | /* Overriding method in class: Object */ 99 | 100 | 101 | // To show internal state of the Descriptor 102 | @Override 103 | public String toString() { 104 | return getClass().getSimpleName() + "{" + "\n" + 105 | "\n" + 106 | "\t" + getGround() + ":" + "\n" + 107 | "\n" + 108 | "\t\t[≐,--] " + domainRestrictions + "\n" + 109 | "\t\t[--,≐] " + rangeRestrictions + "\n" + 110 | "}" + "\n"; 111 | } 112 | } 113 | 114 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/utility/dataPropertyDescriptor/HierarchicalDataPropertyDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.utility.dataPropertyDescriptor; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.DataProperties; 5 | import it.emarolab.owloop.descriptor.construction.descriptorGround.DataPropertyGround; 6 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.DataPropertyExpression; 7 | import org.semanticweb.owlapi.model.OWLDataProperty; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * This is an example of a 'compound' DataProperty Descriptor which implements 2 {@link DataPropertyExpression} interfaces: 13 | * 14 | *
    15 | *
  • {@link DataPropertyExpression.Sub}: to describe that a DataProperty is subsumes another DataProperty.
  • 16 | *
  • {@link DataPropertyExpression.Super}: to describe that a DataProperty is super-sumes another DataProperty.
  • 17 | *
18 | * 19 | * See {@link FullDataPropertyDesc} for an example of a 'compound' DataProperty Descriptor that implements all DataPropertyExpressions. 20 | * 21 | *

22 | *

23 | * File: it.emarolab.owloop.core.Axiom
24 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
25 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
26 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
27 | * date: 01/05/19
28 | *
29 | */ 30 | public class HierarchicalDataPropertyDesc 31 | extends DataPropertyGround 32 | implements DataPropertyExpression.Sub, 33 | DataPropertyExpression.Super{ 34 | 35 | private DataProperties subDataProperties = new DataProperties(); 36 | private DataProperties superDataProperties = new DataProperties(); 37 | 38 | /* Constructors from class: DataPropertyGround */ 39 | 40 | public HierarchicalDataPropertyDesc(OWLDataProperty instance, OWLReferences onto) { 41 | super(instance, onto); 42 | } 43 | public HierarchicalDataPropertyDesc(String instanceName, OWLReferences onto) { 44 | super(instanceName, onto); 45 | } 46 | public HierarchicalDataPropertyDesc(OWLDataProperty instance, String ontoName) { 47 | super(instance, ontoName); 48 | } 49 | public HierarchicalDataPropertyDesc(OWLDataProperty instance, String ontoName, String filePath, String iriPath) { 50 | super(instance, ontoName, filePath, iriPath); 51 | } 52 | public HierarchicalDataPropertyDesc(OWLDataProperty instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 53 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 54 | } 55 | public HierarchicalDataPropertyDesc(String instanceName, String ontoName) { 56 | super(instanceName, ontoName); 57 | } 58 | public HierarchicalDataPropertyDesc(String instanceName, String ontoName, String filePath, String iriPath) { 59 | super(instanceName, ontoName, filePath, iriPath); 60 | } 61 | public HierarchicalDataPropertyDesc(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 62 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 63 | } 64 | 65 | /* Overriding methods in class: DataPropertyGround */ 66 | 67 | 68 | // To read axioms from an ontology 69 | @Override 70 | public List readAxioms() { 71 | List r = DataPropertyExpression.Sub.super.readAxioms(); 72 | r.addAll( DataPropertyExpression.Super.super.readAxioms()); 73 | return r; 74 | } 75 | // To write axioms to an ontology 76 | @Override 77 | public List writeAxioms() { 78 | List r = DataPropertyExpression.Sub.super.writeAxioms(); 79 | r.addAll( DataPropertyExpression.Super.super.writeAxioms()); 80 | return r; 81 | } 82 | 83 | /* Overriding methods in classes: DataProperty and DataPropertyExpression */ 84 | 85 | 86 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 87 | @Override 88 | public HierarchicalDataPropertyDesc getNewSubDataProperty(OWLDataProperty instance, OWLReferences ontology) { 89 | return new HierarchicalDataPropertyDesc( instance, ontology); 90 | } 91 | // It returns subDataProperties from the EntitySet (after being read from the ontology) 92 | @Override 93 | public DataProperties getSubDataProperties() { 94 | return subDataProperties; 95 | } 96 | 97 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 98 | @Override 99 | public HierarchicalDataPropertyDesc getNewSuperDataProperty(OWLDataProperty instance, OWLReferences ontology) { 100 | return new HierarchicalDataPropertyDesc( instance, ontology); 101 | } 102 | // It returns superDataProperties from the EntitySet (after being read from the ontology) 103 | @Override 104 | public DataProperties getSuperDataProperties() { 105 | return superDataProperties; 106 | } 107 | 108 | /* Overriding method in class: Object */ 109 | 110 | 111 | // To show internal state of the Descriptor 112 | @Override 113 | public String toString() { 114 | return getClass().getSimpleName() + "{" + "\n" + 115 | "\n" + 116 | "\t" + getGround() + ":" + "\n" + 117 | "\n" + 118 | "\t\t⊃ " + subDataProperties + "\n" + 119 | "\t\t⊂ " + superDataProperties + "\n" + 120 | "}" + "\n"; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/utility/dataPropertyDescriptor/RestrictionDataPropertyDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.utility.dataPropertyDescriptor; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.DataProperties; 5 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.DataPropertyExpression; 6 | import it.emarolab.owloop.descriptor.construction.descriptorGround.DataPropertyGround; 7 | import org.semanticweb.owlapi.model.OWLDataProperty; 8 | 9 | import java.util.List; 10 | 11 | 12 | /** 13 | * This is an example of a 'compound' DataProperty Descriptor which implements 2 {@link DataPropertyExpression} interfaces: 14 | * 15 | *
    16 | *
  • {@link DataPropertyExpression.Equivalent}: to describe that a DataProperty is equivalent to another DataProperty.
  • 17 | *
  • {@link DataPropertyExpression.Disjoint}: to describe that a DataProperty is disjoint to another DataProperty.
  • 18 | *
19 | * 20 | * See {@link FullDataPropertyDesc} for an example of a 'compound' DataProperty Descriptor that implements all DataPropertyExpressions. 21 | * 22 | *

23 | *

24 | * File: it.emarolab.owloop.core.Axiom
25 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
26 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
27 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
28 | * date: 01/05/19
29 | *
30 | */ 31 | public class RestrictionDataPropertyDesc 32 | extends DataPropertyGround 33 | implements DataPropertyExpression.Disjoint, 34 | DataPropertyExpression.Equivalent { 35 | 36 | private DataProperties disjointDataProperties = new DataProperties(); 37 | private DataProperties equivalentDataProperties = new DataProperties(); 38 | 39 | /* Constructors from class: DataPropertyGround */ 40 | 41 | public RestrictionDataPropertyDesc(OWLDataProperty instance, OWLReferences onto) { 42 | super(instance, onto); 43 | } 44 | public RestrictionDataPropertyDesc(String instanceName, OWLReferences onto) { 45 | super(instanceName, onto); 46 | } 47 | public RestrictionDataPropertyDesc(OWLDataProperty instance, String ontoName) { 48 | super(instance, ontoName); 49 | } 50 | public RestrictionDataPropertyDesc(OWLDataProperty instance, String ontoName, String filePath, String iriPath) { 51 | super(instance, ontoName, filePath, iriPath); 52 | } 53 | public RestrictionDataPropertyDesc(OWLDataProperty instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 54 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 55 | } 56 | public RestrictionDataPropertyDesc(String instanceName, String ontoName) { 57 | super(instanceName, ontoName); 58 | } 59 | public RestrictionDataPropertyDesc(String instanceName, String ontoName, String filePath, String iriPath) { 60 | super(instanceName, ontoName, filePath, iriPath); 61 | } 62 | public RestrictionDataPropertyDesc(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 63 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 64 | } 65 | 66 | /* Overriding methods in class: DataPropertyGround */ 67 | 68 | 69 | // To read axioms from an ontology 70 | @Override 71 | public List readAxioms() { 72 | List r = DataPropertyExpression.Disjoint.super.readAxioms(); 73 | r.addAll( DataPropertyExpression.Equivalent.super.readAxioms()); 74 | return r; 75 | } 76 | // To write axioms to an ontology 77 | @Override 78 | public List writeAxioms() { 79 | List r = DataPropertyExpression.Disjoint.super.writeAxioms(); 80 | r.addAll( DataPropertyExpression.Equivalent.super.writeAxioms()); 81 | return r; 82 | } 83 | 84 | /* Overriding methods in classes: DataProperty and DataPropertyExpression */ 85 | 86 | 87 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 88 | @Override 89 | public RestrictionDataPropertyDesc getNewDisjointDataProperty(OWLDataProperty instance, OWLReferences ontology) { 90 | return new RestrictionDataPropertyDesc( instance, ontology); 91 | } 92 | // It returns disjointDataProperties from the EntitySet (after being read from the ontology) 93 | @Override 94 | public DataProperties getDisjointDataProperties() { 95 | return disjointDataProperties; 96 | } 97 | 98 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 99 | @Override 100 | public RestrictionDataPropertyDesc getNewEquivalentDataProperty(OWLDataProperty instance, OWLReferences ontology) { 101 | return new RestrictionDataPropertyDesc( instance, ontology); 102 | } 103 | // It returns equivalentDataProperties from the EntitySet (after being read from the ontology) 104 | @Override 105 | public DataProperties getEquivalentDataProperties() { 106 | return equivalentDataProperties; 107 | } 108 | 109 | /* Overriding method in class: Object */ 110 | 111 | 112 | // To show internal state of the Descriptor 113 | @Override 114 | public String toString() { 115 | return getClass().getSimpleName() + "{" + "\n" + 116 | "\n" + 117 | "\t" + getGround() + ":" + "\n" + 118 | "\n" + 119 | "\t\t≠ " + disjointDataProperties + "\n" + 120 | "\t\t≡ " + equivalentDataProperties + "\n" + 121 | "}" + "\n"; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/utility/individualDescriptor/LinkIndividualDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.utility.individualDescriptor; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.*; 5 | import it.emarolab.owloop.descriptor.construction.descriptorGround.IndividualGround; 6 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.IndividualExpression; 7 | import it.emarolab.owloop.descriptor.utility.dataPropertyDescriptor.FullDataPropertyDesc; 8 | import it.emarolab.owloop.descriptor.utility.objectPropertyDescriptor.FullObjectPropertyDesc; 9 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * This is an example of a 'compound' Individual Descriptor which implements 2 {@link IndividualExpression} interfaces: 15 | * 16 | *
    17 | *
  • {@link IndividualExpression.ObjectLink}: to describe an ObjectProperty and Individuals related via that ObjectProperty, for an Individual.
  • 18 | *
  • {@link IndividualExpression.DataLink}: to describe an DataProperty and Individuals related via that DataProperty, for an Individual.
  • 19 | *
20 | * See {@link FullIndividualDesc} for an example of a 'compound' Individual Descriptor that implements all IndividualExpressions. 21 | * 22 | *

23 | *

24 | * File: it.emarolab.owloop.core.Axiom
25 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
26 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
27 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
28 | * date: 01/05/19
29 | *
30 | */ 31 | public class LinkIndividualDesc 32 | extends IndividualGround 33 | implements IndividualExpression.ObjectLink, 34 | IndividualExpression.DataLink { 35 | 36 | private ObjectLinkSet objectLinks = new ObjectLinkSet(); 37 | private DataLinkSet dataLinks = new DataLinkSet(); 38 | 39 | /* Constructors from class: IndividualGround */ 40 | 41 | public LinkIndividualDesc(OWLNamedIndividual instance, OWLReferences onto) { 42 | super(instance, onto); 43 | } 44 | public LinkIndividualDesc(String instanceName, OWLReferences onto) { 45 | super(instanceName, onto); 46 | } 47 | public LinkIndividualDesc(OWLNamedIndividual instance, String ontoName) { 48 | super(instance, ontoName); 49 | } 50 | public LinkIndividualDesc(OWLNamedIndividual instance, String ontoName, String filePath, String iriPath) { 51 | super(instance, ontoName, filePath, iriPath); 52 | } 53 | public LinkIndividualDesc(OWLNamedIndividual instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 54 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 55 | } 56 | public LinkIndividualDesc(String instanceName, String ontoName) { 57 | super(instanceName, ontoName); 58 | } 59 | public LinkIndividualDesc(String instanceName, String ontoName, String filePath, String iriPath) { 60 | super(instanceName, ontoName, filePath, iriPath); 61 | } 62 | public LinkIndividualDesc(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 63 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 64 | } 65 | 66 | /* Overriding methods in class: IndividualGround */ 67 | 68 | 69 | // To read axioms from an ontology 70 | @Override 71 | public List readAxioms() { 72 | List r = IndividualExpression.ObjectLink.super.readAxioms(); 73 | r.addAll( IndividualExpression.DataLink.super.readAxioms()); 74 | return r; 75 | } 76 | // To write axioms to an ontology 77 | @Override 78 | public List writeAxioms() { 79 | List r = ObjectLink.super.writeAxioms(); 80 | r.addAll( DataLink.super.writeAxioms()); 81 | return r; 82 | } 83 | 84 | /* Overriding methods in classes: Individual and IndividualExpression */ 85 | 86 | 87 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 88 | @Override 89 | public FullObjectPropertyDesc getNewObjectProperty(ObjectLinks instance, OWLReferences ontology) { 90 | return new FullObjectPropertyDesc( instance.getExpression(), ontology); 91 | } 92 | // It returns objectLinks from the EntitySet (after being read from the ontology) 93 | @Override 94 | public ObjectLinkSet getObjectProperties() { 95 | return objectLinks; 96 | } 97 | 98 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 99 | @Override 100 | public FullDataPropertyDesc getNewDataProperty(DataLinks instance, OWLReferences ontology) { 101 | return new FullDataPropertyDesc( instance.getExpression(), ontology); 102 | } 103 | // It returns dataLinks from the EntitySet (after being read from the ontology) 104 | @Override 105 | public DataLinkSet getDataProperties() { 106 | return dataLinks; 107 | } 108 | 109 | /* Overriding method in class: Object */ 110 | 111 | 112 | // To show internal state of the Descriptor 113 | @Override 114 | public String toString() { 115 | return getClass().getSimpleName() + "{" + "\n" + 116 | "\n" + 117 | "\t" + getGround() + ":" + "\n" + 118 | "\n" + 119 | "\t\t⊨ " + objectLinks + "\n" + 120 | "\t\t⊢ " + dataLinks + "\n" + 121 | "}" + "\n"; 122 | } 123 | } -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/utility/individualDescriptor/RestrictionIndividualDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.utility.individualDescriptor; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Individuals; 5 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.IndividualExpression; 6 | import it.emarolab.owloop.descriptor.construction.descriptorGround.IndividualGround; 7 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 8 | 9 | import java.util.List; 10 | 11 | 12 | /** 13 | * This is an example of a 'compound' Individual Descriptor which implements 2 {@link IndividualExpression} interfaces: 14 | * 15 | *
    16 | *
  • {@link IndividualExpression.Equivalent}: to describe an Individual same-as another Individual.
  • 17 | *
  • {@link IndividualExpression.Disjoint}: to describe an Individual different from another Individual.
  • 18 | *
19 | * 20 | * See {@link FullIndividualDesc} for an example of a 'compound' Individual Descriptor that implements all IndividualExpressions. 21 | * 22 | *

23 | *

24 | * File: it.emarolab.owloop.core.Axiom
25 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
26 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
27 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
28 | * date: 01/05/19
29 | *
30 | */ 31 | public class RestrictionIndividualDesc 32 | extends IndividualGround 33 | implements IndividualExpression.Disjoint, 34 | IndividualExpression.Equivalent{ 35 | 36 | private Individuals disjointIndividuals = new Individuals(); 37 | private Individuals equivalentIndividuals = new Individuals(); 38 | 39 | /* Constructors from class: IndividualGround */ 40 | 41 | public RestrictionIndividualDesc(OWLNamedIndividual instance, OWLReferences onto) { 42 | super(instance, onto); 43 | } 44 | public RestrictionIndividualDesc(String instanceName, OWLReferences onto) { 45 | super(instanceName, onto); 46 | } 47 | public RestrictionIndividualDesc(OWLNamedIndividual instance, String ontoName) { 48 | super(instance, ontoName); 49 | } 50 | public RestrictionIndividualDesc(OWLNamedIndividual instance, String ontoName, String filePath, String iriPath) { 51 | super(instance, ontoName, filePath, iriPath); 52 | } 53 | public RestrictionIndividualDesc(OWLNamedIndividual instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 54 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 55 | } 56 | public RestrictionIndividualDesc(String instanceName, String ontoName) { 57 | super(instanceName, ontoName); 58 | } 59 | public RestrictionIndividualDesc(String instanceName, String ontoName, String filePath, String iriPath) { 60 | super(instanceName, ontoName, filePath, iriPath); 61 | } 62 | public RestrictionIndividualDesc(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 63 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 64 | } 65 | 66 | /* Overriding methods in class: IndividualGround */ 67 | 68 | 69 | // To read axioms from an ontology 70 | @Override 71 | public List readAxioms() { 72 | List r = IndividualExpression.Equivalent.super.readAxioms(); 73 | r.addAll( IndividualExpression.Disjoint.super.readAxioms()); 74 | return r; 75 | } 76 | // To write axioms to an ontology 77 | @Override 78 | public List writeAxioms() { 79 | List r = IndividualExpression.Equivalent.super.writeAxioms(); 80 | r.addAll( IndividualExpression.Disjoint.super.writeAxioms()); 81 | return r; 82 | } 83 | 84 | /* Overriding methods in classes: Individual and IndividualExpression */ 85 | 86 | 87 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 88 | @Override 89 | public RestrictionIndividualDesc getNewDisjointIndividual(OWLNamedIndividual instance, OWLReferences ontology) { 90 | return new RestrictionIndividualDesc( instance, ontology); 91 | } 92 | // It returns disjointIndividuals from the EntitySet (after being read from the ontology) 93 | @Override 94 | public Individuals getDisjointIndividuals() { 95 | return disjointIndividuals; 96 | } 97 | 98 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 99 | @Override 100 | public RestrictionIndividualDesc getNewEquivalentIndividual(OWLNamedIndividual instance, OWLReferences ontology) { 101 | return new RestrictionIndividualDesc( instance, ontology); 102 | } 103 | // It returns equivalentIndividuals from the EntitySet (after being read from the ontology) 104 | @Override 105 | public Individuals getEquivalentIndividuals() { 106 | return equivalentIndividuals; 107 | } 108 | 109 | /* Overriding method in class: Object */ 110 | 111 | 112 | // To show internal state of the Descriptor 113 | @Override 114 | public String toString() { 115 | return getClass().getSimpleName() + "{" + "\n" + 116 | "\n" + 117 | "\t" + getGround() + ":" + "\n" + 118 | "\n" + 119 | "\t\t≠ " + disjointIndividuals + "\n" + 120 | "\t\t≡ " + equivalentIndividuals + "\n" + 121 | "}" + "\n"; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/utility/individualDescriptor/TypeIndividualDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.utility.individualDescriptor; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Classes; 5 | import it.emarolab.owloop.descriptor.construction.descriptorGround.IndividualGround; 6 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.IndividualExpression; 7 | import it.emarolab.owloop.descriptor.utility.classDescriptor.HierarchicalClassDesc; 8 | import org.semanticweb.owlapi.model.OWLClass; 9 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 10 | 11 | import java.util.List; 12 | 13 | 14 | /** 15 | * This is an example of a 'simple' Individual Descriptor which implements 1 {@link IndividualExpression} interfaces: 16 | * 17 | *
    18 | *
  • {@link IndividualExpression.Type}: to describe the Type/s (i.e., class/es) of an Individual.
  • 19 | *
20 | * 21 | * See {@link FullIndividualDesc} for an example of a 'compound' Individual Descriptor that implements all IndividualExpressions. 22 | * 23 | *

24 | *

25 | * File: it.emarolab.owloop.core.Axiom
26 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
27 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
28 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
29 | * date: 01/05/19
30 | *
31 | */ 32 | public class TypeIndividualDesc 33 | extends IndividualGround 34 | implements IndividualExpression.Type{ 35 | 36 | private Classes classes = new Classes(); 37 | 38 | /* Constructors from class: IndividualGround */ 39 | 40 | public TypeIndividualDesc(OWLNamedIndividual instance, OWLReferences onto) { 41 | super(instance, onto); 42 | } 43 | public TypeIndividualDesc(String instanceName, OWLReferences onto) { 44 | super(instanceName, onto); 45 | } 46 | public TypeIndividualDesc(OWLNamedIndividual instance, String ontoName) { 47 | super(instance, ontoName); 48 | } 49 | public TypeIndividualDesc(OWLNamedIndividual instance, String ontoName, String filePath, String iriPath) { 50 | super(instance, ontoName, filePath, iriPath); 51 | } 52 | public TypeIndividualDesc(OWLNamedIndividual instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 53 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 54 | } 55 | public TypeIndividualDesc(String instanceName, String ontoName) { 56 | super(instanceName, ontoName); 57 | } 58 | public TypeIndividualDesc(String instanceName, String ontoName, String filePath, String iriPath) { 59 | super(instanceName, ontoName, filePath, iriPath); 60 | } 61 | public TypeIndividualDesc(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 62 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 63 | } 64 | 65 | /* Overriding methods in class: IndividualGround */ 66 | 67 | 68 | // To read axioms from an ontology 69 | @Override 70 | public List readAxioms() { 71 | return IndividualExpression.Type.super.readAxioms(); 72 | } 73 | // To write axioms to an ontology 74 | @Override 75 | public List writeAxioms() { 76 | return IndividualExpression.Type.super.writeAxioms(); 77 | } 78 | 79 | /* Overriding methods in classes: Individual and IndividualExpression */ 80 | 81 | 82 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 83 | @Override 84 | public HierarchicalClassDesc getNewType(OWLClass instance, OWLReferences ontology) { 85 | return new HierarchicalClassDesc( instance, ontology); 86 | } 87 | // It returns classes from the EntitySet (after being read from the ontology) 88 | @Override 89 | public Classes getTypes() { 90 | return classes; 91 | } 92 | 93 | /* Overriding method in class: Object */ 94 | 95 | 96 | // To show internal state of the Descriptor 97 | @Override 98 | public String toString() { 99 | return getClass().getSimpleName() + "{" + "\n" + 100 | "\n" + 101 | "\t" + getGround() + ":" + "\n" + 102 | "\n" + 103 | "\t\t∈ " + classes + "\n" + 104 | "}" + "\n"; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/utility/objectPropertyDescriptor/DomainRangeObjectPropertyDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.utility.objectPropertyDescriptor; 2 | 3 | 4 | import it.emarolab.amor.owlInterface.OWLReferences; 5 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Restrictions; 6 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.ObjectPropertyExpression; 7 | import it.emarolab.owloop.descriptor.construction.descriptorGround.ObjectPropertyGround; 8 | import org.semanticweb.owlapi.model.OWLObjectProperty; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * This is an example of a 'compound' ObjectProperty Descriptor which implements 2 {@link ObjectPropertyExpression} interfaces: 14 | * 15 | *
    16 | *
  • {@link ObjectPropertyExpression.Domain}: to describe the domain restrictions of an ObjectProperty.
  • 17 | *
  • {@link ObjectPropertyExpression.Range}: to describe the range restrictions of an ObjectProperty.
  • 18 | *
19 | * 20 | * See {@link FullObjectPropertyDesc} for an example of a 'compound' Individual Descriptor that implements all ObjectPropertyExpressions. 21 | * 22 | *

23 | *

24 | * File: it.emarolab.owloop.core.Axiom
25 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
26 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
27 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
28 | * date: 01/05/19
29 | *
30 | */ 31 | public class DomainRangeObjectPropertyDesc 32 | extends ObjectPropertyGround 33 | implements ObjectPropertyExpression.Domain, 34 | ObjectPropertyExpression.Range { 35 | 36 | private Restrictions domainRestrictions = new Restrictions(); 37 | private Restrictions rangeRestrictions = new Restrictions(); 38 | 39 | /* Constructors from class: ObjectPropertyGround */ 40 | 41 | public DomainRangeObjectPropertyDesc(OWLObjectProperty instance, OWLReferences onto) { 42 | super(instance, onto); 43 | } 44 | public DomainRangeObjectPropertyDesc(String instanceName, OWLReferences onto) { 45 | super(instanceName, onto); 46 | } 47 | public DomainRangeObjectPropertyDesc(OWLObjectProperty instance, String ontoName) { 48 | super(instance, ontoName); 49 | } 50 | public DomainRangeObjectPropertyDesc(OWLObjectProperty instance, String ontoName, String filePath, String iriPath) { 51 | super(instance, ontoName, filePath, iriPath); 52 | } 53 | public DomainRangeObjectPropertyDesc(OWLObjectProperty instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 54 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 55 | } 56 | public DomainRangeObjectPropertyDesc(String instanceName, String ontoName) { 57 | super(instanceName, ontoName); 58 | } 59 | public DomainRangeObjectPropertyDesc(String instanceName, String ontoName, String filePath, String iriPath) { 60 | super(instanceName, ontoName, filePath, iriPath); 61 | } 62 | public DomainRangeObjectPropertyDesc(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 63 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 64 | } 65 | 66 | /* Overriding methods in class: ObjectPropertyGround */ 67 | 68 | 69 | // To read axioms from an ontology 70 | @Override 71 | public List readAxioms() { 72 | List r = ObjectPropertyExpression.Domain.super.readAxioms(); 73 | r.addAll( ObjectPropertyExpression.Range.super.readAxioms()); 74 | return r; 75 | } 76 | // To write axioms to an ontology 77 | @Override 78 | public List writeAxioms() { 79 | List r = ObjectPropertyExpression.Domain.super.writeAxioms(); 80 | r.addAll( ObjectPropertyExpression.Range.super.writeAxioms()); 81 | return r; 82 | } 83 | 84 | /* Overriding methods in classes: ObjectProperty and ObjectPropertyExpression */ 85 | 86 | 87 | // It returns domainRestrictions from the EntitySet (after being read from the ontology) 88 | @Override 89 | public Restrictions getDomainRestrictions() { 90 | return domainRestrictions; 91 | } 92 | 93 | // It returns rangeRestrictions from the EntitySet (after being read from the ontology) 94 | @Override 95 | public Restrictions getRangeRestrictions() { 96 | 97 | return rangeRestrictions; 98 | } 99 | 100 | /* Overriding method in class: Object */ 101 | 102 | 103 | // To show internal state of the Descriptor 104 | public String toString() { 105 | return getClass().getSimpleName() + "{" + "\n" + 106 | "\n" + 107 | "\t" + getGround() + ":" + "\n" + 108 | "\n" + 109 | "\t\t[≐,--] " + domainRestrictions + "\n" + 110 | "\t\t[--,≐] " + rangeRestrictions + "\n" + 111 | "}" + "\n"; 112 | } 113 | } 114 | 115 | -------------------------------------------------------------------------------- /src/main/java/it/emarolab/owloop/descriptor/utility/objectPropertyDescriptor/HierarchicalObjectPropertyDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.descriptor.utility.objectPropertyDescriptor; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.ObjectProperties; 5 | import it.emarolab.owloop.descriptor.construction.descriptorGround.ObjectPropertyGround; 6 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.ObjectPropertyExpression; 7 | import org.semanticweb.owlapi.model.OWLObjectProperty; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * This is an example of a 'compound' ObjectProperty Descriptor which implements 2 {@link ObjectPropertyExpression} interfaces: 13 | * 14 | *
    15 | *
  • {@link ObjectPropertyExpression.Sub}: to describe that an ObjectProperty subsumes another ObjectProperty.
  • 16 | *
  • {@link ObjectPropertyExpression.Super}: to describe that an ObjectProperty super-sumes another ObjectProperty.
  • 17 | *
18 | * 19 | * See {@link FullObjectPropertyDesc} for an example of a 'compound' Individual Descriptor that implements all ObjectPropertyExpressions. 20 | * 21 | *

22 | *

23 | * File: it.emarolab.owloop.core.Axiom
24 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
25 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
26 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
27 | * date: 01/05/19
28 | *
29 | */ 30 | public class HierarchicalObjectPropertyDesc 31 | extends ObjectPropertyGround 32 | implements ObjectPropertyExpression.Sub, 33 | ObjectPropertyExpression.Super{ 34 | 35 | private ObjectProperties subObjectProperties = new ObjectProperties(); 36 | private ObjectProperties superObjectProperties = new ObjectProperties(); 37 | 38 | /* Constructors from class: ObjectPropertyGround */ 39 | 40 | public HierarchicalObjectPropertyDesc(OWLObjectProperty instance, OWLReferences onto) { 41 | super(instance, onto); 42 | } 43 | public HierarchicalObjectPropertyDesc(String instanceName, OWLReferences onto) { 44 | super(instanceName, onto); 45 | } 46 | public HierarchicalObjectPropertyDesc(OWLObjectProperty instance, String ontoName) { 47 | super(instance, ontoName); 48 | } 49 | public HierarchicalObjectPropertyDesc(OWLObjectProperty instance, String ontoName, String filePath, String iriPath) { 50 | super(instance, ontoName, filePath, iriPath); 51 | } 52 | public HierarchicalObjectPropertyDesc(OWLObjectProperty instance, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 53 | super(instance, ontoName, filePath, iriPath, bufferingChanges); 54 | } 55 | public HierarchicalObjectPropertyDesc(String instanceName, String ontoName) { 56 | super(instanceName, ontoName); 57 | } 58 | public HierarchicalObjectPropertyDesc(String instanceName, String ontoName, String filePath, String iriPath) { 59 | super(instanceName, ontoName, filePath, iriPath); 60 | } 61 | public HierarchicalObjectPropertyDesc(String instanceName, String ontoName, String filePath, String iriPath, boolean bufferingChanges) { 62 | super(instanceName, ontoName, filePath, iriPath, bufferingChanges); 63 | } 64 | 65 | /* Overriding methods in class: ObjectPropertyGround */ 66 | 67 | 68 | // To read axioms from an ontology 69 | @Override 70 | public List readAxioms() { 71 | List r = ObjectPropertyExpression.Sub.super.readAxioms(); 72 | r.addAll( ObjectPropertyExpression.Super.super.readAxioms()); 73 | return r; 74 | } 75 | // To write axioms to an ontology 76 | @Override 77 | public List writeAxioms() { 78 | List r = ObjectPropertyExpression.Sub.super.writeAxioms(); 79 | r.addAll( ObjectPropertyExpression.Super.super.writeAxioms()); 80 | return r; 81 | } 82 | 83 | /* Overriding methods in classes: ObjectProperty and ObjectPropertyExpression */ 84 | 85 | 86 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 87 | @Override 88 | public HierarchicalObjectPropertyDesc getNewSubObjectProperty(OWLObjectProperty instance, OWLReferences ontology) { 89 | return new HierarchicalObjectPropertyDesc( instance, ontology); 90 | } 91 | // It returns subObjectProperties from the EntitySet (after being read from the ontology) 92 | @Override 93 | public ObjectProperties getSubObjectProperties() { 94 | return subObjectProperties; 95 | } 96 | 97 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 98 | @Override 99 | public HierarchicalObjectPropertyDesc getNewSuperObjectProperty(OWLObjectProperty instance, OWLReferences ontology) { 100 | return new HierarchicalObjectPropertyDesc( instance, ontology); 101 | } 102 | // It returns superObjectProperties from the EntitySet (after being read from the ontology) 103 | @Override 104 | public ObjectProperties getSuperObjectProperties() { 105 | return superObjectProperties; 106 | } 107 | 108 | /* Overriding method in class: Object */ 109 | 110 | 111 | // To show internal state of the Descriptor 112 | public String toString() { 113 | return getClass().getSimpleName() + "{" + "\n" + 114 | "\n" + 115 | "\t" + getGround() + ":" + "\n" + 116 | "\n" + 117 | "\t\t⊃ " + subObjectProperties + "\n" + 118 | "\t\t⊂ " + superObjectProperties + "\n" + 119 | "}" + "\n"; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/drugOrderExample/drugOrder.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.drugOrderExample; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.core.Axiom.Descriptor.OntologyReference; 5 | import it.emarolab.owloop.descriptor.utility.individualDescriptor.FullIndividualDesc; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | import org.semanticweb.owlapi.model.OWLLiteral; 9 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 10 | 11 | /** 12 | * This example is taken from Owlready paper: https://www.archives-ouvertes.fr/hal-01592746/document 13 | * To compare difference in the number of lines of code written with OWL-API and OWLOOP-API 14 | * 15 | *

16 | *

17 | * File: it.emarolab.owloop.core.Axiom
18 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
19 | * Authors: Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
20 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
21 | * date: 08/09/19
22 | *
23 | */ 24 | public class drugOrder { 25 | 26 | OWLReferences ontoRef; 27 | 28 | @Before 29 | public void beforeTest() { 30 | 31 | // Disables printing of amor logs 32 | OntologyReference.activateAMORlogging( false); 33 | 34 | // To create a new ontologyReference. The ontology file need not be pre-existing. 35 | ontoRef = OntologyReference.newOWLReferenceFromFileWithPellet( 36 | "drugOntology", // ontology reference name 37 | "src/test/resources/drug.owl", // the ontology file path 38 | "http://www.semanticweb.org/yusha/ontologies/2019/drug", // the ontology IRI path 39 | true // if (true) you must synchronize the reasoner manually. Else, it synchronizes itself. 40 | ); 41 | } 42 | 43 | @Test 44 | public void orderDrugs() { 45 | 46 | final int[] total_cost = {0}; 47 | FullIndividualDesc order_indivDesc = new FullIndividualDesc("order", ontoRef); 48 | order_indivDesc.readAxioms(); 49 | Iterable drugs_indivSet = order_indivDesc.getIndividualsFromObjectProperty("hasDrug"); 50 | drugs_indivSet.forEach(drug_indiv -> { 51 | FullIndividualDesc drug_indivDesc = new FullIndividualDesc(drug_indiv, ontoRef); 52 | drug_indivDesc.readAxioms(); 53 | OWLLiteral value = drug_indivDesc.getLiteralFromDataProperty("hasPrice"); 54 | total_cost[0] += value.parseInteger(); 55 | }); 56 | System.out.println(total_cost[0]); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/example1/addAxioms.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.example1; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.articleExamples.exampleDescriptors.CorridorClassDesc; 5 | import it.emarolab.owloop.articleExamples.exampleDescriptors.LocationClassDesc; 6 | import it.emarolab.owloop.articleExamples.exampleDescriptors.RoomClassDesc; 7 | import it.emarolab.owloop.core.Axiom.Descriptor.*; 8 | import it.emarolab.owloop.descriptor.utility.classDescriptor.RestrictionClassDesc; 9 | import it.emarolab.owloop.descriptor.utility.individualDescriptor.FullIndividualDesc; 10 | import it.emarolab.owloop.descriptor.utility.individualDescriptor.LinkIndividualDesc; 11 | import it.emarolab.owloop.descriptor.utility.objectPropertyDescriptor.DomainRangeObjectPropertyDesc; 12 | 13 | /** 14 | * An example to illustrate how to add axioms to an ontology. 15 | * 16 | *

17 | *

18 | * File: it.emarolab.owloop.core.Axiom
19 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
20 | * Authors: Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
21 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
22 | * date: 08/09/19
23 | *
24 | */ 25 | public class addAxioms { 26 | 27 | public static void main(String[] args) { 28 | 29 | // TODO [Aesthetic] Change OWLReferences to OWLReference in AMOR 30 | OWLReferences ontoRef; 31 | 32 | // Disable printing of amor logs 33 | OntologyReference.activateAMORlogging(false); 34 | 35 | // TODO [Aesthetic] Change newOWLReferences...() to newOWLReference...() in AMOR 36 | // Create reference to a new ontology file associated with the Pellet reasoner 37 | ontoRef = OntologyReference.newOWLReferencesCreatedWithPellet( 38 | "robotAtHomeOnto", //ontology reference name. 39 | "src/test/resources/robotAtHomeOntology.owl", //file path. 40 | "http://www.semanticweb.org/emaroLab/robotAtHomeOntology", //IRI. 41 | true //synchronize the reasoner manually. 42 | ); 43 | 44 | // Add Class Expression Axioms to the ontology 45 | LocationClassDesc locationClass_Desc = new LocationClassDesc(ontoRef); 46 | CorridorClassDesc corridorClass_Desc = new CorridorClassDesc(ontoRef); 47 | RoomClassDesc roomClass_Desc = new RoomClassDesc(ontoRef); 48 | 49 | // Add Individual Expression Axioms (i.e., Assertions) to the ontology 50 | LinkIndividualDesc corridorIndividual_Desc = new LinkIndividualDesc("Corridor1", ontoRef); 51 | corridorIndividual_Desc.addObject("isLinkedTo", "Room1"); 52 | corridorIndividual_Desc.addObject("isLinkedTo", "Room2"); 53 | corridorIndividual_Desc.writeAxiomsReasonReadAxioms(); 54 | 55 | LinkIndividualDesc robotIndividual_Desc = new LinkIndividualDesc( "Robot1", ontoRef); 56 | robotIndividual_Desc.addObject("isIn", getRobotLocation()); 57 | robotIndividual_Desc.writeAxiomsReasonReadAxioms(); 58 | 59 | LinkIndividualDesc roomIndividual_Desc = new LinkIndividualDesc("Room1", ontoRef); 60 | roomIndividual_Desc.addData("hasTemperature", 25); 61 | roomIndividual_Desc.writeAxioms(); 62 | 63 | // Add ObjectProperty Expression Axioms to the Ontology 64 | DomainRangeObjectPropertyDesc isLinkedTo_Desc = new DomainRangeObjectPropertyDesc( "isLinkedTo", ontoRef); 65 | isLinkedTo_Desc.addDomainClassRestriction( "CORRIDOR"); 66 | isLinkedTo_Desc.addRangeClassRestriction( "ROOM"); 67 | isLinkedTo_Desc.writeAxiomsReasonReadAxioms(); 68 | 69 | DomainRangeObjectPropertyDesc isIn_Desc = new DomainRangeObjectPropertyDesc( "isIn", ontoRef); 70 | isIn_Desc.addDomainClassRestriction( "ROBOT"); 71 | isIn_Desc.addRangeClassRestriction( "LOCATION"); 72 | isIn_Desc.writeAxiomsReasonReadAxioms(); 73 | 74 | // Add some more details into the ontology 75 | // ROBOT concept disjoint with DOOR and LOCATION concepts 76 | RestrictionClassDesc robotClass_Desc = new RestrictionClassDesc( "ROBOT", ontoRef); 77 | robotClass_Desc.addDisjointClass( "LOCATION"); 78 | robotClass_Desc.addDisjointClass( "DOOR"); 79 | robotClass_Desc.writeAxiomsReasonReadAxioms(); 80 | 81 | // Save the in-memory ontology to a .owl file in file-path provided during instantiation of ontoRef 82 | ontoRef.saveOntology(); 83 | 84 | // Check implicit knowledge 85 | FullIndividualDesc corridorIndividual_FullDesc = new FullIndividualDesc("Corridor1", ontoRef); 86 | corridorIndividual_FullDesc.readAxioms(); 87 | System.out.println(corridorIndividual_FullDesc); 88 | } 89 | 90 | private static String getRobotLocation() { 91 | 92 | // ... Consider that this method does some computation 93 | // ... and returns the location of the robot at home 94 | return "Corridor1"; 95 | } 96 | } 97 | 98 | // TODO [Make developer's life easy] We can find-out whether something is wrong in the program by checking amorLOG for [[!!! ERROR !!!]] -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/example2/useDescriptorBuildMethod.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.example2; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.amor.owlInterface.SemanticRestriction; 5 | import it.emarolab.owloop.articleExamples.exampleDescriptors.DefSubClassDesc; 6 | import it.emarolab.owloop.articleExamples.exampleDescriptors.TypeIndividualDesc; 7 | import it.emarolab.owloop.core.Axiom.Descriptor.*; 8 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Restrictions; 9 | import it.emarolab.owloop.descriptor.utility.individualDescriptor.LinkIndividualDesc; 10 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 11 | import java.util.Set; 12 | 13 | /** 14 | * An example to illustrate how to 'build()' method of a descriptor. 15 | * 16 | *

17 | *

18 | * File: it.emarolab.owloop.core.Axiom
19 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
20 | * Authors: Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
21 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
22 | * date: 08/09/19
23 | *
24 | */ 25 | public class useDescriptorBuildMethod { 26 | 27 | public static void main(String[] args) { 28 | 29 | OWLReferences ontoRef; 30 | 31 | // Disables printing of amor logs 32 | OntologyReference.activateAMORlogging(false); 33 | 34 | // Create reference to an existing ontology file associated with the Pellet reasoner 35 | ontoRef = OntologyReference.newOWLReferenceFromFileWithPellet( 36 | "robotAtHomeOnto", //ontology reference name. 37 | "src/test/resources/robotAtHomeOntology.owl", //file path. 38 | "http://www.semanticweb.org/emaroLab/robotAtHomeOntology", //IRI. 39 | true //synchronize the reasoner manually. 40 | ); 41 | 42 | LinkIndividualDesc robotIndividual_Desc = new LinkIndividualDesc("Robot1", ontoRef); 43 | // To read knowledge (only) specific to the property "isIn" 44 | robotIndividual_Desc.addObject("isIn", true); 45 | robotIndividual_Desc.readAxioms(); 46 | // Print 47 | System.out.println(robotIndividual_Desc); 48 | // Get knowledge from internal state of the Descriptor 49 | OWLNamedIndividual robotLocation = robotIndividual_Desc.getIndividualFromObjectProperty("isIn"); 50 | 51 | // robotLocation = "Corridor1" 52 | TypeIndividualDesc locationIndividual_Desc = new TypeIndividualDesc(robotLocation, ontoRef); 53 | locationIndividual_Desc.readAxioms(); 54 | // Print 55 | System.out.println(locationIndividual_Desc); 56 | 57 | // Descriptor.buildTypes() gets the Type/s (i.e., Class/s) of the Individual "Corridor1" as a set of grounded Descriptors 58 | Set setOfClass_Descs = locationIndividual_Desc.buildTypes(); 59 | 60 | for(DefSubClassDesc locationClass_Desc : setOfClass_Descs) { 61 | 62 | // Descriptor.buildSubClasses() gets the subClass/s of a Class as a set of grounded Descriptors 63 | Set setOfSubClass_Descs = locationClass_Desc.buildSubClasses(); 64 | // Find the root Class (It has max. 1 subClass, i.e., owl:Nothing) 65 | if(setOfSubClass_Descs.size() == 1) { 66 | 67 | System.out.println("'" + locationClass_Desc.getGroundInstanceName() + "' is the root Class among: "); 68 | for(DefSubClassDesc ClassType : setOfClass_Descs) { 69 | 70 | System.out.println("\t\t\t'" + ClassType.getGroundInstanceName() + "'"); 71 | } 72 | System.out.print("\nTherefore '" + locationIndividual_Desc.getGroundInstanceName() + "'" + " is of Type " + "'" + locationClass_Desc.getGroundInstanceName() + "' \n"); 73 | Restrictions restrictions = locationClass_Desc.getEquivalentRestrictions(); 74 | for(SemanticRestriction rest : restrictions) { 75 | 76 | if(rest instanceof SemanticRestriction.ClassRestrictedOnExactObject) { 77 | 78 | System.out.println("\n" + "'" + locationClass_Desc.getGroundInstanceName() + "'" + " is defined with Exact Cardinality EquivalentRestriction " + "'" + rest + "'"); 79 | } 80 | else if(rest instanceof SemanticRestriction.ClassRestrictedOnMinObject) { 81 | 82 | System.out.println("\n" + "'" + locationClass_Desc.getGroundInstanceName() + "'" + " is defined with Min Cardinality EquivalentRestriction " + "'" + rest + "'"); 83 | } 84 | } 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/example3/RemoveAxioms.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.example3; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.core.Axiom.Descriptor.*; 5 | import it.emarolab.owloop.descriptor.utility.individualDescriptor.LinkIndividualDesc; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | 9 | /** 10 | * An example to illustrate how to remove axioms from an ontology. 11 | * 12 | *

13 | *

14 | * File: it.emarolab.owloop.core.Axiom
15 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
16 | * Authors: Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
17 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
18 | * date: 08/09/19
19 | *
20 | */ 21 | public class RemoveAxioms { 22 | 23 | public static void main(String[] args) { 24 | OWLReferences ontoRef; 25 | 26 | // Disables printing of amor logs 27 | OntologyReference.activateAMORlogging(false); 28 | 29 | // Create reference to an existing ontology file associated with the Pellet reasoner 30 | ontoRef = OntologyReference.newOWLReferenceFromFileWithPellet( 31 | "robotAtHomeOnto", //ontology reference name. 32 | "src/test/resources/robotAtHomeOntology.owl", //file path. 33 | "http://www.semanticweb.org/emaroLab/robotAtHomeOntology", //IRI. 34 | true //synchronize the reasoner manually. 35 | ); 36 | 37 | LinkIndividualDesc robot_Desc1 = new LinkIndividualDesc( "Robot1", ontoRef); 38 | robot_Desc1.readAxioms(); 39 | System.out.println(robot_Desc1); // Print 40 | // Remove the association between the ground-individual and entity-set-individuals, associated via object-property "isIn". (in the descriptor's internal state) 41 | robot_Desc1.removeObject("isIn"); 42 | // Synchronize knowledge between descriptor's internal state and the ontology 43 | robot_Desc1.writeAxiomsReasonReadAxioms(); 44 | System.out.println(robot_Desc1); // Print 45 | // Save the in-memory ontology to a .owl file in a specific file-path 46 | ontoRef.saveOntology(ontoRef.getFilePath()); 47 | } 48 | } -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/exampleDescriptors/CorridorClassDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.exampleDescriptors; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.amor.owlInterface.SemanticRestriction; 5 | 6 | /** 7 | *

8 | * Extends LocationClassDesc. 9 | *

10 | * Adds some-restriction on the concept "CORRIDOR", i.e, CORRIDOR hasDoor some DOOR. 11 | * Furthermore, adds min-cardinality-restriction, i.e., CORRIDOR hasDoor min 2 DOOR. 12 | * 13 | *

14 | *

15 | * File: it.emarolab.owloop.core.Axiom
16 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
17 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
18 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
19 | * date: 01/05/19
20 | *
21 | */ 22 | 23 | public class CorridorClassDesc 24 | extends LocationClassDesc { 25 | 26 | public CorridorClassDesc(OWLReferences onto) { 27 | 28 | super("CORRIDOR", onto); 29 | } 30 | 31 | // overriding with a MinCardinality-restriction 32 | @Override 33 | protected SemanticRestriction.ClassRestrictedOnMinObject getRestriction(){ 34 | SemanticRestriction.ClassRestrictedOnMinObject definition = new SemanticRestriction.ClassRestrictedOnMinObject(); 35 | definition.setCardinality( 2); 36 | return definition; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/exampleDescriptors/DefClassDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.exampleDescriptors; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.amor.owlInterface.SemanticRestriction; 5 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Restrictions; 6 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.ClassExpression; 7 | import it.emarolab.owloop.descriptor.construction.descriptorGround.ClassGround; 8 | import it.emarolab.owloop.descriptor.utility.classDescriptor.FullClassDesc; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * A 'simple' Class Descriptor that implements 1 ClassExpression (aka {@link ClassExpression}) interface: 14 | *
    15 | *
  • {@link EquivalentRestriction}: to describe the definition of a Class..
  • 16 | *
17 | * 18 | * See {@link FullClassDesc} for an example of a 'compound' Class Descriptor that implements all ClassExpressions (aka {@link ClassExpression}). 19 | * 20 | *

21 | *

22 | * File: it.emarolab.owloop.core.Axiom
23 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
24 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
25 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
26 | * date: 01/05/19
27 | *
28 | */ 29 | public abstract class DefClassDesc 30 | extends ClassGround 31 | implements ClassExpression.EquivalentRestriction { 32 | 33 | private Restrictions restrictions = new Restrictions(); 34 | 35 | /* Constructors from class: ClassGround */ 36 | 37 | DefClassDesc(String instanceName, OWLReferences onto) { 38 | super(instanceName, onto); // grounds the Class having a 'name', with respect to an 'onto' 39 | } 40 | 41 | /* Overriding methods in class: ClassGround */ 42 | 43 | 44 | // To read axioms from an ontology 45 | @Override 46 | public List readAxioms() { 47 | List r = EquivalentRestriction.super.readAxioms(); // call this before Sub or Super !!! 48 | return r; 49 | } 50 | // To write axioms to an ontology 51 | @Override 52 | public List writeAxioms() { 53 | List r = EquivalentRestriction.super.writeAxioms(); // call this before Sub or Super !!! 54 | return r; 55 | } 56 | 57 | // To get a restriction to be added to the definition 58 | abstract protected SemanticRestriction.ApplyingPropertyRestriction getRestriction(); 59 | 60 | /* Overriding methods in classes: Class and ClassExpression */ 61 | 62 | 63 | // It returns restrictions from the EntitySet (after being read from the ontology) 64 | @Override 65 | public Restrictions getEquivalentRestrictions() { 66 | return restrictions; 67 | } 68 | 69 | // To show internal state of the Descriptor 70 | @Override 71 | public String toString() { 72 | return getClass().getSimpleName() + "{" + "\n" + 73 | "\n" + 74 | "\t" + getGround() + ":" + "\n" + 75 | "\n" + 76 | "\t\t≐ " + restrictions + "\n" + 77 | "}" + "\n"; 78 | } 79 | } -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/exampleDescriptors/DefSubClassDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.exampleDescriptors; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Classes; 5 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Restrictions; 6 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.ClassExpression; 7 | import it.emarolab.owloop.descriptor.construction.descriptorGround.ClassGround; 8 | import it.emarolab.owloop.descriptor.utility.classDescriptor.FullClassDesc; 9 | import org.semanticweb.owlapi.model.OWLClass; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * This is an example of a 'compound' Class Descriptor which implements 2 {@link ClassExpression} interfaces: 15 | *
    16 | *
  • {@link EquivalentRestriction}: to describe the definition of a Class..
  • 17 | *
  • {@link ClassExpression.Sub}: to describe that a Class subsumes another Class.
  • 18 | *
19 | *

20 | * Doing build() with this Descriptor returns the descriptor of type {@link DefSubClassDesc}. 21 | *

22 | * See {@link FullClassDesc} for an example of a 'compound' Class Descriptor that implements all ConceptExpressions. 23 | * 24 | *

25 | *

26 | * File: it.emarolab.owloop.core.Axiom
27 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
28 | * Authors: Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it), Buoncompagni Luca (luca.buoncompagni@edu.unige.it)
29 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
30 | * date: 01/05/19
31 | *
32 | */ 33 | public class DefSubClassDesc 34 | extends ClassGround 35 | implements ClassExpression.EquivalentRestriction, 36 | ClassExpression.Sub{ 37 | 38 | private Restrictions restrictions = new Restrictions(); 39 | private Classes subClasses = new Classes(); 40 | 41 | // constructors for ClassGround 42 | public DefSubClassDesc(OWLClass instance, OWLReferences onto) { 43 | super(instance, onto); 44 | } 45 | 46 | // implementations for Axiom.descriptor 47 | @Override 48 | public List readAxioms() { 49 | List r = EquivalentRestriction.super.readAxioms(); // call this before Sub or Super !!! 50 | r.addAll( Sub.super.readAxioms()); 51 | return r; 52 | } 53 | 54 | @Override 55 | public List writeAxioms() { 56 | List r = Sub.super.writeAxioms(); 57 | r.addAll( EquivalentRestriction.super.writeAxioms()); // call this before Sub or Super !!! 58 | return r; 59 | } 60 | 61 | // implementations for ClassExpression.Definition 62 | @Override 63 | public Restrictions getEquivalentRestrictions() { 64 | return restrictions; 65 | } 66 | 67 | // you cannot build Definition (based on Restrictions) 68 | 69 | 70 | // implementations for ClassExpression.Super 71 | @Override // called during build...() you can change the returning type to any implementations of ClassExpression 72 | public DefSubClassDesc getSubClassDescriptor(OWLClass instance, OWLReferences ontology) { 73 | return new DefSubClassDesc( instance, ontology); 74 | } 75 | 76 | @Override 77 | public Classes getSubClasses() { 78 | return subClasses; 79 | } 80 | 81 | 82 | // To show internal state of the Descriptor 83 | @Override 84 | public String toString() { 85 | return getClass().getSimpleName() + "{" + "\n" + 86 | "\n" + 87 | "\t" + getGround() + ":" + "\n" + 88 | "\n" + 89 | "\t\t≐ " + restrictions + "\n" + 90 | "\t\t⊃ " + subClasses + "\n" + 91 | "}" + "\n"; 92 | } 93 | } -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/exampleDescriptors/LocationClassDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.exampleDescriptors; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.amor.owlInterface.SemanticRestriction; 5 | 6 | /** 7 | *

8 | * Extends DefClassDesc. 9 | *

10 | * Adds some-restriction on the concept "LOCATION", i.e, LOCATION hasDoor some DOOR 11 | * 12 | *

13 | *

14 | * File: it.emarolab.owloop.core.Axiom
15 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
16 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
17 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
18 | * date: 01/05/19
19 | *
20 | */ 21 | public class LocationClassDesc 22 | extends DefClassDesc { 23 | 24 | public LocationClassDesc(OWLReferences onto) { 25 | 26 | super("LOCATION", onto); 27 | addEquivalentRestriction( getRestriction()); // adds definition with a restriction 28 | } 29 | LocationClassDesc(String instanceName, OWLReferences onto) { 30 | 31 | super(instanceName, onto); 32 | addEquivalentRestriction( new SemanticRestriction.ClassRestrictedOnAllObject()); // adding with Some-restriction 33 | addEquivalentRestriction( getRestriction()); // adds definition with a restriction 34 | } 35 | 36 | // To make the warning go away, add the types explicitly: 37 | private void addEquivalentRestriction(SemanticRestriction.ApplyingPropertyRestriction ClassRestrictedOnAllObject){ 38 | ClassRestrictedOnAllObject.setSubject( getGround().getGroundInstance()); 39 | ClassRestrictedOnAllObject.setProperty( getOWLObjectProperty( "hasDoor")); 40 | ClassRestrictedOnAllObject.setValue( getOWLClass( "DOOR")); 41 | getEquivalentRestrictions().add( ClassRestrictedOnAllObject); 42 | writeAxioms(); 43 | } 44 | 45 | // implementing with a Some-restriction 46 | @Override 47 | protected SemanticRestriction.ApplyingPropertyRestriction getRestriction(){ 48 | return new SemanticRestriction.ClassRestrictedOnAllObject(); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/exampleDescriptors/ObjectLinkIndividualDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.exampleDescriptors; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.ObjectLinkSet; 5 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.ObjectLinks; 6 | import it.emarolab.owloop.descriptor.utility.individualDescriptor.FullIndividualDesc; 7 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.IndividualExpression; 8 | import it.emarolab.owloop.descriptor.construction.descriptorGround.IndividualGround; 9 | import it.emarolab.owloop.descriptor.utility.objectPropertyDescriptor.FullObjectPropertyDesc; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * A 'simple' Individual Descriptor which implements 1 {@link IndividualExpression} interface: 15 | *
    16 | *
  • {@link IndividualExpression.ObjectLink}: to describe an ObjectProperty and Individuals related via that ObjectProperty, for an Individual.
  • 17 | *
18 | *

19 | * Doing build() with this Descriptor returns another descriptor of type {@link FullObjectPropertyDesc}. 20 | *

21 | * See {@link FullIndividualDesc} for an example of a 'compound' Individual Descriptor that implements all IndividualExpressions. 22 | * 23 | *

24 | *

25 | * File: it.emarolab.owloop.core.Axiom
26 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
27 | * Authors: Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it), Buoncompagni Luca (luca.buoncompagni@edu.unige.it)
28 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
29 | * date: 01/05/19
30 | *
31 | */ 32 | public class ObjectLinkIndividualDesc 33 | extends IndividualGround 34 | implements IndividualExpression.ObjectLink { 35 | 36 | private ObjectLinkSet objectLinks = new ObjectLinkSet(); 37 | 38 | /* Constructors from class: IndividualGround */ 39 | 40 | public ObjectLinkIndividualDesc(String instanceName, OWLReferences onto) { 41 | super(instanceName, onto); 42 | } 43 | 44 | /* Overriding methods in class: IndividualGround */ 45 | 46 | 47 | // To read axioms from an ontology 48 | @Override 49 | public List readAxioms() { 50 | List r = ObjectLink.super.readAxioms(); 51 | return r; 52 | } 53 | // To write axioms to an ontology 54 | @Override 55 | public List writeAxioms() { 56 | List r = ObjectLink.super.writeAxioms(); 57 | return r; 58 | } 59 | 60 | /* Overriding methods in classes: Individual and IndividualExpression */ 61 | 62 | 63 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 64 | @Override 65 | public FullObjectPropertyDesc getNewObjectProperty(ObjectLinks instance, OWLReferences ontology) { 66 | return new FullObjectPropertyDesc( instance.getExpression(), ontology); 67 | } 68 | // It returns objectLinks from the EntitySet (after being read from the ontology) 69 | @Override 70 | public ObjectLinkSet getObjectProperties() { 71 | return objectLinks; 72 | } 73 | 74 | /* Overriding method in class: Object */ 75 | 76 | 77 | // To show internal state of the Descriptor 78 | @Override 79 | public String toString() { 80 | return getClass().getSimpleName() + "{" + "\n" + 81 | "\n" + 82 | "\t" + getGround() + ":" + "\n" + 83 | "\n" + 84 | "\t\t⊨ " + objectLinks + "\n" + 85 | "}" + "\n"; 86 | } 87 | } -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/exampleDescriptors/RoomClassDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.exampleDescriptors; 2 | 3 | import it.emarolab.amor.owlInterface.OWLReferences; 4 | import it.emarolab.amor.owlInterface.SemanticRestriction; 5 | 6 | /** 7 | *

8 | * Extends LocationClassDesc. 9 | *

10 | * Adds some-restriction on the concept "ROOM", i.e, ROOM hasDoor some DOOR. 11 | * Furthermore, adds max-cardinality-restriction, i.e., ROOM hasDoor max 1 DOOR. 12 | * 13 | *

14 | *

15 | * File: it.emarolab.owloop.core.Axiom
16 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
17 | * Authors: Buoncompagni Luca (luca.buoncompagni@edu.unige.it), Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it)
18 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
19 | * date: 01/05/19
20 | *
21 | */ 22 | public class RoomClassDesc 23 | extends LocationClassDesc { 24 | 25 | public RoomClassDesc(OWLReferences onto) { 26 | 27 | super("ROOM", onto); 28 | } 29 | 30 | // overriding with a MaxCardinality-restriction 31 | @Override 32 | protected SemanticRestriction.ApplyingPropertyRestriction getRestriction(){ 33 | SemanticRestriction.ClassRestrictedOnMaxObject definition = new SemanticRestriction.ClassRestrictedOnMaxObject(); 34 | definition.setCardinality( 1); 35 | return definition; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/it/emarolab/owloop/articleExamples/exampleDescriptors/TypeIndividualDesc.java: -------------------------------------------------------------------------------- 1 | package it.emarolab.owloop.articleExamples.exampleDescriptors; 2 | 3 | 4 | import it.emarolab.amor.owlInterface.OWLReferences; 5 | import it.emarolab.owloop.descriptor.construction.descriptorEntitySet.Classes; 6 | import it.emarolab.owloop.descriptor.utility.individualDescriptor.FullIndividualDesc; 7 | import it.emarolab.owloop.descriptor.construction.descriptorGround.IndividualGround; 8 | import it.emarolab.owloop.descriptor.construction.descriptorExpression.IndividualExpression; 9 | import org.semanticweb.owlapi.model.OWLClass; 10 | import org.semanticweb.owlapi.model.OWLNamedIndividual; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * A 'simple' Individual Descriptor which implements 1 {@link IndividualExpression} interfaces: 16 | *
    17 | *
  • {@link IndividualExpression.Type}: to describe the Type/s (i.e., class/es) of an Individual.
  • 18 | *
19 | *

20 | * Doing build() with this Descriptor returns another descriptor of type {@link DefSubClassDesc}. 21 | *

22 | * 23 | * See {@link FullIndividualDesc} for an example of a 'compound' Individual Descriptor that implements all IndividualExpressions. 24 | * 25 | *

26 | *

27 | * File: it.emarolab.owloop.core.Axiom
28 | * Licence: GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007
29 | * Authors: Syed Yusha Kareem (kareem.syed.yusha@dibris.unige.it), Buoncompagni Luca (luca.buoncompagni@edu.unige.it)
30 | * affiliation: EMAROLab, DIBRIS, University of Genoa.
31 | * date: 01/05/19
32 | *
33 | */ 34 | public class TypeIndividualDesc 35 | extends IndividualGround 36 | implements IndividualExpression.Type { 37 | 38 | private Classes classes = new Classes(); 39 | 40 | /* Constructors from class: IndividualGround */ 41 | 42 | public TypeIndividualDesc(OWLNamedIndividual instance, OWLReferences onto) { 43 | super(instance, onto); 44 | } 45 | 46 | /* Overriding methods in class: IndividualGround */ 47 | 48 | 49 | // To read axioms from an ontology 50 | @Override 51 | public List readAxioms() { 52 | List r = Type.super.readAxioms(); 53 | return r; 54 | } 55 | // To write axioms to an ontology 56 | @Override 57 | public List writeAxioms() { 58 | List r = Type.super.writeAxioms(); 59 | return r; 60 | } 61 | 62 | /* Overriding methods in classes: Individual and IndividualExpression */ 63 | 64 | 65 | // Is used by the descriptors's build() method. It's possible to change the return type based on need. 66 | @Override 67 | public DefSubClassDesc getNewType(OWLClass instance, OWLReferences ontology) { 68 | return new DefSubClassDesc( instance, ontology); 69 | } 70 | // It returns classes from the EntitySet (after being read from the ontology) 71 | @Override 72 | public Classes getTypes() { 73 | return classes; 74 | } 75 | 76 | /* Overriding method in class: Object */ 77 | 78 | 79 | // To show internal state of the Descriptor 80 | @Override 81 | public String toString() { 82 | return getClass().getSimpleName() + "{" + "\n" + 83 | "\n" + 84 | "\t" + getGround() + ":" + "\n" + 85 | "\n" + 86 | "\t\t∈ " + classes + "\n" + 87 | "}" + "\n"; 88 | } 89 | } -------------------------------------------------------------------------------- /src/test/resources/debug/robotHomeTesting.owl: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/test/resources/drug.owl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 2 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 5 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 3 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | --------------------------------------------------------------------------------