本文整理汇总了Java中com.hp.hpl.jena.sparql.core.TriplePath类的典型用法代码示例。如果您正苦于以下问题:Java TriplePath类的具体用法?Java TriplePath怎么用?Java TriplePath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TriplePath类属于com.hp.hpl.jena.sparql.core包,在下文中一共展示了TriplePath类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: queryWalker
import com.hp.hpl.jena.sparql.core.TriplePath; //导入依赖的package包/类
public void queryWalker() {
Query q = QueryFactory.create(query);
// This will walk through all parts of the query
ElementWalker.walk(q.getQueryPattern(),
// For each element...
new ElementVisitorBase() {
// ...when it's a block of triples...
public void visit(ElementPathBlock el) {
// ...go through all the triples...
Iterator<TriplePath> triples = el.patternElts();
while (triples.hasNext()) {
// ...and grab the subject
// if (triples.next().getObject().isLiteral()) {
// literalsList.add(triples.next().getObject()
// .getLiteralLexicalForm());
// }
System.out.println(triples.next().getSubject());
}
}
});
}
开发者ID:SaudAljaloud,项目名称:RdfLiteralStats,代码行数:24,代码来源:JenaTesting.java
示例2: addStreamOp
import com.hp.hpl.jena.sparql.core.TriplePath; //导入依赖的package包/类
private void addStreamOp(ArrayList<OpStream> streamOps,
ElementGroup group, Node graphNode, Window window) {
for (Element el : group.getElements()) {
if (el instanceof ElementTriplesBlock) {
addStreamOp(streamOps, (ElementTriplesBlock) el, graphNode, window);
}
if (el instanceof ElementPathBlock) {
for (Iterator<TriplePath> paths = ((ElementPathBlock) el).patternElts(); paths.hasNext();) {
Triple t = paths.next().asTriple();
if (t != null) {
streamOps.add(new OpStream(graphNode, t, window));
} else {
System.out.println("Path is not supported");
}
}
} else {
System.out.println("unrecognized block" + el.getClass());
}
}
}
开发者ID:KMax,项目名称:cqels,代码行数:21,代码来源:HeuristicRoutingPolicy.java
示例3: evaluate
import com.hp.hpl.jena.sparql.core.TriplePath; //导入依赖的package包/类
@Override
public Var evaluate(NodeSelector nodeSelector, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) {
ReversePropertySelector reversePropertySelector = (ReversePropertySelector) nodeSelector;
Var id = Var.alloc(VarIDGenerator.createID());
ElementPathBlock epb = new ElementPathBlock();
epb.addTriple(new TriplePath(var.asNode(), new P_Inverse(new P_Link(NodeFactory.createURI(reversePropertySelector.getProperty().toString()))), id.asNode()));
ElementGroup group = new ElementGroup();
group.addElement(epb);
elementGroup.addElement(group);
return id;
}
开发者ID:anno4j,项目名称:anno4j,代码行数:12,代码来源:ReversePropertySelectorEvaluator.java
示例4: pathPattern
import com.hp.hpl.jena.sparql.core.TriplePath; //导入依赖的package包/类
@Override
public Table pathPattern(TriplePath triplePath)
{
// Shudder - this may well be expensive, but this is the simple evaluator, written for correctness.
QueryIterator qIter = new QueryIterPath(triplePath,
QueryIterRoot.create(execCxt),
execCxt) ;
return TableFactory.create(qIter) ;
}
开发者ID:peterjohnlawrence,项目名称:com.inova8.remediator,代码行数:10,代码来源:EvaluatorSimple.java
示例5: pathPattern
import com.hp.hpl.jena.sparql.core.TriplePath; //导入依赖的package包/类
public Table pathPattern(TriplePath triplePath) ;
开发者ID:peterjohnlawrence,项目名称:com.inova8.remediator,代码行数:2,代码来源:Evaluator.java
注:本文中的com.hp.hpl.jena.sparql.core.TriplePath类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论