/
BooleanDBTermType.java
51 lines (40 loc) · 1.29 KB
/
BooleanDBTermType.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package it.unibz.inf.ontop.model.type.impl;
import it.unibz.inf.ontop.model.type.DBTermType;
import it.unibz.inf.ontop.model.type.RDFDatatype;
import it.unibz.inf.ontop.model.type.TermTypeAncestry;
import java.util.Optional;
public class BooleanDBTermType extends DBTermTypeImpl implements DBTermType {
private final RDFDatatype xsdBooleanDatatype;
public BooleanDBTermType(String booleanStr, TermTypeAncestry ancestry, RDFDatatype xsdBooleanDatatype) {
super(booleanStr, ancestry, false);
this.xsdBooleanDatatype = xsdBooleanDatatype;
}
@Override
public Category getCategory() {
return Category.BOOLEAN;
}
@Override
public Optional<RDFDatatype> getNaturalRDFDatatype() {
return Optional.of(xsdBooleanDatatype);
}
@Override
public boolean isNeedingIRISafeEncoding() {
return false;
}
/**
* Constants often can have different values (true, false, 0, 1).
* TODO: double-check
*/
@Override
public boolean areEqualitiesStrict() {
return false;
}
@Override
public Optional<Boolean> areEqualitiesStrict(DBTermType otherType) {
return Optional.of(false);
}
@Override
public boolean areEqualitiesBetweenTwoDBAttributesStrict() {
return true;
}
}