org.apache.jena.query.Query.getResultURIs()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(154)

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

Query.getResultURIs介绍

[英]Get the result list (things wanted - not the results themselves) of a DESCRIBE query.
[中]获取描述查询的结果列表(需要的东西,而不是结果本身)。

代码示例

代码示例来源:origin: apache/jena

@Override
public void visitDescribeResultForm(Query query)
{
  x ^= query.getResultVars().hashCode() ;
  x ^= query.getResultURIs().hashCode() ;
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

public static Node extractDescribeNode(Query query) {
  if (!query.isDescribeType()) {
    throw new RuntimeException("DESCRIBE query expected. Got: ["
        + query.toString() + "]");
  }
  // TODO Right now we only support describe with a single constant.
  //Element queryPattern = query.getQueryPattern();
  if(query.getQueryPattern() != null || !query.getResultVars().isEmpty() || query.getResultURIs().size() > 1) {
    throw new RuntimeException("Sorry, DESCRIBE is only implemented for a single resource argument");
  }
  Node result = query.getResultURIs().get(0);
  return result;
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

public static Query describe(Node node) {
  Query query = QueryFactory.create();
  query.setQueryDescribeType();
  query.getResultURIs().add(node);
  return query;
}

代码示例来源:origin: apache/jena

@Override
public void visitDescribeResultForm(Query query) {
  newQuery.setQueryDescribeType();
  for (Node x : query.getResultURIs())
    newQuery.addDescribeNode(x);
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

@Override
public void visitDescribeResultForm(Query query) {
  newQuery.setQueryDescribeType() ;
  for (Node x : query.getResultURIs())
    newQuery.addDescribeNode(x) ;
}

代码示例来源:origin: apache/jena

@Override
public void visitDescribeResultForm(Query query1)
{
  check("Not both DESCRIBE queries", query2.isDescribeType()) ;
  check("Result variables", 
     query1.getResultVars(), query2.getResultVars() ) ;
  check("Result URIs", 
     query1.getResultURIs(), query2.getResultURIs() ) ;
  
}

代码示例来源:origin: apache/jena

@Override
public void visitDescribeResultForm(Query query)
{
  out.print("DESCRIBE ") ;
  
  if ( query.isQueryResultStar() )
    out.print("*") ;
  else
  {
    appendVarList(query, out, query.getResultVars()) ;
    if ( query.getResultVars().size() > 0 &&
       query.getResultURIs().size() > 0 )
      out.print(" ") ;
    appendURIList(query, out, query.getResultURIs()) ;
  }
  out.newline() ;
}

代码示例来源:origin: apache/jena

if ( query.getResultURIs() != null ) {
  for ( Node n : query.getResultURIs() ) {

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

Describer tmp = Describer.create(query.getResultURIs(), query.getResultVars(), rs, parentFactory);

相关文章