Tabnine Logo
ParserViewDefinition
Code IndexAdd Tabnine to your IDE (free)

How to use
ParserViewDefinition
in
it.unibz.inf.ontop.dbschema

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

origin: it.unibz.inf.ontop/ontop-translation-sql

ParserViewDefinition viewDefinition = (ParserViewDefinition) optionalViewDefinition.get();
List<QualifiedAttributeID> columnIds = viewDefinition.getAttributes().stream()
    .map(Attribute::getQualifiedID)
    .collect(Collectors.toList());
int mainColumnIndex = columnIds.indexOf(mainColumn) + 1;
Attribute typeColumn = viewDefinition.getAttribute(mainColumnIndex + relativeIndexWrtMainColumn);
return Optional.of(typeColumn.getQualifiedID());
origin: ontop/ontop

@Override
public String toString() {
  StringBuilder bf = new StringBuilder();
  bf.append(getID()).append(" [");
  Joiner.on(", ").appendTo(bf, attributes);
  bf.append("]").append(" (").append(statement).append(")");
  return bf.toString();
}
origin: ontop/ontop

ImmutableList<Map.Entry<QualifiedAttributeID,Variable>> list = view.getAttributes().stream()
    .map(att -> new AbstractMap.SimpleEntry<>(
        new QualifiedAttributeID(null, att.getID()), // strip off the ParserViewDefinitionName
body.add(termFactory.getFunction(view.getAtomPredicate(), arguments));
origin: it.unibz.inf.ontop/ontop-rdb

/**
 * creates a view for SQLQueryParser
 * (NOTE: these views are simply names for complex non-parsable subqueries, not database views)
 *
 * TODO: make the second argument a callback (which is called only when needed)
 * TODO: make it re-use parser views for the same SQL
 *
 * @param sql
 * @return
 */

public ParserViewDefinition createParserView(String sql, ImmutableList<QuotedID> attributes) {
  if (!isStillMutable()) {
    throw new IllegalStateException("Too late! Parser views must be created before freezing the DBMetadata");
  }
  RelationID id = getQuotedIDFactory().createRelationID(null, String.format("view_%s", parserViewCounter++));
  
  ParserViewDefinition view = new ParserViewDefinition(id, attributes, sql);
  // UGLY!!
  add(view, relations);
  return view;
}
origin: it.unibz.inf.ontop/ontop-translation-sql

return String.format("(%s) %s", ((ParserViewDefinition) def).getStatement(),
    viewNames.get(atom).getSQLRendering());
origin: it.unibz.inf.ontop/ontop-mapping-sql-core

ImmutableList<Map.Entry<QualifiedAttributeID,Variable>> list = view.getAttributes().stream()
    .map(att -> new AbstractMap.SimpleEntry<>(
        new QualifiedAttributeID(null, att.getID()), // strip off the ParserViewDefinitionName
origin: ontop/ontop

/**
 * creates a view for SQLQueryParser
 * (NOTE: these views are simply names for complex non-parsable subqueries, not database views)
 *
 * TODO: make the second argument a callback (which is called only when needed)
 * TODO: make it re-use parser views for the same SQL
 *
 * @param sql
 * @return
 */

public ParserViewDefinition createParserView(String sql, ImmutableList<QuotedID> attributes) {
  if (!isStillMutable()) {
    throw new IllegalStateException("Too late! Parser views must be created before freezing the DBMetadata");
  }
  RelationID id = getQuotedIDFactory().createRelationID(null, String.format("view_%s", parserViewCounter++));
  
  ParserViewDefinition view = new ParserViewDefinition(id, attributes, sql, typeFactory.getXsdStringDatatype());
  // UGLY!!
  add(view, relations);
  return view;
}
origin: it.unibz.inf.ontop/ontop-reformulation-sql

relation instanceof DatabaseRelationDefinition
    ? relation.getID().getSQLRendering()
    : inBrackets(((ParserViewDefinition)relation).getStatement()),
relation.getAttributes().stream()
    .map(a -> new QualifiedAttributeID(relationAlias, a.getID()))
origin: it.unibz.inf.ontop/ontop-rdb

@Override
public String toString() {
  StringBuilder bf = new StringBuilder();
  bf.append(getID()).append(" [");
  Joiner.on(", ").appendTo(bf, attributes);
  bf.append("]").append(" (").append(statement).append(")");
  return bf.toString();
}
origin: it.unibz.inf.ontop/ontop-translation-sql

ParserViewDefinition view = new ParserViewDefinition(viewId, unionView);
columnIds.stream().forEach(view::addAttribute);
origin: ontop/ontop

relation instanceof DatabaseRelationDefinition
    ? relation.getID().getSQLRendering()
    : inBrackets(((ParserViewDefinition)relation).getStatement()),
relation.getAttributes().stream()
    .map(a -> new QualifiedAttributeID(relationAlias, a.getID()))
origin: ontop/ontop

  @Override
  public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    final int tableSize = list.getModel().getSize();
    if (tableSize == 0) {
      label.setText("<No table found>");
      return label;
    } else {
      if (index == -1) {
        label.setText("<Select database table>");
        return label;
      } else {
        if (value instanceof DatabaseRelationDefinition) {
          DatabaseRelationDefinition td = (DatabaseRelationDefinition) value;
          ImageIcon icon = IconLoader.getImageIcon("images/db_table.png");
          label.setIcon(icon);
          label.setText(td.getID().getSQLRendering());
        } else if (value instanceof ParserViewDefinition) {
          // ROMAN (7 Oct 2015): I'm not sure we need "views" -- they are
          // created by SQLQueryParser for complex queries that cannot be parsed
          ParserViewDefinition vd = (ParserViewDefinition) value;
          ImageIcon icon = IconLoader.getImageIcon("images/db_view.png");
          label.setIcon(icon);
          label.setText(vd.getID().getSQLRendering());
        }
        return label;
      }
    }
  }
}
it.unibz.inf.ontop.dbschemaParserViewDefinition

Javadoc

Represents a complex sub-query created by the SQL parser (not a database view!)

Most used methods

  • <init>
  • getAttributes
  • getID
  • getStatement
    returns the SQL definition of the sub-query
  • getAtomPredicate
  • getAttribute

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • startActivity (Activity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Top 12 Jupyter Notebook extensions
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