本文整理汇总了Java中org.openrdf.query.algebra.Var.isAnonymous方法的典型用法代码示例。如果您正苦于以下问题:Java Var.isAnonymous方法的具体用法?Java Var.isAnonymous怎么用?Java Var.isAnonymous使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openrdf.query.algebra.Var
的用法示例。
在下文中一共展示了Var.isAnonymous方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: meet
import org.openrdf.query.algebra.Var; //导入方法依赖的package包/类
@Override
public void meet(final Var n) {
final String name = n.getName();
if (n.getValue() != null) {
emit(n.getValue());
} else if (!n.isAnonymous()) {
emit("?" + n.getName());
} else {
final ValueExpr expr = getVarExpr(this.root, n.getName());
if (expr != null) {
emit(expr);
} else if (getVarRefs(this.root, n.getName()) <= 1) {
emit("[]");
} else {
emit("?").emit(sanitize(name));
}
}
}
示例2: meet
import org.openrdf.query.algebra.Var; //导入方法依赖的package包/类
@Override
public void meet(Var node) throws RuntimeException {
if (node.hasValue()) {
// bound variable (constant)
Value value = node.getValue();
if (value instanceof URI)
buffer.append("<").append(value).append(">");
else
buffer.append(value);
} else {
// unbound variable
if (node.isAnonymous())
buffer.append("[]");
else
buffer.append("?").append(node.getName());
}
}
示例3: createSpatialColumn
import org.openrdf.query.algebra.Var; //导入方法依赖的package包/类
/**
* 13/09/2011 Extra constructor to use in spatial cases
*
*/
public static GeneralDBColumnVar createSpatialColumn(String alias, Var v, Value value) {
GeneralDBColumnVar var = new GeneralDBColumnVar();
var.alias = alias;
var.column = "id";
var.name = v.getName();
var.anonymous = v.isAnonymous();
var.value = value;
var.types = ValueTypes.UNKNOWN;
if (value instanceof RdbmsResource) {
var.types = ValueTypes.RESOURCE;
}
var.setSpatial(true);
return var;
}
示例4: createObj
import org.openrdf.query.algebra.Var; //导入方法依赖的package包/类
/**
* Extra constructor to use in spatial cases
*
* @param isSpatial
* @return
*/
public static GeneralDBColumnVar createObj(String alias, Var v, Value value, boolean isSpatial) {
GeneralDBColumnVar var = new GeneralDBColumnVar();
var.alias = alias;
var.column = "obj";
var.name = v.getName();
var.anonymous = v.isAnonymous();
var.value = value;
var.types = ValueTypes.UNKNOWN;
if (value instanceof RdbmsURI) {
var.types = ValueTypes.URI;
} else if (value instanceof RdbmsResource) {
var.types = ValueTypes.RESOURCE;
}
var.setSpatial(isSpatial);
return var;
}
示例5: createCtx
import org.openrdf.query.algebra.Var; //导入方法依赖的package包/类
public static GeneralDBColumnVar createCtx(String alias, Var v, Resource resource) {
GeneralDBColumnVar var = new GeneralDBColumnVar();
var.alias = alias;
var.column = "ctx";
if (v == null) {
var.name = "__ctx" + Integer.toHexString(System.identityHashCode(var));
var.anonymous = true;
var.hidden = true;
} else {
var.name = v.getName();
var.anonymous = v.isAnonymous();
}
var.value = resource;
var.types = ValueTypes.RESOURCE;
if (resource instanceof RdbmsURI) {
var.types = ValueTypes.URI;
}
return var;
}
示例6: createSubj
import org.openrdf.query.algebra.Var; //导入方法依赖的package包/类
public static GeneralDBColumnVar createSubj(String alias, Var v, Resource resource) {
GeneralDBColumnVar var = new GeneralDBColumnVar();
var.alias = alias;
var.column = "subj";
var.name = v.getName();
var.anonymous = v.isAnonymous();
var.value = resource;
var.types = ValueTypes.RESOURCE;
if (resource instanceof RdbmsURI) {
var.types = ValueTypes.URI;
}
return var;
}