Package de.fuberlin.wiwiss.d2rq.algebra

Examples of de.fuberlin.wiwiss.d2rq.algebra.NodeRelation.baseRelation()


      joiners = nextJoiners;
    }
    List<NodeRelation> results = new ArrayList<NodeRelation>(joiners.size());
    for (TripleRelationJoiner joiner: joiners) {
      NodeRelation nodeRelation = joiner.toNodeRelation();
      if (!nodeRelation.baseRelation().equals(Relation.EMPTY) || !useAllOptimizations)
        results.add(nodeRelation);
    }
    return results;
  }
View Full Code Here


             * If we would set an alias to this table...
             */
            if (attributes != null) {
              AliasMap amap = (AliasMap)(nodeSets.relationAliases().get(nameVar));
              RelationName originalName = amap.originalOf(attributes.relationName);
              if (r.baseRelation().aliases().hasAlias(originalName)) {

                /*
                 * ... and indexes are in place to guarantee uniqueness of the attribute combination...
                 */
                if (isUnique(r.baseRelation().database(), originalName, attributes.attributeNames)) {
View Full Code Here

              if (r.baseRelation().aliases().hasAlias(originalName)) {

                /*
                 * ... and indexes are in place to guarantee uniqueness of the attribute combination...
                 */
                if (isUnique(r.baseRelation().database(), originalName, attributes.attributeNames)) {
                 
                  if (t.getSubject().isVariable() && t.getSubject().getName().equals(name)) {
                    // ... then first find the right relation name...
                    AttributeSet existing = AttributeSet.createFrom(r.nodeMaker(TripleRelation.SUBJECT));
                    if (existing != null && existing.attributeNames.equals(attributes.attributeNames)) {
View Full Code Here

        List<RelationName> relationNames = getRelationNames(
            r.nodeMaker(TripleRelation.OBJECT));
        Set<Alias> aliases = new HashSet<Alias>();
               
        for (RelationName rname: relationNames) {
          if (r.baseRelation().aliases().isAlias(rname))
            aliases.add(new AliasMap.Alias(r.baseRelation().aliases().originalOf(rname), rname));
        }
        nodeSets.add(Var.alloc(t.getObject()), r.nodeMaker(TripleRelation.OBJECT), new AliasMap(aliases));
      }
     
View Full Code Here

            r.nodeMaker(TripleRelation.OBJECT));
        Set<Alias> aliases = new HashSet<Alias>();
               
        for (RelationName rname: relationNames) {
          if (r.baseRelation().aliases().isAlias(rname))
            aliases.add(new AliasMap.Alias(r.baseRelation().aliases().originalOf(rname), rname));
        }
        nodeSets.add(Var.alloc(t.getObject()), r.nodeMaker(TripleRelation.OBJECT), new AliasMap(aliases));
      }
     
      if (t.getPredicate().isVariable()) {
View Full Code Here

        List<RelationName> relationNames = getRelationNames(
            r.nodeMaker(TripleRelation.PREDICATE));
        Set<Alias> aliases = new HashSet<Alias>();
               
        for (RelationName rname: relationNames) {
          if (r.baseRelation().aliases().isAlias(rname))
            aliases.add(new AliasMap.Alias(r.baseRelation().aliases().originalOf(rname), rname));
        }
        nodeSets.add(Var.alloc(t.getPredicate()), r.nodeMaker(TripleRelation.PREDICATE), new AliasMap(aliases));
      }
     
View Full Code Here

            r.nodeMaker(TripleRelation.PREDICATE));
        Set<Alias> aliases = new HashSet<Alias>();
               
        for (RelationName rname: relationNames) {
          if (r.baseRelation().aliases().isAlias(rname))
            aliases.add(new AliasMap.Alias(r.baseRelation().aliases().originalOf(rname), rname));
        }
        nodeSets.add(Var.alloc(t.getPredicate()), r.nodeMaker(TripleRelation.PREDICATE), new AliasMap(aliases));
      }
     
      if (t.getSubject().isVariable()) {
View Full Code Here

        List<RelationName> relationNames = getRelationNames(
            r.nodeMaker(TripleRelation.SUBJECT));
        Set<Alias> aliases = new HashSet<Alias>();
               
        for (RelationName rname: relationNames) {
          if (r.baseRelation().aliases().isAlias(rname))
            aliases.add(new AliasMap.Alias(r.baseRelation().aliases().originalOf(rname), rname));
        }
        nodeSets.add(Var.alloc(t.getSubject()), r.nodeMaker(TripleRelation.SUBJECT), new AliasMap(aliases));
      }
View Full Code Here

            r.nodeMaker(TripleRelation.SUBJECT));
        Set<Alias> aliases = new HashSet<Alias>();
               
        for (RelationName rname: relationNames) {
          if (r.baseRelation().aliases().isAlias(rname))
            aliases.add(new AliasMap.Alias(r.baseRelation().aliases().originalOf(rname), rname));
        }
        nodeSets.add(Var.alloc(t.getSubject()), r.nodeMaker(TripleRelation.SUBJECT), new AliasMap(aliases));
      }

    }
View Full Code Here

  private final static Var x = Var.alloc("x");
 

  public void testEmptyGraphAndBGP() {
    NodeRelation nodeRel = translate1(Collections.<Triple>emptyList(), Collections.<TripleRelation>emptyList());
    assertEquals(Relation.TRUE, nodeRel.baseRelation());
    assertEquals(Collections.EMPTY_SET, nodeRel.variables());
  }
 
  public void testEmptyGraph() {
    assertNull(translate1("?subject ?predicate ?object", Collections.<TripleRelation>emptyList()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.