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

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

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

Var.getName介绍

暂无

代码示例

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

/** @return Returns the name. */
@Override
public String getVarName()  { return varNode.getName() ; }
@Override

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

/** @return Returns the name. */
@Override
public String getVarName()  { return varNode.getName() ; }
@Override

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

public String getVarName() { return getName() ; }

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

public String getVarName() { return getName() ; }

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

@Override
  public int compare(Var o1, Var o2)
  {
    return o1.getName().compareTo(o2.getName());
  }
};

代码示例来源:origin: Quetzal-RDF/quetzal

public static Set<String> getVars(Set<Var> vars) {
  Set<String> ret = new HashSet<String>();
  for (Var v: vars) {
    ret.add(v.getName());
  }
  return ret;
}
public static Set<String> getVariables(Set<Variable> vars) {

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

/** Given an old name, and some names already in use, pick a fresh, new name*/ 
public static Var chooseVarName(Var var, Collection<Var> inUse, String prefix)
{
  Var var2 = var ;
  do {
    var2 = Var.alloc(prefix+var2.getName()) ;
  } while (inUse.contains(var2)) ;    
  return var2 ;
}

代码示例来源:origin: Quetzal-RDF/quetzal

protected Set<String> getMultipleOccurrenceVars(MultiSet<Var> vars) {
  Set<String> ret = new HashSet<String>();
  for (Var v: vars) {
    if (vars.getCount(v)>1) {
      ret.add(v.getName());
    }
  }
  return ret;
}
protected Set<String> getVars(Set<Var> vars) {

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

public boolean isAllocVar() { return isAllocVarName(getName()) ; }

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

public boolean isBlankNodeVar() { return isBlankNodeVarName(getName()) ; }

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

public boolean isAllocVar() { return isAllocVarName(getName()) ; }

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

public boolean isNamedVar() { return isNamedVarName(getName()) ; }

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

public boolean isBlankNodeVar() { return isBlankNodeVarName(getName()) ; }

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

public boolean isNamedVar() { return isNamedVarName(getName()) ; }

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

public Node convert(Node node)
  {
    if ( ! Var.isVar(node) ) return node ;
    // Remove the prefix, repeatedly. 
    Var var = (Var)node ;
    String varName = var.getName() ;
    
    if ( repeatedly )
    {
      while ( varName.startsWith(varPrefix) )
        varName = varName.substring(varPrefix.length()) ;
    }
    else
    {
      if ( varName.startsWith(varPrefix) )
        varName = varName.substring(varPrefix.length()) ;
    }
      
    if ( varName == var.getName() )
      return node ;
    return Var.alloc(varName) ;
  }
}

代码示例来源:origin: Quetzal-RDF/quetzal

@Override
  public Node convert(Node node) {
    if (!Var.isVar(node))
      return node;
    Var var = (Var) node;
    Var var2 = aliases.get(var);
    if (var2 != null)
      return var2;
    String name = var.getName();
    var2 = Var.alloc(name + "_" + count);
    count++;
    aliases.put(var, var2);
    return var2;
  }
}

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

public void format(Query query, IndentedWriter out)
{
  out.print('?') ;
  out.print(varNode.getName()) ;
}

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

public void format(Query query, IndentedWriter out)
{
  out.print('?') ;
  out.print(varNode.getName()) ;
}

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

static protected void addBinding(Binding binding, Var var, Node value)
{
  Node n = binding.get(var) ;
  if ( n != null )
  {
    // Same - silently skip.
    if ( n.equals(value) )
      return ;
    Log.warn(SPARQLResult.class, 
         String.format("Multiple occurences of a binding for variable '%s' with different values - ignored", var.getName())) ;
    return ;
  }
  binding.add(var, value) ;
}

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

static protected void addBinding(BindingMap binding, Var var, Node value)
{
  Node n = binding.get(var) ;
  if ( n != null )
  {
    // Same - silently skip.
    if ( n.equals(value) )
      return ;
    Log.warn(SPARQLResult.class, 
         String.format("Multiple occurences of a binding for variable '%s' with different values - ignored", var.getName())) ;
    return ;
  }
  binding.add(var, value) ;
}

相关文章