com.hp.hpl.jena.rdf.model.Model.getAnyReifiedStatement()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中com.hp.hpl.jena.rdf.model.Model.getAnyReifiedStatement()方法的一些代码示例,展示了Model.getAnyReifiedStatement()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.getAnyReifiedStatement()方法的具体详情如下:
包路径:com.hp.hpl.jena.rdf.model.Model
类名称:Model
方法名:getAnyReifiedStatement

Model.getAnyReifiedStatement介绍

[英]Find or create a ReifiedStatement corresponding to a Statement.
[中]查找或创建与语句相对应的具体语句。

代码示例

代码示例来源:origin: fr.inria.eventcloud/eventcloud-api

/**
 * {@inheritDoc}
 */
@Override
public Resource getAnyReifiedStatement(Statement s) {
  return super.object.getAnyReifiedStatement(s);
}

代码示例来源:origin: bio2rdf/bio2rdf-scripts

public Resource getAnyReifiedStatement(Statement s) {
  return model.getAnyReifiedStatement(s);
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-relations-jena-plugin

stmts.add(jenaStmt);
com.hp.hpl.jena.graph.Node reifiedStmt = graph.getAnyReifiedStatement(jenaStmt).asNode();
for (Map.Entry<Resource, Node[]> property : properties.entrySet()) {
  com.hp.hpl.jena.graph.Node prop = getJenaNode(property.getKey());

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-relations-jena-plugin

/**
 * Gets NXRelations statement corresponding to the Jena statement.
 * <p>
 * Reified statements may be retrieved from the Jena graph and set as properties on NXRelations statements.
 *
 * @param graph the jena graph
 * @param jenaStatement jena statement
 * @return NXRelations statement
 */
private Statement getNXRelationsStatement(Model graph, com.hp.hpl.jena.rdf.model.Statement jenaStatement) {
  Node subject = getNXRelationsNode(jenaStatement.getSubject().asNode());
  Node predicate = getNXRelationsNode(jenaStatement.getPredicate().asNode());
  Node object = getNXRelationsNode(jenaStatement.getObject().asNode());
  Statement statement = new StatementImpl(subject, predicate, object);
  // take care of properties
  if (graph.isReified(jenaStatement)) {
    com.hp.hpl.jena.rdf.model.Resource reifiedStmt = graph.getAnyReifiedStatement(jenaStatement);
    StmtIterator it = reifiedStmt.listProperties();
    while (it.hasNext()) {
      com.hp.hpl.jena.rdf.model.Statement stmt = it.nextStatement();
      Node nuxNode = getNXRelationsNode(stmt.getPredicate().asNode());
      // ugly cast as a Resource
      Node value = getNXRelationsNode(stmt.getObject().asNode());
      statement.addProperty((Resource) nuxNode, value);
    }
  }
  return statement;
}

相关文章

Model类方法