com.hp.hpl.jena.sparql.core.Var.varNames()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(175)

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

Var.varNames介绍

[英]Return a list of String names from a collection of variables
[中]

代码示例

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
public List<String> getVarNames() {
  return Var.varNames(vars) ;
}

代码示例来源:origin: com.hp.hpl.jena/arq

public List<String> getVarNames()   { return Var.varNames(vars) ; }

代码示例来源:origin: com.hp.hpl.jena/arq

/** Return a list of the variables requested (SELECT) */
public List<String> getResultVars()
{ 
  // Ensure "SELECT *" processed
  setResultVars() ;
  return Var.varNames(projectVars.getVars()) ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

/** Return a list of the variables requested (SELECT) */
public List<String> getResultVars()
{ 
  // Ensure "SELECT *" processed
  setResultVars() ;
  return Var.varNames(projectVars.getVars()) ;
}

代码示例来源:origin: com.hp.hpl.jena/arq

public static void executeAlgebra(Op op, DatasetGraph dsg, ResultsFormat outputFormat)
{
  QueryIterator qIter = Algebra.exec(op, dsg) ;
  List<String> vars = null ;
  if ( op instanceof OpProject )
    vars = Var.varNames(((OpProject)op).getVars()) ;
  else
    // The variables defined in patterns (not Filters, nor NOT EXISTS, nor ORDER BY)
    vars = Var.varNames(OpVars.patternVars(op)) ;
  ResultSet results = ResultSetFactory.create(qIter, vars) ;
  outputResultSet(results, null, outputFormat) ;
 }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public static void execute(Op op, DatasetGraph dsg, ResultsFormat outputFormat)
{
  QueryIterator qIter = Algebra.exec(op, dsg) ;
  List<String> vars = null ;
  if ( op instanceof OpProject )
    vars = Var.varNames(((OpProject)op).getVars()) ;
  else
    // The variables defined in patterns (not Filters, nor NOT EXISTS, nor ORDER BY)
    vars = Var.varNames(OpVars.visibleVars(op)) ;
  ResultSet results = ResultSetFactory.create(qIter, vars) ;
  outputResultSet(results, null, outputFormat) ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public static ResultSet fromBIO(InputStream input)
  {
    // Scan the stream for VARS and accumulate the total variables. 
    // Trade off of guessing first line is all the VARS and coping with
    // anything possible.  -> Cope with anything possible.
    BindingInputStream bin = new BindingInputStream(input) ;
    List<Binding> bindings = new ArrayList<Binding>() ;
    List<Var> vars = new ArrayList<Var>() ;
    while(bin.hasNext())
    {
      Binding b = bin.next();
      bindings.add(b) ;
      for ( Var v : bin.vars() )
      {
        if ( ! vars.contains(v) )
          vars.add(v) ;
      }
    }
    QueryIterator qIter = new QueryIterPlainWrapper(bindings.iterator()) ;
    return new ResultSetStream(Var.varNames(vars), m, qIter) ;
  }
}

代码示例来源:origin: com.hp.hpl.jena/arq

public static ResultSet build(Item item)
  {
    BuilderLib.checkTagged(item, Tags.tagResultSet, "Not a (resultset ...)") ;
    ItemList list = item.getList() ; 
    
    List<Var> vars = BuilderNode.buildVarList(list.get(1)) ;
    // skip tag, skip vars.
    int start = 2 ;

    List<Binding> bindings = new ArrayList<Binding>() ;
    for ( int i = start ; i < list.size() ; i++ )
    {
      Item itemRow = list.get(i) ;
      Binding b = BuilderBinding.build(itemRow) ;
      bindings.add(b) ;
    }
    
    QueryIterator qIter = new QueryIterPlainWrapper(bindings.listIterator()) ;
    return new ResultSetStream(Var.varNames(vars), null, qIter) ;
  }
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

private SPARQLResult process(InputStream in, Model model)
{
  parse(in) ;
  if ( model == null )
    model = GraphFactory.makeJenaDefaultModel() ;
  if ( rows != null )
  {
    QueryIterator qIter = new QueryIterPlainWrapper(rows.iterator()) ;
    ResultSet rs = new ResultSetStream(Var.varNames(vars), model, qIter) ;
    super.set(rs) ;
  }
  else
    super.set(booleanResult) ;
  return this ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public static ResultSet build(Item item)
  {
    BuilderLib.checkTagged(item, Tags.tagResultSet, "Not a (resultset ...)") ;
    ItemList list = item.getList() ; 
    
    List<Var> vars = BuilderNode.buildVarList(list.get(1)) ;
    // skip tag, skip vars.
    int start = 2 ;

    List<Binding> bindings = new ArrayList<Binding>() ;
    for ( int i = start ; i < list.size() ; i++ )
    {
      Item itemRow = list.get(i) ;
      Binding b = BuilderBinding.build(itemRow) ;
      bindings.add(b) ;
    }
    
    QueryIterator qIter = new QueryIterPlainWrapper(bindings.listIterator()) ;
    return new ResultSetStream(Var.varNames(vars), null, qIter) ;
  }
}

代码示例来源:origin: com.hp.hpl.jena/tdb

private static ResultSet exec(String pattern, Graph graph)
{
  Op op = SSE.parseOp(pattern, pmap) ;
  List<Var> vars =  new ArrayList<Var>() ;
  vars.addAll(OpVars.allVars(op)) ;
  QueryIterator qIter = Algebra.exec(op, graph) ;
  return ResultSetFactory.create(qIter, Var.varNames(vars)) ;
}

相关文章