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


Java NodeFactory.createVariable方法代码示例

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


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

示例1: transformPathToBasicPattern

import com.hp.hpl.jena.graph.NodeFactory; //导入方法依赖的package包/类
public static BasicPattern transformPathToBasicPattern(Node subject, String sPath, Node object){
	BasicPattern res= new BasicPattern();
	boolean inverse = checkInverse(sPath);
	if (inverse)
	{
		sPath = sPath.substring(1);
		Node temp = subject;
		subject = object;
		object = temp;
	}
	sPath = TransformerHelper.removeScopes(sPath);
	int operatorPos = TransformerHelper.getPosOfNextOperator(sPath);
	if (operatorPos < 0)
	{
		Triple triple = new Triple(subject, NodeFactory.createURI(sPath.substring(1, sPath.length()-1)), object);
		res.add(triple);
		return res;
	}
   	String leftStringPath = sPath.substring(0, operatorPos);
   	String rightStringPath = sPath.substring(operatorPos+1);
   	Node newConection = NodeFactory.createVariable(getNextVaribleName());
   	BasicPattern leftPattern = transformPathToBasicPattern(subject, leftStringPath, newConection);
   	BasicPattern rightPattern = transformPathToBasicPattern(newConection, rightStringPath, object);
   	res.addAll(leftPattern);
   	res.addAll(rightPattern);
	return res;
}
 
开发者ID:aschaetzle,项目名称:S2RDF,代码行数:28,代码来源:TransformerHelper.java

示例2: createIsMaterializedConceptTriple

import com.hp.hpl.jena.graph.NodeFactory; //导入方法依赖的package包/类
private Triple createIsMaterializedConceptTriple(int level) {
  Node anonymousNode = NodeFactory.createVariable("a" + level); //$NON-NLS-1$
  return Triple.create(
      Nodes.CONCEPT.getNode(level),
      anonymousNode,
      SparqlNodes.CONCEPT.createUriNode());
}
 
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:8,代码来源:RelativeNeighbourhoodQueryBuilder.java

示例3: createQuery

import com.hp.hpl.jena.graph.NodeFactory; //导入方法依赖的package包/类
private Query createQuery(String uri) {
  Node label = NodeFactory.createVariable(LABEL);
  Element body = createGroup()
      .add(createSchemeTriple(createURI(uri), IN_SCHEME))
      .add(createSourceTriple(IN_SCHEME, label))
      .build();
  return createSelectDistinctQuery().addResultVariable(label).withBody(body).getQuery();
}
 
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:9,代码来源:ConceptUriSourceLabelProvider.java

示例4: createVariableNode

import com.hp.hpl.jena.graph.NodeFactory; //导入方法依赖的package包/类
public Node createVariableNode() {
  return NodeFactory.createVariable(getName());
}
 
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:4,代码来源:SparqlNodes.java

示例5: TopMostConceptSparqlQueryBuilder

import com.hp.hpl.jena.graph.NodeFactory; //导入方法依赖的package包/类
private TopMostConceptSparqlQueryBuilder(String schemeLabel, String topMostConceptLabel) {
  this.schemeLabel = NodeFactory.createVariable(schemeLabel);
  this.topMostConceptLabel = NodeFactory.createVariable(topMostConceptLabel);
}
 
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:5,代码来源:TopMostConceptSparqlQueryBuilder.java


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