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

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

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

Var.isNamedVar介绍

暂无

代码示例

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

@Override
  protected boolean accept(Var var) {
    return var.isNamedVar() ;
  }
}

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

@Override
public Node get(Var var)
{
  if ( ! var.isNamedVar() )
    return null ;
  return binding.get(var) ;
}

代码示例来源:origin: com.github.ansell.pellet/pellet-query

public static boolean isDistinguishedVariable(final Node node) {
  return Var.isVar( node )
      && (Var.isNamedVar( node ) || PelletOptions.TREAT_ALL_VARS_DISTINGUISHED);
}

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

@Override
public Iterator<Var> vars()
{
  List<Var> x = new ArrayList<Var>() ;
  for ( Iterator<Var> iter = getWrapped().vars() ; iter.hasNext() ; )
  {
    Var var = iter.next() ;
    if ( ! var.isNamedVar() )
      continue ;
    x.add(var) ;
  }
  
  return x.iterator() ;
}

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

private void findAndAddNamedVars()
{
  Iterator<Var> varIter = null ;
  if ( hasGroupBy() )
    varIter = groupVars.getVars().iterator() ;
  else
  {
    // Binding variables -- in patterns, not in filters and not in EXISTS
    LinkedHashSet<Var> queryVars = new LinkedHashSet<Var>() ;
    PatternVars.vars(queryVars, this.getQueryPattern()) ;
    if ( this.hasBindings() )
      queryVars.addAll(getBindingVariables()) ;
    
    varIter = queryVars.iterator() ;
  }
  
  // All query variables, including ones from bNodes in the query.
  
  for ( ; varIter.hasNext() ; )
  {
    Object obj = varIter.next() ;
    //Var var = (Var)iter.next() ;
    Var var = (Var)obj ;
    if ( var.isNamedVar() )
      addResultVar(var) ;
  }
}

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

private void findAndAddNamedVars()
  {
    Iterator<Var> varIter = null ;
    if ( hasGroupBy() )
      varIter = groupVars.getVars().iterator() ;
    else
    {
      // Binding variables -- in patterns, not in filters and not in EXISTS
      LinkedHashSet<Var> queryVars = new LinkedHashSet<Var>() ;
      PatternVars.vars(queryVars, this.getQueryPattern()) ;
      if ( this.hasValues() )
        queryVars.addAll(getValuesVariables()) ;
//            if ( this.hasValues() )
//                queryVars.addAll(getValuesVariables()) ;
      varIter = queryVars.iterator() ;
    }
    
    // All query variables, including ones from bNodes in the query.
    
    for ( ; varIter.hasNext() ; )
    {
      Object obj = varIter.next() ;
      //Var var = (Var)iter.next() ;
      Var var = (Var)obj ;
      if ( var.isNamedVar() )
        addResultVar(var) ;
    }
  }

相关文章