Skip to content

Commit

Permalink
Use interfaces of GCI axioms
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Mendez committed Dec 27, 2015
1 parent 05ff637 commit 9913e87
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
import java.util.Set;

import de.tudresden.inf.lat.jcel.coreontology.axiom.FunctObjectPropAxiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI0AxiomImpl;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI1AxiomImpl;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI2AxiomImpl;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI3AxiomImpl;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI0Axiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI1Axiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI2Axiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI3Axiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.NominalAxiomImpl;
import de.tudresden.inf.lat.jcel.coreontology.axiom.NormalizedIntegerAxiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.NormalizedIntegerAxiomVisitor;
Expand Down Expand Up @@ -243,14 +243,14 @@ public Boolean visit(FunctObjectPropAxiom axiom) {
}

@Override
public Boolean visit(GCI0AxiomImpl axiom) {
public Boolean visit(GCI0Axiom axiom) {
Objects.requireNonNull(axiom);
addClassEntry(axiom.getSubClass(), new ImplicationEntry(new HashSet<>(), axiom.getSuperClass()));
return true;
}

@Override
public Boolean visit(GCI1AxiomImpl axiom) {
public Boolean visit(GCI1Axiom axiom) {
Objects.requireNonNull(axiom);
Integer superClass = axiom.getSuperClass();
List<Integer> operandSet = new ArrayList<>();
Expand All @@ -266,15 +266,15 @@ public Boolean visit(GCI1AxiomImpl axiom) {
}

@Override
public Boolean visit(GCI2AxiomImpl axiom) {
public Boolean visit(GCI2Axiom axiom) {
Objects.requireNonNull(axiom);
addClassEntry(axiom.getSubClass(),
new ExistentialEntry(axiom.getPropertyInSuperClass(), axiom.getClassInSuperClass()));
return true;
}

@Override
public Boolean visit(GCI3AxiomImpl axiom) {
public Boolean visit(GCI3Axiom axiom) {
Objects.requireNonNull(axiom);
ExtensionEntry entry = new ImplicationEntry(new HashSet<>(), axiom.getSuperClass());
Integer propertyId = axiom.getPropertyInSubClass();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
import java.util.TreeSet;

import de.tudresden.inf.lat.jcel.coreontology.axiom.FunctObjectPropAxiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI0AxiomImpl;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI1AxiomImpl;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI2AxiomImpl;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI3AxiomImpl;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI0Axiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI1Axiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI2Axiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.GCI3Axiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.NominalAxiomImpl;
import de.tudresden.inf.lat.jcel.coreontology.axiom.NormalizedIntegerAxiom;
import de.tudresden.inf.lat.jcel.coreontology.axiom.NormalizedIntegerAxiomVisitor;
Expand Down Expand Up @@ -156,30 +156,30 @@ public Boolean visit(FunctObjectPropAxiom axiom) {
}

@Override
public Boolean visit(GCI0AxiomImpl axiom) {
public Boolean visit(GCI0Axiom axiom) {
classesOnTheLeft.add(axiom.getSubClass());
classesOnTheRight.add(axiom.getSuperClass());
return true;
}

@Override
public Boolean visit(GCI1AxiomImpl axiom) {
public Boolean visit(GCI1Axiom axiom) {
classesOnTheLeft.add(axiom.getLeftSubClass());
classesOnTheLeft.add(axiom.getRightSubClass());
classesOnTheRight.add(axiom.getSuperClass());
return true;
}

@Override
public Boolean visit(GCI2AxiomImpl axiom) {
public Boolean visit(GCI2Axiom axiom) {
classesOnTheLeft.add(axiom.getSubClass());
objectPropertiesOnTheRight.add(axiom.getPropertyInSuperClass());
classesOnTheRight.add(axiom.getClassInSuperClass());
return true;
}

@Override
public Boolean visit(GCI3AxiomImpl axiom) {
public Boolean visit(GCI3Axiom axiom) {
objectPropertiesOnTheLeft.add(axiom.getPropertyInSubClass());
classesOnTheLeft.add(axiom.getClassInSubClass());
classesOnTheRight.add(axiom.getSuperClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public interface ExtendedOntology {
* @return the set of all axioms GCI0 in the ontology such that the given
* class occurs in the left part of the axiom
*/
Set<GCI0AxiomImpl> getGCI0Axioms(int classId);
Set<GCI0Axiom> getGCI0Axioms(int classId);

/**
* Returns the set of all axioms GCI1 in the ontology such that the given
Expand All @@ -113,7 +113,7 @@ public interface ExtendedOntology {
* @return the set of all axioms GCI1 in the ontology such that the given
* class occurs in the left part of the axiom
*/
Set<GCI1AxiomImpl> getGCI1Axioms(int classId);
Set<GCI1Axiom> getGCI1Axioms(int classId);

/**
* Returns the set of all axioms GCI2 in the ontology such that the given
Expand All @@ -125,7 +125,7 @@ public interface ExtendedOntology {
* @return the set of all axioms GCI2 in the ontology such that the given
* class occurs in the left part of the axiom
*/
Set<GCI2AxiomImpl> getGCI2Axioms(int classId);
Set<GCI2Axiom> getGCI2Axioms(int classId);

/**
* Returns the set of all axioms GCI3 in the ontology such that the given
Expand All @@ -137,7 +137,7 @@ public interface ExtendedOntology {
* @return the set of all axioms GCI3 in the ontology such that the given
* class occurs in the left part of the axiom
*/
Set<GCI3AxiomImpl> getGCI3AAxioms(int classId);
Set<GCI3Axiom> getGCI3AAxioms(int classId);

/**
* Returns the set of all axioms GCI3 in the ontology such that the given
Expand All @@ -153,7 +153,7 @@ public interface ExtendedOntology {
* object property and the given class occur in the left part of the
* axiom
*/
Set<GCI3AxiomImpl> getGCI3rAAxioms(int objectPropertyId, int leftClassId);
Set<GCI3Axiom> getGCI3rAAxioms(int objectPropertyId, int leftClassId);

/**
* Returns the set of all axioms GCI3 in the ontology such that the given
Expand All @@ -165,7 +165,7 @@ public interface ExtendedOntology {
* @return the set of all axioms GCI3 in the ontology such that the given
* object property occurs in the axiom
*/
Set<GCI3AxiomImpl> getGCI3rAxioms(int objectPropertyId);
Set<GCI3Axiom> getGCI3rAxioms(int objectPropertyId);

/**
* Returns the set of all object properties in the ontology.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
*/
public class ExtendedOntologyImpl implements ExtendedOntology, NormalizedIntegerAxiomVisitor<Boolean> {

private final Map<Integer, Set<GCI0AxiomImpl>> mapOfGCI0 = new HashMap<>();
private final Map<Integer, Set<GCI1AxiomImpl>> mapOfGCI1 = new HashMap<>();
private final Map<Integer, Set<GCI2AxiomImpl>> mapOfGCI2 = new HashMap<>();
private final Map<Integer, Set<GCI3AxiomImpl>> mapOfGCI3A = new HashMap<>();
private final Map<Integer, Set<GCI3AxiomImpl>> mapOfGCI3r = new HashMap<>();
private final Map<Integer, Map<Integer, Set<GCI3AxiomImpl>>> mapOfGCI3rA = new HashMap<>();
private final Map<Integer, Set<GCI0Axiom>> mapOfGCI0 = new HashMap<>();
private final Map<Integer, Set<GCI1Axiom>> mapOfGCI1 = new HashMap<>();
private final Map<Integer, Set<GCI2Axiom>> mapOfGCI2 = new HashMap<>();
private final Map<Integer, Set<GCI3Axiom>> mapOfGCI3A = new HashMap<>();
private final Map<Integer, Set<GCI3Axiom>> mapOfGCI3r = new HashMap<>();
private final Map<Integer, Map<Integer, Set<GCI3Axiom>>> mapOfGCI3rA = new HashMap<>();
private final Map<Integer, Set<NominalAxiomImpl>> mapOfNominalAxiom = new HashMap<>();
private final Map<Integer, Set<RangeAxiomImpl>> mapOfRangeAxiom = new HashMap<>();
private final Map<Integer, Set<RI2AxiomImpl>> mapOfRI2r = new HashMap<>();
Expand Down Expand Up @@ -94,28 +94,28 @@ private void addEntities(NormalizedIntegerAxiom axiom) {
this.setOfClasses.addAll(axiom.getClassesInSignature());
}

private void addGCI0Axiom(int classId, GCI0AxiomImpl axiom) {
private void addGCI0Axiom(int classId, GCI0Axiom axiom) {
if (Objects.isNull(this.mapOfGCI0.get(classId))) {
this.mapOfGCI0.put(classId, new HashSet<>());
}
this.mapOfGCI0.get(classId).add(axiom);
}

private void addGCI1Axiom(int classId, GCI1AxiomImpl axiom) {
private void addGCI1Axiom(int classId, GCI1Axiom axiom) {
if (Objects.isNull(this.mapOfGCI1.get(classId))) {
this.mapOfGCI1.put(classId, new HashSet<>());
}
this.mapOfGCI1.get(classId).add(axiom);
}

private void addGCI2Axiom(int classId, GCI2AxiomImpl axiom) {
private void addGCI2Axiom(int classId, GCI2Axiom axiom) {
if (Objects.isNull(this.mapOfGCI2.get(classId))) {
this.mapOfGCI2.put(classId, new HashSet<>());
}
this.mapOfGCI2.get(classId).add(axiom);
}

private void addGCI3Axiom(GCI3AxiomImpl axiom, int objectPropertyId, int classId) {
private void addGCI3Axiom(GCI3Axiom axiom, int objectPropertyId, int classId) {

if (Objects.isNull(this.mapOfGCI3r.get(objectPropertyId))) {
this.mapOfGCI3r.put(objectPropertyId, new HashSet<>());
Expand All @@ -127,7 +127,7 @@ private void addGCI3Axiom(GCI3AxiomImpl axiom, int objectPropertyId, int classId
}
this.mapOfGCI3A.get(classId).add(axiom);

Map<Integer, Set<GCI3AxiomImpl>> map = this.mapOfGCI3rA.get(objectPropertyId);
Map<Integer, Set<GCI3Axiom>> map = this.mapOfGCI3rA.get(objectPropertyId);
if (Objects.isNull(map)) {
map = new HashMap<>();
this.mapOfGCI3rA.put(objectPropertyId, map);
Expand Down Expand Up @@ -198,45 +198,45 @@ public Set<Integer> getFunctionalObjectProperties() {
}

@Override
public Set<GCI0AxiomImpl> getGCI0Axioms(int classId) {
Set<GCI0AxiomImpl> ret = this.mapOfGCI0.get(classId);
public Set<GCI0Axiom> getGCI0Axioms(int classId) {
Set<GCI0Axiom> ret = this.mapOfGCI0.get(classId);
if (Objects.isNull(ret)) {
ret = Collections.emptySet();
}
return Collections.unmodifiableSet(ret);
}

@Override
public Set<GCI1AxiomImpl> getGCI1Axioms(int classId) {
Set<GCI1AxiomImpl> ret = this.mapOfGCI1.get(classId);
public Set<GCI1Axiom> getGCI1Axioms(int classId) {
Set<GCI1Axiom> ret = this.mapOfGCI1.get(classId);
if (Objects.isNull(ret)) {
ret = Collections.emptySet();
}
return Collections.unmodifiableSet(ret);
}

@Override
public Set<GCI2AxiomImpl> getGCI2Axioms(int classId) {
Set<GCI2AxiomImpl> ret = this.mapOfGCI2.get(classId);
public Set<GCI2Axiom> getGCI2Axioms(int classId) {
Set<GCI2Axiom> ret = this.mapOfGCI2.get(classId);
if (Objects.isNull(ret)) {
ret = Collections.emptySet();
}
return Collections.unmodifiableSet(ret);
}

@Override
public Set<GCI3AxiomImpl> getGCI3AAxioms(int classId) {
Set<GCI3AxiomImpl> ret = this.mapOfGCI3A.get(classId);
public Set<GCI3Axiom> getGCI3AAxioms(int classId) {
Set<GCI3Axiom> ret = this.mapOfGCI3A.get(classId);
if (Objects.isNull(ret)) {
ret = Collections.emptySet();
}
return Collections.unmodifiableSet(ret);
}

@Override
public Set<GCI3AxiomImpl> getGCI3rAAxioms(int objectPropertyId, int leftClassId) {
Set<GCI3AxiomImpl> ret = null;
Map<Integer, Set<GCI3AxiomImpl>> map = this.mapOfGCI3rA.get(objectPropertyId);
public Set<GCI3Axiom> getGCI3rAAxioms(int objectPropertyId, int leftClassId) {
Set<GCI3Axiom> ret = null;
Map<Integer, Set<GCI3Axiom>> map = this.mapOfGCI3rA.get(objectPropertyId);
if (!Objects.isNull(map)) {
ret = map.get(leftClassId);
}
Expand All @@ -247,8 +247,8 @@ public Set<GCI3AxiomImpl> getGCI3rAAxioms(int objectPropertyId, int leftClassId)
}

@Override
public Set<GCI3AxiomImpl> getGCI3rAxioms(int objectPropertyId) {
Set<GCI3AxiomImpl> ret = this.mapOfGCI3r.get(objectPropertyId);
public Set<GCI3Axiom> getGCI3rAxioms(int objectPropertyId) {
Set<GCI3Axiom> ret = this.mapOfGCI3r.get(objectPropertyId);
if (Objects.isNull(ret)) {
ret = Collections.emptySet();
}
Expand Down Expand Up @@ -339,29 +339,29 @@ public Boolean visit(FunctObjectPropAxiom axiom) {
}

@Override
public Boolean visit(GCI0AxiomImpl axiom) {
public Boolean visit(GCI0Axiom axiom) {
Objects.requireNonNull(axiom);
addGCI0Axiom(axiom.getSubClass(), axiom);
return true;
}

@Override
public Boolean visit(GCI1AxiomImpl axiom) {
public Boolean visit(GCI1Axiom axiom) {
Objects.requireNonNull(axiom);
addGCI1Axiom(axiom.getLeftSubClass(), axiom);
addGCI1Axiom(axiom.getRightSubClass(), axiom);
return true;
}

@Override
public Boolean visit(GCI2AxiomImpl axiom) {
public Boolean visit(GCI2Axiom axiom) {
Objects.requireNonNull(axiom);
addGCI2Axiom(axiom.getSubClass(), axiom);
return true;
}

@Override
public Boolean visit(GCI3AxiomImpl axiom) {
public Boolean visit(GCI3Axiom axiom) {
Objects.requireNonNull(axiom);
addGCI3Axiom(axiom, axiom.getPropertyInSubClass(), axiom.getClassInSubClass());
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public <T> T accept(NormalizedIntegerAxiomVisitor<T> visitor) {
@Override
public boolean equals(Object obj) {
boolean ret = (this == obj);
if (!ret && (obj instanceof GCI0AxiomImpl)) {
GCI0AxiomImpl other = (GCI0AxiomImpl) obj;
ret = (this.subClass == other.subClass) && (this.superClass == other.superClass)
&& this.annotations.equals(other.annotations);
if (!ret && (obj instanceof GCI0Axiom)) {
GCI0Axiom other = (GCI0Axiom) obj;
ret = (getSubClass() == other.getSubClass()) && (getSuperClass() == other.getSuperClass())
&& getAnnotations().equals(other.getAnnotations());
}
return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public <T> T accept(NormalizedIntegerAxiomVisitor<T> visitor) {
@Override
public boolean equals(Object obj) {
boolean ret = (this == obj);
if (!ret && (obj instanceof GCI1AxiomImpl)) {
GCI1AxiomImpl other = (GCI1AxiomImpl) obj;
ret = (this.leftSubClass == other.leftSubClass) && (this.rightSubClass == other.rightSubClass)
&& (this.superClass == other.superClass) && this.annotations.equals(other.annotations);
if (!ret && (obj instanceof GCI1Axiom)) {
GCI1Axiom other = (GCI1Axiom) obj;
ret = (getLeftSubClass() == other.getLeftSubClass()) && (getRightSubClass() == other.getRightSubClass())
&& (getSuperClass() == other.getSuperClass()) && getAnnotations().equals(other.getAnnotations());
}
return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ public <T> T accept(NormalizedIntegerAxiomVisitor<T> visitor) {
@Override
public boolean equals(Object obj) {
boolean ret = (this == obj);
if (!ret && (obj instanceof GCI2AxiomImpl)) {
GCI2AxiomImpl other = (GCI2AxiomImpl) obj;
ret = (this.subClass == other.subClass) && (this.classInSuperClass == other.classInSuperClass)
&& (this.propertyInSuperClass == other.propertyInSuperClass)
&& this.annotations.equals(other.annotations);
if (!ret && (obj instanceof GCI2Axiom)) {
GCI2Axiom other = (GCI2Axiom) obj;
ret = (getSubClass() == other.getSubClass()) && (getClassInSuperClass() == other.getClassInSuperClass())
&& (getPropertyInSuperClass() == other.getPropertyInSuperClass())
&& getAnnotations().equals(other.getAnnotations());
}
return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ public <T> T accept(NormalizedIntegerAxiomVisitor<T> visitor) {
@Override
public boolean equals(Object obj) {
boolean ret = (this == obj);
if (!ret && (obj instanceof GCI3AxiomImpl)) {
GCI3AxiomImpl other = (GCI3AxiomImpl) obj;
ret = (this.classInSubClass == other.classInSubClass)
&& (this.propertyInSubClass == other.propertyInSubClass) && (this.superClass == other.superClass)
&& this.annotations.equals(other.annotations);
if (!ret && (obj instanceof GCI3Axiom)) {
GCI3Axiom other = (GCI3Axiom) obj;
ret = (getClassInSubClass() == other.getClassInSubClass())
&& (getPropertyInSubClass() == other.getPropertyInSubClass())
&& (getSuperClass() == other.getSuperClass()) && getAnnotations().equals(other.getAnnotations());
}
return ret;
}
Expand Down
Loading

0 comments on commit 9913e87

Please sign in to comment.