コード例 #1
0
 public static List<AttributeRef> extractRequestedAttributes(Dependency dependency) {
   List<AttributeRef> result = new ArrayList<AttributeRef>();
   result.addAll(dependency.getQueriedAttributes());
   for (AttributeRef attributeRef : dependency.getAdditionalAttributes()) {
     if (!result.contains(attributeRef)) {
       result.add(attributeRef);
     }
   }
   return result;
 }
コード例 #2
0
 public static List<AttributeRef> extractRequestedAttributesWithExistential(
     Dependency dependency) {
   List<AttributeRef> result = new ArrayList<AttributeRef>();
   result.addAll(dependency.getQueriedAttributes());
   for (FormulaVariable variable : dependency.getConclusion().getLocalVariables()) {
     if (variable.getConclusionRelationalOccurrences().size() == 1) {
       continue;
     }
     for (FormulaVariableOccurrence occurrence : variable.getConclusionRelationalOccurrences()) {
       if (logger.isTraceEnabled()) logger.trace("Inspecting occurrence: " + occurrence);
       AttributeRef attribute = occurrence.getAttributeRef();
       AttributeRef unaliasedAttribute = ChaseUtility.unAlias(attribute);
       LunaticUtility.addIfNotContained(result, unaliasedAttribute);
     }
   }
   for (AttributeRef attributeRef : dependency.getAdditionalAttributes()) {
     if (!result.contains(attributeRef)) {
       result.add(attributeRef);
     }
   }
   return result;
 }