本文整理汇总了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;
}
示例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());
}
示例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();
}
示例4: createVariableNode
import com.hp.hpl.jena.graph.NodeFactory; //导入方法依赖的package包/类
public Node createVariableNode() {
return NodeFactory.createVariable(getName());
}
示例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);
}