Package lupos.datastructures.items

Examples of lupos.datastructures.items.Item


    this.varPred = new Variable(varPredName);

    final JPanel contentPanel = this.createContentPanel(
        new ActionListener() {
          public void actionPerformed(final ActionEvent ae) {
            final Item subjectItem = subjectPanel
                .getSelectedElement();
            final Item predicateItem = predicatePanelS
                .getSelectedElement();
            final String uniqueS = subjectItem.isVariable() ? "?"
                + parent.getUniqueVariableName(subjectItem)
                : subjectItem.toString();
            final String uniqueP = predicateItem.isVariable() ? "?"
                + parent.getUniqueVariableName(predicateItem)
                : predicateItem.toString();

            String vars = "";
            if (subjectItem.isVariable())
              vars += uniqueS + " ";
            if (predicateItem.isVariable())
              vars += uniqueP + " ";
            parent.getStatusBar().setText(
                "add preceding suggestion...");
            parent.updateAll(parent.determineNewQuery(parent
                .getCurrentBrowserQuery(), uniqueS + " "
                + uniqueP + " " + op.toString() + ".", vars));
            parent.getStatusBar().clear();
          }
        }, new ActionListener() {
          public void actionPerformed(final ActionEvent ae) {
            final Item predicateItem = predicatePanelO
                .getSelectedElement();
            final Item objectItem = objectPanel
                .getSelectedElement();
            final String uniqueO = objectItem.isVariable() ? "?"
                + parent.getUniqueVariableName(objectItem)
                : objectItem.toString();
            final String uniqueP = predicateItem.isVariable() ? "?"
                + parent.getUniqueVariableName(predicateItem)
                : predicateItem.toString();

            String vars = "";
            if (objectItem.isVariable())
              vars += uniqueO + " ";
            if (predicateItem.isVariable())
              vars += uniqueP + " ";
            parent.getStatusBar().setText(
                "add succeeding suggestion...");
View Full Code Here


  }

  protected void addPrecedingSuggestion(final SuggestionPanel subjectPanel,
      final SuggestionPanel predicatePanel) {
    // get items...
    final Item subjectItem = subjectPanel.getSelectedElement();
    final Item predicateItem = predicatePanel.getSelectedElement();

    // add the subject operator...
    this.visualEditor.prepareOperatorForAdd(QueryRDFTerm.class);
    final Operator subjectOp = this.queryGraph.addOperator(5, 5,
        subjectItem);
View Full Code Here

  protected void addSucceedingSuggestion(
      final SuggestionPanel predicatePanel,
      final SuggestionPanel objectPanel) {
    // get items...
    final Item predicateItem = predicatePanel.getSelectedElement();
    final Item objectItem = objectPanel.getSelectedElement();

    // add the object operator...
    this.visualEditor.prepareOperatorForAdd(QueryRDFTerm.class);
    final Operator objectOp = this.queryGraph.addOperator(5, 5, objectItem);
View Full Code Here

            final VisualDataGenerator vdg = new VisualDataGenerator(((VisualGraphOperatorWithPrefix) this.visualGraphs.get(0)).prefix);
            rdfTermToJoin.addAll((Collection<Operator>) child.jjtAccept((SPARQL1_1ParserVisitor) vdg, rdfHash));
          }
          else {
            // it is an RDF term!
            final Item item = SPARQLCoreParserVisitorImplementation.getItem(child);

            DataRDFTerm rdfTerm = rdfHash.get(item);

            if(rdfTerm == null) {
              rdfTerm = new DataRDFTerm(((VisualGraphOperatorWithPrefix) this.visualGraphs.get(0)).prefix, item);
View Full Code Here

  @Override
  public Object visit(final ASTGraphConstraint node, final Object data) {
    final int numberChildren = node.jjtGetNumChildren();
    final String graphConstraint = null;

    Item item=null;

    final Node child = node.jjtGetChild(0);

    if (child instanceof ASTQuotedURIRef) {
      try {
View Full Code Here

    /*
     * get the variables on given position and store them temp.
     */
    for (TriplePattern pattern : tripple1) {
      Item i = pattern.getPos(position);
      if (i instanceof Variable) {
        boundVariabled.add((Variable) i);
      }
    }
    /* now check 2nd triple patterns, whether the same variable is used */
    for (TriplePattern pattern : tripple2) {
      Item i = pattern.getPos(position);
      if (i instanceof Variable) {
        if (boundVariabled.contains(i)) {
          return true;
        }
      }
View Full Code Here

    final LinkedList<Variable> addBindingsVar = new LinkedList<Variable>();
    final LinkedList<Literal> addBindingsLit = new LinkedList<Literal>();

    String filterConstraint = "Filter( ";
    for (int i = 0; i < 3; i++) {
      final Item patItem = patItems[i];
      final Item generateItem = generateItems[i];
      if ((!patItem.isVariable()) && generateItem.isVariable()) {
        filterConstraint += generateItems[i].toString() + " = "
            + patItems[i].toString() + " && ";
      } else if (patItem.isVariable() && generateItem.isVariable()) {
        replaceVar.addSubstitution((Variable) patItem,
            (Variable) generateItem);
        replaceVar.getIntersectionVariables().add((Variable) patItem);
      } else if (patItem.isVariable() && (!generateItem.isVariable())) {
        addBindingsVar.add((Variable) patItem);
        addBindingsLit.add((Literal) generateItem);
      } else if (!patItem.isVariable() && !generateItem.isVariable()
          && !generateItem.equals(patItem)) {
        // cannot match, remove generate.
        for (final BasicOperator parent : generate
            .getPrecedingOperators())
          parent.removeSucceedingOperator(generate);
        generate.getPrecedingOperators().clear();
View Full Code Here

    @Override
    public boolean equals(final Object object){
      if(object instanceof KeyTriplePattern){
        final KeyTriplePattern other = (KeyTriplePattern) object;
        for(int i=0; i<3; i++){
          final Item thisItem = this.triplePattern.getPos(i);
          final Item otherItem = other.triplePattern.getPos(i);
          if(!(thisItem.isVariable() == otherItem.isVariable() && (thisItem.isVariable()
              && otherItem.isVariable() || thisItem.equals(otherItem)))){
            return false;
          }
        }
        return true;
      } else {
View Full Code Here

    public boolean mayConsume(final KeyTriplePattern other){
      final Iterator<Item> thisIterator = this.triplePattern.iterator();
      final Iterator<Item> otherIterator = other.triplePattern.iterator();
      while(thisIterator.hasNext()){
        final Item thisItem = thisIterator.next();
        final Item otherItem = otherIterator.next();
        if(!(otherItem.isVariable() || thisItem.isVariable() || thisItem.equals(otherItem))){
          return false;
        }
      }
      return true;
    }
View Full Code Here

      if(object instanceof KeyPredicatePattern){
        final KeyPredicatePattern other = (KeyPredicatePattern) object;
        final Iterator<Item> thisIterator = this.predicatePattern.iterator();
        final Iterator<Item> otherIterator = other.predicatePattern.iterator();
        while(thisIterator.hasNext()){
          final Item thisItem = thisIterator.next();
          final Item otherItem = otherIterator.next();
          if(!(thisItem.isVariable() == otherItem.isVariable() && (thisItem.isVariable()
              && otherItem.isVariable() || thisItem.equals(otherItem)))){
            return false;
          }
        }
        return true;
      } else {
View Full Code Here

TOP

Related Classes of lupos.datastructures.items.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.