当前位置: 首页>>代码示例>>Java>>正文


Java Node.isVariable方法代码示例

本文整理汇总了Java中com.hp.hpl.jena.graph.Node.isVariable方法的典型用法代码示例。如果您正苦于以下问题:Java Node.isVariable方法的具体用法?Java Node.isVariable怎么用?Java Node.isVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.hp.hpl.jena.graph.Node的用法示例。


在下文中一共展示了Node.isVariable方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMappingVarsOfTriple

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
private HashMap<String, String[]> getMappingVarsOfTriple(Triple t) {
	HashMap<String, String[]> result = new HashMap<String, String[]>();
	Node subject = t.getSubject();
	Node predicate = t.getPredicate();
	Node object = t.getObject();
	if (subject.isVariable())
		result.put(subject.getName(),
				new String[] { Tags.SUBJECT_COLUMN_NAME });
	if (predicate.isVariable()) {
		result.put(predicate.getName(),
				new String[] { Tags.PREDICATE_COLUMN_NAME });
	}
	if (object.isVariable()) {
		result.put(object.getName(),
				new String[] { Tags.OBJECT_COLUMN_NAME });
	}
	return result;
}
 
开发者ID:aschaetzle,项目名称:S2RDF,代码行数:19,代码来源:TripleGroup.java

示例2: getSchemaOfTriple

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
protected ArrayList<String> getSchemaOfTriple(Triple t) {
	ArrayList<String> schema = new ArrayList<String>();
	Node subject = t.getSubject();
	Node predicate = t.getPredicate();
	Node object = t.getObject();
	if (subject.isVariable())
		schema.add(subject.getName());
	else
		schema.add(Tags.NO_VAR);
	if (predicate.isVariable())
		schema.add(predicate.getName());
	else
		schema.add(Tags.NO_VAR);
	if (object.isVariable())
		schema.add(object.getName());
	else
		schema.add(Tags.NO_VAR);
	return schema;
}
 
开发者ID:aschaetzle,项目名称:PigSPARQL,代码行数:20,代码来源:PigBGP.java

示例3: getMappingVarsOfTriple

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
private HashMap<String, String[]> getMappingVarsOfTriple(Triple t) {
	HashMap<String, String[]> result = new HashMap<String, String[]>();
	Node subject = t.getSubject();
	Node predicate = t.getPredicate();
	Node object = t.getObject();
	if (subject.isVariable()) {
		result.put(subject.getName(), new String[] { Tags.SUBJECT_COLUMN_NAME });
	}
	if (predicate.isVariable()) {
		selectFromTripleStore = true;
		result.put(predicate.getName(), new String[] { Tags.PREDICATE_COLUMN_NAME });
	}
	if (object.isVariable()) {
		if (selectFromTripleStore) {
			result.put(object.getName(), new String[] { Tags.OBJECT_COLUMN_NAME });
		} else {
			String objectString = object.getName();
			String predicateString = getPropertyFromURI(FmtUtils
					.stringForNode(predicate, prefixMapping), false);
			result.put(objectString, new String[] { SpecialCharFilter.filter(predicateString) });
		}
	}
	return result;
}
 
开发者ID:aschaetzle,项目名称:Sempala,代码行数:25,代码来源:SparkComplexTripleGroup.java

示例4: getMappingVarsOfTriple

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
private HashMap<String, String[]> getMappingVarsOfTriple(Triple t) {
	HashMap<String, String[]> result = new HashMap<String, String[]>();
	Node subject = t.getSubject();
	Node predicate = t.getPredicate();
	Node object = t.getObject();
	if (subject.isVariable())
		result.put(subject.getName(),
				new String[] { Tags.SUBJECT_COLUMN_NAME });
	if (predicate.isVariable()) {
		selectFromTripleStore = true;
		result.put(predicate.getName(),
				new String[] { Tags.PREDICATE_COLUMN_NAME });
	}
	if (object.isVariable()) {
		if (selectFromTripleStore) {
			result.put(object.getName(),
					new String[] { Tags.OBJECT_COLUMN_NAME });
		} else {
			result.put(object.getName(), new String[] { SpecialCharFilter
					.filter(FmtUtils
							.stringForNode(predicate, prefixMapping)) });
		}
	}
	return result;
}
 
开发者ID:aschaetzle,项目名称:Sempala,代码行数:26,代码来源:TripleGroup.java

示例5: toString

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
/**
 * Pretty-prints an RDF node and shortens URIs into QNames according to a
 * {@link PrefixMapping}.
 * @param n An RDF node
 * @return An N-Triples style textual representation with URIs shortened to QNames
 */
public static String toString(Node n, PrefixMapping prefixes) {
	if (n.isURI()) {
		return qNameOrURI(n.getURI(), prefixes);
	}
	if (n.isBlank()) {
		return "_:" + n.getBlankNodeLabel();
	}
	if (n.isVariable()) {
		return "?" + n.getName();
	}
	if (Node.ANY.equals(n)) {
		return "?ANY";
	}
	// Literal
	String s = "\"" + n.getLiteralLexicalForm() + "\"";
	if (!"".equals(n.getLiteralLanguage())) {
		s += "@" + n.getLiteralLanguage();
	}
	if (n.getLiteralDatatype() != null) {
		s += "^^" + qNameOrURI(n.getLiteralDatatypeURI(), prefixes);
	}
	return s;
}
 
开发者ID:d2rq,项目名称:r2rml-kit,代码行数:30,代码来源:PrettyPrinter.java

示例6: selectNode

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
public NodeMaker selectNode(Node node, RelationalOperators sideEffects) {
	if (node.equals(Node.ANY) || node.isVariable()) {
		return this;
	}
	if (!this.nodeType.matches(node)) {
		return NodeMaker.EMPTY;
	}
	String value = this.nodeType.extractValue(node);
	if (value == null) {
		return NodeMaker.EMPTY;
	}
	Expression expr = valueMaker.valueExpression(value);
	if (expr.isFalse()) {
		sideEffects.select(Expression.FALSE);
		return NodeMaker.EMPTY;
	}
	sideEffects.select(expr);
	return new FixedNodeMaker(node, isUnique());
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:20,代码来源:TypedNodeMaker.java

示例7: limitTo

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
public void limitTo(Node node) {
	if (isEmpty) return;
	if (Node.ANY.equals(node) || node.isVariable()) {
		return;
	}
	if (fixedNode == null) {
		fixedNode = node;
	} else if (!fixedNode.equals(node)) {
		limitToEmptySet();
	}
	if (node.isURI()) {
		limitToURIs();
		limitValues(node.getURI());
	}
	if (node.isBlank()) {
		limitToBlankNodes();
		limitValues(node.getBlankNodeLabel());
	}
	if (node.isLiteral()) {
		limitToLiterals(node.getLiteralLanguage(), node.getLiteralDatatype());
		limitValues(node.getLiteralLexicalForm());
	}
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:24,代码来源:NodeSetConstraintBuilder.java

示例8: getVarsOfTriple

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
private ArrayList<String> getVarsOfTriple(Triple t) {
    ArrayList<String> vars = new ArrayList<String>();
    Node subject = t.getSubject();
    Node predicate = t.getPredicate();
    Node object = t.getObject();
    if(subject.isVariable())
        vars.add(subject.getName());
    if(predicate.isVariable())
        vars.add(predicate.getName());
    if(object.isVariable())
        vars.add(object.getName());
    return vars;
}
 
开发者ID:aschaetzle,项目名称:S2RDF,代码行数:14,代码来源:ReorderNoCross.java

示例9: getVarsOfTriple

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
protected ArrayList<String> getVarsOfTriple(Triple t) {
	ArrayList<String> vars = new ArrayList<String>();
	Node subject = t.getSubject();
	Node predicate = t.getPredicate();
	Node object = t.getObject();
	if (subject.isVariable())
		vars.add(subject.getName());
	if (predicate.isVariable())
		vars.add(predicate.getName());
	if (object.isVariable())
		vars.add(object.getName());
	return vars;
}
 
开发者ID:aschaetzle,项目名称:PigSPARQL,代码行数:14,代码来源:ReorderNoCross.java

示例10: getVarsOfTriple

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
private ArrayList<String> getVarsOfTriple(Triple t) {
	ArrayList<String> vars = new ArrayList<String>();
	Node subject = t.getSubject();
	Node predicate = t.getPredicate();
	Node object = t.getObject();
	if(subject.isVariable())
		vars.add(subject.getName());
	if(predicate.isVariable())
		vars.add(predicate.getName());
	if(object.isVariable())
		vars.add(object.getName());
	return vars;
}
 
开发者ID:aschaetzle,项目名称:Sempala,代码行数:14,代码来源:ReorderNoCross.java

示例11: getMappingVarsOfTriple

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
/**
 * From a triple the method extracts the variable names 
 * and the columns to be selected from the table referring to that variable.
 * 
 * @param t
 * @return
 */
private HashMap<String, String[]> getMappingVarsOfTriple(Triple t) {
	HashMap<String, String[]> result = new HashMap<String, String[]>();
	Node subject = t.getSubject();
	Node predicate = t.getPredicate();
	Node object = t.getObject();
	if (subject.isVariable()){
		result.put(subject.getName(),
				new String[] { Tags.SUBJECT_COLUMN_NAME });
	}
	if (predicate.isVariable()) {
		selectFromTripleStore = true;
		result.put(predicate.getName(),
				new String[] { Tags.PREDICATE_COLUMN_NAME });
	}
	if (object.isVariable()) {
		if (selectFromTripleStore) {
			result.put(object.getName(),
					new String[] { Tags.OBJECT_COLUMN_NAME });
		} else {
			String objectString = object.getName();
			String predicateString = getPropertyFromURI(FmtUtils
					.stringForNode(predicate, prefixMapping), false);
			
			
			result.put(objectString, new String[] { SpecialCharFilter
					.filter(predicateString) });
		}
	}
	return result;
}
 
开发者ID:aschaetzle,项目名称:Sempala,代码行数:38,代码来源:ImpalaComplexTripleGroup.java

示例12: selectNode

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
public NodeMaker selectNode(Node n, RelationalOperators sideEffects) {
	if (n.equals(this.node) || n.equals(Node.ANY) || n.isVariable()) {
		return this;
	}
	sideEffects.select(Expression.FALSE);
	return NodeMaker.EMPTY;
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:8,代码来源:FixedNodeMaker.java

示例13: visit

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
private void visit(Node node) {
	if (node == null) return;
       if (node.isVariable()) {
       	variables.add((Var) node);
       }
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:7,代码来源:VarCollector.java

示例14: addIfVariable

import com.hp.hpl.jena.graph.Node; //导入方法依赖的package包/类
public void addIfVariable(Node possibleVariable, NodeMaker nodeMaker, AliasMap aliases) {
	if (!possibleVariable.isVariable()) return;
	add((Var) possibleVariable, nodeMaker, aliases);
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:5,代码来源:VariableConstraints.java


注:本文中的com.hp.hpl.jena.graph.Node.isVariable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。