• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java NodeValueNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode的典型用法代码示例。如果您正苦于以下问题:Java NodeValueNode类的具体用法?Java NodeValueNode怎么用?Java NodeValueNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NodeValueNode类属于com.hp.hpl.jena.sparql.expr.nodevalue包,在下文中一共展示了NodeValueNode类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testDataType

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
public void testDataType()
{
	List<Triple> pattern = new ArrayList<Triple>();
	pattern.add(Triple.create(Node.createVariable("s"), Node.createURI("http://example.org/value"), Node.createVariable("o")));
	NodeRelation[] rels = translate(pattern, "optimizer/filtertests.n3");
	
	NodeRelation intvalue = search("table2", "intvalue", rels);
	NodeRelation value = search("table2", "value", rels);
	
	pattern.clear();
	pattern.add(Triple.create(Node.createVariable("s"), RDFS.label.asNode(), Node.createVariable("o")));
	rels = translate(pattern, "optimizer/filtertests.n3");
	
	NodeRelation langliteral = search("table1", "label_en", rels);
	
	Expr filterint    = new E_Equals(new E_Datatype(new ExprVar("o")), NodeValueNode.makeNode(Node.createURI(XSDDatatype.XSDint.getURI())));
	Expr filterstring = new E_Equals(new E_Datatype(new ExprVar("o")), NodeValueNode.makeNode(Node.createURI(XSDDatatype.XSDstring.getURI())));
	
	assertEquals("DATATYPE(intliteral) = xsd:int should be TRUE",       Expression.TRUE, TransformExprToSQLApplyer.convert(filterint, intvalue));
	assertEquals("DATATYPE(simpleliteral) = xsd:string should be TRUE", Expression.TRUE, TransformExprToSQLApplyer.convert(filterstring, value));
	assertEquals("DATATYPE(langliteral) = xsd:string should be TRUE",   Expression.TRUE, TransformExprToSQLApplyer.convert(filterstring, langliteral));
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:23,代码来源:ExprTransformTest2.java


示例2: TermConstructorConverter

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
public TermConstructorConverter(TermConstructorType type, List<Expr> exprs) {
    this.type = type;

    if (type.equals(TermConstructorType.typedLiteral)) {
        Node dtype = ((NodeValueNode) exprs.get(2)).getNode();
        this.dtype = ResourceFactory.createResource(((Node_URI) dtype).getURI());
    } else {
        this.dtype = null;
    }

    String langStr = ((NodeValueString) exprs.get(1)).asString();

    if (type.equals(TermConstructorType.plainLiteral) && !langStr.isEmpty()) {
        this.langStr = langStr;
    } else {
        this.langStr = null;
    }
    this.expr = exprs.get(0);
}
 
开发者ID:AKSW,项目名称:sml-converters,代码行数:20,代码来源:TermConstructorConverter.java


示例3: evaluate

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
@Override
public Expr evaluate(NodeTest nodeTest, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) {
    IsATest isATest = (IsATest) nodeTest;
    Var tmpVar = Var.alloc(Var.alloc(VarIDGenerator.createID()));
    elementGroup.addTriplePattern(new Triple(var.asNode(), RDF.type.asNode(), tmpVar.asNode()));
    return new E_Equals(new ExprVar(tmpVar.asNode()), new NodeValueNode(NodeFactory.createURI(isATest.getPathExpression(new SesameValueBackend()).replace("<", "").replace(">", "").replaceFirst("is-a ", ""))));
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:8,代码来源:IsATestEvaluator.java


示例4: evaluate

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
@Override
public Expr evaluate(NodeTest nodeTest, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) {
    PathEqualityTest pathEqualityTest = (PathEqualityTest) nodeTest;
    Var tmpVar =  LDPathEvaluator.evaluate(pathEqualityTest.getPath(), elementGroup, var, evaluatorConfiguration);
    if(pathEqualityTest.getNode() instanceof org.openrdf.model.impl.LiteralImpl) {
        return new E_Equals(new ExprVar(tmpVar.asNode()), new NodeValueNode(NodeFactory.createLiteral(((LiteralImpl) pathEqualityTest.getNode()).getLabel().toString())));
    } else {
        return new E_Equals(new ExprVar(tmpVar.asNode()), new NodeValueNode(NodeFactory.createURI(pathEqualityTest.getNode().toString())));
    }
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:11,代码来源:PathEqualityTestEvaluator.java


示例5: evaluate

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
@Override
public Var evaluate(NodeSelector nodeSelector, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) {
    UnionSelector unionSelector = (UnionSelector) nodeSelector;

    NodeSelector nodeSelectorLeft = unionSelector.getLeft();
    NodeSelector nodeSelectorRight = unionSelector.getRight();

    ElementGroup leftGroup = new ElementGroup();
    ElementGroup rightGroup = new ElementGroup();

    Var leftVar = LDPathEvaluator.evaluate(nodeSelectorLeft, leftGroup, var, evaluatorConfiguration);
    Var rightVar = LDPathEvaluator.evaluate(nodeSelectorRight, rightGroup, var, evaluatorConfiguration);

    Var subVar = Var.alloc(VarIDGenerator.createID());

    Query leftSubQuery = new Query();
    leftGroup.addElement(new ElementBind(subVar, new NodeValueNode(leftVar.asNode())));
    leftSubQuery.setQueryPattern(leftGroup);
    leftSubQuery.addResultVar(var);
    leftSubQuery.addResultVar(subVar);
    leftSubQuery.setQuerySelectType();
    ElementSubQuery leftESubQuery = new ElementSubQuery(leftSubQuery);

    Query rightSubQuery = new Query();
    rightGroup.addElement(new ElementBind(subVar, new NodeValueNode(rightVar.asNode())));
    rightSubQuery.setQueryPattern(rightGroup);
    rightSubQuery.addResultVar(var);
    rightSubQuery.addResultVar(subVar);
    rightSubQuery.setQuerySelectType();
    ElementSubQuery rightESubQuery = new ElementSubQuery(rightSubQuery);


    ElementUnion elementUnion = new ElementUnion();

    elementUnion.addElement(leftESubQuery);
    elementUnion.addElement(rightESubQuery);
    elementGroup.addElement(elementUnion);

    return subVar;
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:41,代码来源:UnionSelectorEvaluator.java


示例6: adapt

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
@Override
protected SparqlQueryBuilder adapt(SparqlQueryBuilder builder) {
  builder = builder.addResultVariable(
      Nodes.CONCEPT.getNode(0).getName(),
      new NodeValueNode(rootNode)).addResultVariable(Nodes.CONCEPT.getLabelNode(0));
  for (int currentIndex = 1; currentIndex <= depth; currentIndex++) {
    builder = addResultVariables(builder, currentIndex);
  }
  return builder;
}
 
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:11,代码来源:RelativeNeighbourhoodQueryBuilder.java


示例7: adapt

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
@Override
protected SparqlQueryBuilder adapt(SparqlQueryBuilder builder) {
  return builder
      .addResultVariable(CONCEPT.getName(), new NodeValueNode(createURI(getConceptUri())))
      .addResultVariable(PREDICATE)
      .addResultVariable(OBJECT)
      .addResultVariable(SOURCE);
}
 
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:9,代码来源:SourceExplanationQueryBuilder.java


示例8: createUriValueNode

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
public NodeValueNode createUriValueNode() {
  return new NodeValueNode(createUriNode());
}
 
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:4,代码来源:SparqlNodes.java


示例9: create

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
@Override
public Expr create(String value) {
  return new E_Equals(uri, new NodeValueNode(createURI(value)));
}
 
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:5,代码来源:SparqlUriExpression.java


示例10: createDifferentNodesExpression

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
private E_NotEquals createDifferentNodesExpression(Node left, Node right) {
  return new E_NotEquals(new NodeValueNode(left), new NodeValueNode(right));
}
 
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:4,代码来源:RelativeNeighbourhoodQueryBuilder.java


示例11: getConceptUriExpr

import com.hp.hpl.jena.sparql.expr.nodevalue.NodeValueNode; //导入依赖的package包/类
protected NodeValueNode getConceptUriExpr() {
  return new NodeValueNode(getConceptUriNode());
}
 
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:4,代码来源:AbstractExplanationQueryBuilder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ILuaObject类代码示例发布时间:2022-05-22
下一篇:
Java LogsResource类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap