Codota Logo
VariableNullability
Code IndexAdd Codota to your IDE (free)

How to use
VariableNullability
in
it.unibz.inf.ontop.iq.node

Best Java code snippets using it.unibz.inf.ontop.iq.node.VariableNullability (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: ontop/ontop

private static void checkNullableVariables(IQ query) throws NullableVariableInMappingException {
  VariableNullability variableNullability = query.getTree().getVariableNullability();
  if (!variableNullability.getNullableGroups().isEmpty())
    throw new NullableVariableInMappingException(query, variableNullability.getNullableGroups());
}
origin: ontop/ontop

private VariableNullability updateVariableNullability(
    ImmutableSubstitution<ImmutableTerm> nonNestedSubstitution, VariableNullability childNullability) {
  // TODO: find a better name
  ImmutableMap<Variable, Variable> nullabilityBindings = nonNestedSubstitution.getImmutableMap().entrySet().stream()
      .flatMap(e -> evaluateTermNullability(e.getValue(), childNullability, e.getKey())
          .map(Stream::of)
          .orElseGet(Stream::empty))
      .collect(ImmutableCollectors.toMap());
  return childNullability.appendNewVariables(nullabilityBindings);
}
origin: ontop/ontop

private boolean areInterdependent(Variable v1, Variable v2,
                 ImmutableMap<Variable, ImmutableSet<Variable>> preselectedGroupMap,
                 ImmutableSet<VariableNullability> variableNullabilities) {
  return preselectedGroupMap.get(v2).contains(v1)
      && variableNullabilities.stream()
      .allMatch(vn -> {
        boolean v1Nullable = vn.isPossiblyNullable(v1);
        boolean v2Nullable = vn.isPossiblyNullable(v2);
        return (v1Nullable && v2Nullable) || ((!v1Nullable) && (!v2Nullable));
      });
}
origin: ontop/ontop

    .map(c -> updateWithFilter(c, rightChild.getVariableNullability().getNullableGroups()))
    .orElseGet(rightChild::getVariableNullability);
    .immutableCopy();
ImmutableSet<ImmutableSet<Variable>> rightSelectedGroups = rightNullability.getNullableGroups().stream()
    .map(g -> g.stream()
        .filter(rightSpecificVariables::contains)
    .filter(v -> !rightNullability.isPossiblyNullable(v))
    .collect(ImmutableCollectors.toSet());
    leftChild.getVariableNullability().getNullableGroups().stream(),
    rightGroupStream)
    .collect(ImmutableCollectors.toSet());
origin: ontop/ontop

private static void checkNullableVariables(IQ query) throws NullableVariableInMappingException {
  VariableNullability variableNullability = query.getTree().getVariableNullability();
  if (!variableNullability.getNullableGroups().isEmpty())
    throw new NullableVariableInMappingException(query, variableNullability.getNullableGroups());
}
origin: ontop/ontop

  /**
   * TODO: IMPLEMENT IT SERIOUSLY
   */
  @Override
  public FunctionalTermNullability evaluateNullability(ImmutableList<? extends NonFunctionalTerm> arguments,
                             VariableNullability childNullability) {
    boolean isNullable = arguments.stream()
        .filter(a -> a instanceof Variable)
        .anyMatch(a -> childNullability.isPossiblyNullable((Variable) a));
    return new FunctionalTermNullabilityImpl(isNullable);
  }
}
origin: ontop/ontop

@Override
public VariableNullability getVariableNullability(ImmutableList<IQTree> children) {
  ImmutableMap<Variable, Collection<IQTree>> variableProvenanceMap = children.stream()
      .flatMap(c -> c.getVariables().stream()
          .map(v -> Maps.immutableEntry(v, c)))
      .collect(ImmutableCollectors.toMultimap())
      .asMap();
  ImmutableSet<Variable> coOccuringVariables = variableProvenanceMap.entrySet().stream()
      .filter(e -> e.getValue().size() > 1)
      .map(Map.Entry::getKey)
      .collect(ImmutableCollectors.toSet());
  ImmutableSet<ImmutableSet<Variable>> nullableGroups = children.stream()
      .flatMap(c -> c.getVariableNullability().getNullableGroups().stream())
      .filter(g -> g.stream()
          .noneMatch(coOccuringVariables::contains))
      .collect(ImmutableCollectors.toSet());
  return getOptionalFilterCondition()
      .map(e -> updateWithFilter(e, nullableGroups))
      .orElseGet(() -> new VariableNullabilityImpl(nullableGroups));
}
origin: ontop/ontop

  /**
   * TODO: REMOVEĀ IT (TEMPORARY)
   */
  @Override
  public FunctionalTermNullability evaluateNullability(ImmutableList<? extends NonFunctionalTerm> arguments,
                             VariableNullability childNullability) {
    // TODO: implement it seriously
    boolean isNullable = arguments.stream()
        .filter(a -> a instanceof Variable)
        .anyMatch(a -> childNullability.isPossiblyNullable((Variable) a));
    return new FunctionalTermNullabilityImpl(isNullable);
  }
}
origin: ontop/ontop

@Override
public VariableNullability getVariableNullability(IQTree child) {
  return updateWithFilter(getFilterCondition(), child.getVariableNullability().getNullableGroups());
}
origin: ontop/ontop

.filter(v -> !rightVariableNullability.isPossiblyNullable(v))
.findFirst();
origin: ontop/ontop

@Override
public VariableNullability getVariableNullability(ImmutableList<IQTree> children) {
  ImmutableSet<VariableNullability> variableNullabilities = children.stream()
      .map(IQTree::getVariableNullability)
      .collect(ImmutableCollectors.toSet());
  ImmutableMultimap<Variable, ImmutableSet<Variable>> multimap = variableNullabilities.stream()
      .flatMap(vn -> vn.getNullableGroups().stream())
      .flatMap(g -> g.stream()
          .map(v -> Maps.immutableEntry(v, g)))
      .collect(ImmutableCollectors.toMultimap());
  ImmutableMap<Variable, ImmutableSet<Variable>> preselectedGroupMap = multimap.asMap().entrySet().stream()
      .collect(ImmutableCollectors.toMap(
          Map.Entry::getKey,
          e -> intersect(e.getValue())));
  ImmutableSet<ImmutableSet<Variable>> nullableGroups = preselectedGroupMap.keySet().stream()
      .map(v -> computeNullableGroup(v, preselectedGroupMap, variableNullabilities))
      .collect(ImmutableCollectors.toSet());
  return new VariableNullabilityImpl(nullableGroups);
}
origin: ontop/ontop

@Override
public IQ transform(IQ originalQuery) {
  IQTree tree = originalQuery.getTree();
  ImmutableSet<ImmutableSet<Variable>> nullableGroups = tree.getVariableNullability().getNullableGroups();
  return nullableGroups.isEmpty() ?
      originalQuery :
      insertFilter(originalQuery, nullableGroups);
}
origin: ontop/ontop

@Override
public VariableNullability getVariableNullability(IQTree child) {
  VariableNullability childNullability = child.getVariableNullability();
  VariableGenerator variableGenerator = coreUtilsFactory.createVariableGenerator(
      Sets.union(projectedVariables, child.getVariables()).immutableCopy());
  /*
   * The substitutions are split by nesting level
   */
  VariableNullability nullabilityBeforeProjectingOut = splitSubstitution(substitution, variableGenerator)
      .reduce(childNullability,
          (n, s) -> updateVariableNullability(s, n),
          (n1, n2) -> {
            throw new MinorOntopInternalBugException("vns are not expected to be combined");
          });
  /*
   * Projects away irrelevant variables
   */
  ImmutableSet<ImmutableSet<Variable>> nullableGroups = nullabilityBeforeProjectingOut.getNullableGroups().stream()
      .map(g -> g.stream()
          .filter(projectedVariables::contains)
          .collect(ImmutableCollectors.toSet()))
      .filter(g -> !g.isEmpty())
      .collect(ImmutableCollectors.toSet());
  return new VariableNullabilityImpl(nullableGroups);
}
it.unibz.inf.ontop.iq.nodeVariableNullability

Javadoc

TODO: find a better name IMMUTABLE

Most used methods

  • getNullableGroups
    All the variables of a group are always null at the same time (guaranteed).
  • appendNewVariables
    Creates a new (immutable) VariableNullability For each entry (k,v) where k is a novel variable, - if
  • isPossiblyNullable

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JOptionPane (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now