- Layer0 L0 = Layer0.getInstance(g);
- if(possibleType != null) {
- if(g.hasStatement(possibleType, L0.Enumeration)) {
- if(!g.isInstanceOf(object, possibleType)) {
- Map<String, Resource> enumMap = g.syncRequest(new EnumerationMap(possibleType));
- String firstKey = Collections.min(enumMap.keySet(), AlphanumComparator.COMPARATOR);
- Resource defaultValue = enumMap.get(firstKey);
-
- if (defaultValue != null) {
- Resource assertion = findAssertionWithPO(g, type, relation, object);
- if(assertion != null) {
- g.deny(assertion, L0.HasObject);
- g.claim(assertion, L0.HasObject, defaultValue);
- return;
- } else {
- Layer0Utils.assert_(g, type, relation, defaultValue);
- return;
- }
- }
- }
- }
- }
-