congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
UniqueConstraint.getAttributes
Code IndexAdd Tabnine to your IDE (free)

How to use
getAttributes
method
in
it.unibz.inf.ontop.dbschema.UniqueConstraint

Best Java code snippets using it.unibz.inf.ontop.dbschema.UniqueConstraint.getAttributes (Showing top 12 results out of 315)

origin: ontop/ontop

/**
 * adds a unique constraint (a primary key or a unique constraint proper)
 *
 * @param uc
 */

public void addUniqueConstraint(UniqueConstraint uc) {
  if (uc.isPrimaryKey()) {
    if (pk != null)
      throw new IllegalArgumentException("Duplicate PK " + pk + " " + uc);
    pk = uc;
  }
  else {
    if (pk != null)
      if (uc.getAttributes().equals(pk.getAttributes()))
        // ignore the unique index created for the primary key
        return;
  }
  ucs.add(uc);
}

origin: it.unibz.inf.ontop/ontop-model

/**
 * adds a unique constraint (a primary key or a unique constraint proper)
 *
 * @param uc
 */

public void addUniqueConstraint(UniqueConstraint uc) {
  if (uc.isPrimaryKey()) {
    if (pk != null)
      throw new IllegalArgumentException("Duplicate PK " + pk + " " + uc);
    pk = uc;
  }
  else {
    if (pk != null)
      if (uc.getAttributes().equals(pk.getAttributes()))
        // ignore the unique index created for the primary key
        return;
  }
  ucs.add(uc);
}

origin: it.unibz.inf.ontop/ontop-optimization

private boolean isUcMatching(UniqueConstraint uniqueConstraint,
               ImmutableList<? extends VariableOrGroundTerm> leftArguments,
               ImmutableList<? extends VariableOrGroundTerm> rightArguments) {
  return uniqueConstraint.getAttributes().stream()
      .allMatch(a -> leftArguments.get(a.getIndex() -1)
          .equals(rightArguments.get(a.getIndex() - 1))
          // Excludes nullable attributes for the moment. TODO: reconsider it
          && !a.canNull());
}
origin: ontop/ontop

private Stream<Map.Entry<RelationPredicate, ImmutableList<Integer>>> extractUniqueConstraintsFromRelation(
    DatabaseRelationDefinition relation) {
  return relation.getUniqueConstraints().stream()
      .map(uc -> uc.getAttributes().stream()
          .map(Attribute::getIndex)
          .collect(ImmutableCollectors.toList()))
      .map(positions -> new AbstractMap.SimpleEntry<>(relation.getAtomPredicate(), positions));
}
origin: it.unibz.inf.ontop/ontop-model

private Stream<Map.Entry<AtomPredicate, ImmutableList<Integer>>> extractUniqueConstraintsFromRelation(
    DatabaseRelationDefinition relation, Map<Predicate, AtomPredicate> predicateCache) {
  Predicate originalPredicate = Relation2Predicate.createPredicateFromRelation(relation);
  AtomPredicate atomPredicate = convertToAtomPredicate(originalPredicate, predicateCache);
  return relation.getUniqueConstraints().stream()
      .map(uc -> uc.getAttributes().stream()
          .map(Attribute::getIndex)
          .collect(ImmutableCollectors.toList()))
      .map(positions -> new AbstractMap.SimpleEntry<>(atomPredicate, positions));
}
origin: ontop/ontop

private boolean isUcMatching(UniqueConstraint uniqueConstraint,
               ImmutableList<? extends VariableOrGroundTerm> leftArguments,
               ImmutableList<? extends VariableOrGroundTerm> rightArguments) {
  return uniqueConstraint.getAttributes().stream()
      .allMatch(a -> leftArguments.get(a.getIndex() -1)
          .equals(rightArguments.get(a.getIndex() - 1))
          // Excludes nullable attributes for the moment. TODO: reconsider it
          && !a.canNull());
}
origin: it.unibz.inf.ontop/ontop-mapping-sql-owlapi

private static List<Attribute> getIdentifyingAttributes(DatabaseRelationDefinition table) {
  UniqueConstraint pk = table.getPrimaryKey();
  if (pk != null)
    return pk.getAttributes();
  else
    return table.getAttributes();
}

origin: ontop/ontop

private static List<Attribute> getIdentifyingAttributes(DatabaseRelationDefinition table) {
  UniqueConstraint pk = table.getPrimaryKey();
  if (pk != null)
    return pk.getAttributes();
  else
    return table.getAttributes();
}

origin: ontop/ontop

private ImmutableSet<Integer> extractNonMatchedRightAttributeIndexes(ImmutableCollection<UniqueConstraint> matchedUCs,
                                   ImmutableCollection<ForeignKeyConstraint> matchedFKs,
                                   int arity) {
  return IntStream.range(0, arity)
      .filter(i -> (matchedUCs.stream()
          .noneMatch(uc ->
              uc.getAttributes().stream()
                  .anyMatch(a -> a.getIndex() == (i + 1)))))
      .filter(i -> (matchedFKs.stream()
          .noneMatch(fk ->
              fk.getComponents().stream()
                  .anyMatch(c -> c.getReference().getIndex() == (i + 1)))))
      .boxed()
      .collect(ImmutableCollectors.toSet());
}
origin: it.unibz.inf.ontop/ontop-optimization

private ImmutableSet<Integer> extractNonMatchedRightAttributeIndexes(ImmutableCollection<UniqueConstraint> matchedUCs,
                                   ImmutableCollection<ForeignKeyConstraint> matchedFKs,
                                   int arity) {
  return IntStream.range(0, arity)
      .filter(i -> (matchedUCs.stream()
          .noneMatch(uc ->
              uc.getAttributes().stream()
                  .anyMatch(a -> a.getIndex() == (i + 1)))))
      .filter(i -> (matchedFKs.stream()
          .noneMatch(fk ->
              fk.getComponents().stream()
                  .anyMatch(c -> c.getReference().getIndex() == (i + 1)))))
      .boxed()
      .collect(ImmutableCollectors.toSet());
}
origin: ontop/ontop

List<ImmutableTerm> terms = new ArrayList<>(pk.getAttributes().size() + 1);
List<String> attributes = new ArrayList<>(pk.getAttributes().size());
for (Attribute att : pk.getAttributes()) 
  attributes.add(R2RMLIRISafeEncoder.encode(att.getID().getName()) + "={}");
terms.add(termFactory.getConstantLiteral(template));
for (Attribute att : pk.getAttributes())
  terms.add(termFactory.getVariable(varNamePrefix + att.getID().getName()));
origin: it.unibz.inf.ontop/ontop-mapping-sql-owlapi

List<ImmutableTerm> terms = new ArrayList<>(pk.getAttributes().size() + 1);
List<String> attributes = new ArrayList<>(pk.getAttributes().size());
for (Attribute att : pk.getAttributes()) 
  attributes.add(R2RMLIRISafeEncoder.encode(att.getID().getName()) + "={}");
terms.add(df.getConstantLiteral(template));
for (Attribute att : pk.getAttributes())
  terms.add(df.getVariable(varNamePrefix + att.getID().getName()));
it.unibz.inf.ontop.dbschemaUniqueConstraintgetAttributes

Javadoc

return the list of attributes in the unique constraint

Popular methods of UniqueConstraint

  • builder
    creates a UNIQUE constraint builder (which is also used for a PRIMARY KET builder)
  • <init>
  • getRelation
    return the database relation for the unique constraint
  • isPrimaryKey
    return true if it is a primary key and false otherwise

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • getSystemService (Context)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ImageIO (javax.imageio)
  • JCheckBox (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now