Package de.fuberlin.wiwiss.d2rq.nodes

Examples of de.fuberlin.wiwiss.d2rq.nodes.FixedNodeMaker


  public Collection<TripleRelation> toTripleRelations() {
    this.validate();
    Collection<TripleRelation> results = new ArrayList<TripleRelation>();
    for (Resource property: properties) {
      NodeMaker s = this.belongsToClassMap.nodeMaker();
      NodeMaker p = new FixedNodeMaker(property.asNode(), false);
      NodeMaker o = nodeMaker();
      results.add(new TripleRelation(buildRelation(), s, p, o));
    }
    for (String pattern: dynamicPropertyPatterns) {
      NodeMaker s = this.belongsToClassMap.nodeMaker();
View Full Code Here


      Var var = it.next();
      Node value = binding.get(var);
      if (columns.containsKey(var)) {
        columns.put(var, columns.get(var).selectNode(value, mutator));
      } else {
        columns.put(var, new FixedNodeMaker(value, false));
      }
    }
    return new NodeRelation(mutator.immutableSnapshot(), columns);
  }
View Full Code Here

          inventoryBridges.add(bridge);         
        }
      }
      if (inventoryBridges.isEmpty()) {
        Relation relation = (Relation) this.mapping.classMap(classMapResource).relation();
        NodeMaker typeNodeMaker = new FixedNodeMaker(
            RDF.type.asNode(), false);
        NodeMaker resourceNodeMaker = new FixedNodeMaker(RDFS.Resource.asNode(), false);
        inventoryBridges.add(new TripleRelation(relation,
            resourceMaker, typeNodeMaker, resourceNodeMaker));
      }
      this.classMapInventoryBridges.put(toClassMapName(classMap), inventoryBridges);
    }
View Full Code Here

        Collections.<Join>emptySet(), Collections.<ProjectionSpec>emptySet(),
        false, OrderSpec.NONE, Relation.NO_LIMIT, Relation.NO_LIMIT);
    this.withURIPatternSubject = new TripleRelation(base,
        new TypedNodeMaker(TypedNodeMaker.URI,
            new Pattern("http://test/person@@employees.ID@@"), true),
        new FixedNodeMaker(RDF.type.asNode(), false),
        new FixedNodeMaker(FOAF.Person.asNode(), false));
    this.withURIPatternSubjectAndObject = new TripleRelation(base,
        new TypedNodeMaker(TypedNodeMaker.URI,
            new Pattern("http://test/person@@employees.ID@@"), true),
        new FixedNodeMaker(FOAF.knows.asNode(), false),
        new TypedNodeMaker(TypedNodeMaker.URI,
            new Pattern("http://test/person@@employees.manager@@"), true));
    this.withURIColumnSubject = new TripleRelation(base,
        new TypedNodeMaker(TypedNodeMaker.URI,
            new Column(new Attribute(null, "employees", "homepage")), false),
        new FixedNodeMaker(RDF.type.asNode(), false),
        new FixedNodeMaker(FOAF.Document.asNode(), false));
    this.withURIPatternSubjectAndURIColumnObject = new TripleRelation(base,
        new TypedNodeMaker(TypedNodeMaker.URI,
            new Pattern("http://test/person@@employees.ID@@"), true),
        new FixedNodeMaker(FOAF.homepage.asNode(), false),
        new TypedNodeMaker(TypedNodeMaker.URI,
            new Column(new Attribute(null, "employees", "homepage")), false));
    this.employeeChecker = new URIMakerRule().createRuleChecker(
        Node.createURI("http://test/person1"));
    this.foobarChecker = new URIMakerRule().createRuleChecker(
View Full Code Here

            else
              return Collections.emptyList();
          }
        }
      } else if (nodeMaker instanceof FixedNodeMaker) {
        FixedNodeMaker fixedNodeMaker = (FixedNodeMaker) nodeMaker;
        Node node = fixedNodeMaker.makeNode(null);
        result.add(new ConstantEx(NodeValue.makeNode(node).asString(), node));
      }
    }
   
    return result;
View Full Code Here

      return new TypedNodeMaker(TypedNodeMaker.typedLiteral(datatype), ((TypedNodeMaker) nodeMaker).valueMaker(), nodeMaker.isUnique());
   
    if (nodeMaker instanceof FixedNodeMaker) {
      Node node = nodeMaker.makeNode(null);
     
      return new FixedNodeMaker(XSD.cast(node, datatype), nodeMaker.isUnique());
    }
   
    throw new RuntimeException("unknown nodeMaker type");
  }
View Full Code Here

    return this.cachedNodeMaker;
  }
 
  private NodeMaker buildNodeMaker() {
    if (this.constantValue != null) {
      return new FixedNodeMaker(this.constantValue.asNode(),
          !this.containsDuplicates);
    }
    if (this.refersToClassMap == null) {
      return buildNodeMaker(wrapValueSource(buildValueSourceBase()), !this.containsDuplicates);
    }
View Full Code Here

    Relation rel = new RelationImpl(
        null, aliases, Expression.TRUE, Expression.TRUE,
        Collections.<Join>emptySet(), projections, false, OrderSpec.NONE, Relation.NO_LIMIT, Relation.NO_LIMIT);
    TripleRelation t = new TripleRelation(rel,
        new TypedNodeMaker(TypedNodeMaker.URI, new Pattern("http://example.org/original/@@original.id@@"), true),
        new FixedNodeMaker(Node.createURI("http://example.org/property"), false),
        new TypedNodeMaker(TypedNodeMaker.PLAIN_LITERAL, new Column(new Attribute(alias, "value")), false));
    assertEquals("URI(Pattern(http://example.org/original/@@original.id@@))",
        t.nodeMaker(TripleRelation.SUBJECT).toString());
    assertEquals("Literal(Column(alias.value))",
        t.nodeMaker(TripleRelation.OBJECT).toString());
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.nodes.FixedNodeMaker

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.