本文整理汇总了Java中de.fuberlin.wiwiss.d2rq.expr.Conjunction.create方法的典型用法代码示例。如果您正苦于以下问题:Java Conjunction.create方法的具体用法?Java Conjunction.create怎么用?Java Conjunction.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.fuberlin.wiwiss.d2rq.expr.Conjunction
的用法示例。
在下文中一共展示了Conjunction.create方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: valueExpression
import de.fuberlin.wiwiss.d2rq.expr.Conjunction; //导入方法依赖的package包/类
public Expression valueExpression(String value) {
if (value == null) {
return Expression.FALSE;
}
Matcher match = this.regex.matcher(value);
if (!match.matches()) {
return Expression.FALSE;
}
Collection<Expression> expressions = new ArrayList<Expression>(columns.size());
for (int i = 0; i < this.columns.size(); i++) {
Attribute attribute = columns.get(i);
ColumnFunction function = columnFunctions.get(i);
String attributeValue = function.decode(match.group(i + 1));
if (attributeValue == null) {
return Expression.FALSE;
}
expressions.add(Equality.createAttributeValue(attribute, attributeValue));
}
return Conjunction.create(expressions);
}
示例2: valueExpression
import de.fuberlin.wiwiss.d2rq.expr.Conjunction; //导入方法依赖的package包/类
public Expression valueExpression(String value) {
if (value == null) {
return Expression.FALSE;
}
String[] parts = value.split(DELIMITER);
// Check if given bNode was created by this class map
if (parts.length != this.attributes.size() + 1
|| !this.classMapID.equals(parts[0])) {
return Expression.FALSE;
}
int i = 1; // parts[0] is classMap identifier
Collection<Expression> expressions = new ArrayList<Expression>(attributes.size());
for (Attribute attribute: attributes) {
expressions.add(Equality.createAttributeValue(attribute, parts[i]));
i++;
}
return Conjunction.create(expressions);
}
示例3: joinRelations
import de.fuberlin.wiwiss.d2rq.expr.Conjunction; //导入方法依赖的package包/类
/**
* Static convenience function that joins several {@link Relation}s into one. Exposed here
* because it can be used in the old FastPath engine.
*
* @param relations A set of {@link Relation}s
* @param additionalCondition An additional expression, e.g. join condition
* @return A relation that is the join of the inputs
*/
private Relation joinRelations(Collection<Relation> relations, Expression additionalCondition) {
if (relations.isEmpty()) {
return Relation.TRUE;
}
ConnectedDB connectedDB = ((Relation) relations.iterator().next()).database();
AliasMap joinedAliases = AliasMap.NO_ALIASES;
Collection<Expression> expressions = new HashSet<Expression>();
expressions.add(additionalCondition);
Collection<Expression> softConditions = new HashSet<Expression>();
Set<Join> joins = new HashSet<Join>();
Set<ProjectionSpec> projections = new HashSet<ProjectionSpec>();
int limit = Relation.NO_LIMIT;
int limitInverse = Relation.NO_LIMIT;
List<OrderSpec> orderSpecs = null;
for (Relation relation: relations) {
joinedAliases = joinedAliases.applyTo(relation.aliases());
expressions.add(relation.condition());
softConditions.add(relation.softCondition());
joins.addAll(relation.joinConditions());
projections.addAll(relation.projections());
orderSpecs = orderSpecs == null ? relation.orderSpecs() : orderSpecs;
limit = Relation.combineLimits(limit, relation.limit());
limitInverse = Relation.combineLimits(limitInverse, relation.limitInverse());
}
// TODO: Determine correct uniqueness instead of just false.
// The new relation is unique if it is joined only on unique node sets.
// A node set is unique if it is constrained by only unique node makers.
// In the meantime, copy the uniqueness from the relation if there's just one
boolean isUnique = relations.size() == 1 && (relations.iterator().next()).isUnique();
return new RelationImpl(connectedDB, joinedAliases, Conjunction.create(expressions),
Conjunction.create(softConditions),
joins, projections, isUnique, orderSpecs, limit, limitInverse);
}
示例4: constraint
import de.fuberlin.wiwiss.d2rq.expr.Conjunction; //导入方法依赖的package包/类
/**
* @return An expression that, if it holds for a result row, will ensure that
* any two identically-named node makers produce the same node
*/
public Expression constraint() {
Collection<Expression> expressions = new ArrayList<Expression>();
for (Var var: nodeSets.keySet()) {
NodeSetConstraintBuilder nodeSet = (NodeSetConstraintBuilder) nodeSets.get(var);
if (nodeSet.isEmpty()) {
return Expression.FALSE;
}
expressions.add(nodeSet.constraint());
}
return Conjunction.create(expressions);
}
示例5: assertPatternValues
import de.fuberlin.wiwiss.d2rq.expr.Conjunction; //导入方法依赖的package包/类
private void assertPatternValues(Pattern pattern, String value, Map<String,String> expectedValues) {
assertTrue(matches(pattern, value));
Collection<Expression> expressions = new HashSet<Expression>();
for (String attributeName: expectedValues.keySet()) {
String attributeValue = (String) expectedValues.get(attributeName);
Attribute attribute = SQL.parseAttribute(attributeName);
expressions.add(Equality.create(
new AttributeExpr(attribute),
new Constant(attributeValue, attribute)));
}
Expression expr = Conjunction.create(expressions);
assertEquals(expr, pattern.valueExpression(value));
}
示例6: condition
import de.fuberlin.wiwiss.d2rq.expr.Conjunction; //导入方法依赖的package包/类
private Expression condition() {
if (this.cachedCondition == null) {
this.cachedCondition = Conjunction.create(this.conditions);
}
return this.cachedCondition;
}