com.hp.hpl.jena.query.Query.serialize()方法的使用及代码示例

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

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

Query.serialize介绍

[英]Convert the query to a string
[中]将查询转换为字符串

代码示例

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

@Override
public void output(IndentedWriter out)
{
  serialize(out) ;
}

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

public void output(IndentedWriter out)
{
  serialize(out) ;
}

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

@Override
public String toString()
{ return serialize() ; }

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

public String toString() {
  return query.serialize(Syntax.syntaxSPARQL_11);
}
@Override

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

public String toString(Syntax syntax)
{ return serialize(syntax) ; }

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

@Override
public String toString()
{ return serialize() ; }

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

public String toString(Syntax syntax)
{ return serialize(syntax) ; }

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

public static void printQuery(IndentedWriter out, Query query, Syntax syntax)
{
  query.serialize(out, syntax) ;
  out.flush() ;
}

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

public static void printQuery(IndentedWriter out, Query query, Syntax syntax)
{
  query.serialize(out, syntax) ;
  out.flush() ;
}

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

/** Convert the query to a string */

public String serialize()
{
  IndentedLineBuffer buff = new IndentedLineBuffer() ;
  serialize(buff) ;
  return buff.toString();
}

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

/** Convert the query to a string in the given syntax
 * @param syntax
 */

public String serialize(Syntax syntax)
{
  IndentedLineBuffer buff = new IndentedLineBuffer() ;
  serialize(buff, syntax) ;
  return buff.toString();
}

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

/** Convert the query to a string */

public String serialize()
{
  IndentedLineBuffer buff = new IndentedLineBuffer() ;
  serialize(buff) ;
  return buff.toString();
}

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

/** Convert the query to a string in the given syntax
 * @param syntax
 */

public String serialize(Syntax syntax)
{
  IndentedLineBuffer buff = new IndentedLineBuffer() ;
  serialize(buff, syntax) ;
  return buff.toString();
}

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

public ConjunctiveQuery(Query q) {
  if (!q.isSelectType()) {
    throw new RuntimeException("A conjunctive query can only be created from a select query: "+q.serialize(Syntax.syntaxSPARQL_11));
  }
  query = q;
  setQueryPattern(q.getQueryPattern());
}

代码示例来源:origin: anno4j/anno4j

/**
   * Reformats the SPARQL query for logging purpose
   *
   * @param sparql The generated SPARQL query
   *
   * @return Formatted query
   */
  public String prettyPrint(String sparql) {
    return OpAsQuery.asQuery(Algebra.compile(QueryFactory.create(sparql))).serialize();
  }
}

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

public void visit(ElementSubQuery el)
{
  out.print("{ ") ;
  out.incIndent(INDENT) ;
  // Messy - prefixes.
  el.getQuery().serialize(out) ;
  out.decIndent(INDENT) ;
  out.print("}") ;
}

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

public Query cloneQuery()
{
  // A little crude.
  IndentedLineBuffer buff = new IndentedLineBuffer() ;
  serialize(buff, getSyntax()) ;
  String qs = buff.toString() ;
  return QueryFactory.create(qs, getSyntax()) ;
}

代码示例来源:origin: anno4j/anno4j

/**
 * Optimizes the join order of the query
 *
 * @param sparql The SPARQL query
 *
 * @return The optimized SPARQL query
 */
public String optimizeJoinOrder(String sparql) {
  Op op = Algebra.compile(QueryFactory.create(sparql));
  Transform joinReorder = new TransformJoinStrategy();
  op = Transformer.transform(joinReorder, op);
  return OpAsQuery.asQuery(op).serialize();
}

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

public static void explain(String message, Query query, Context context)
{
  if ( explaining(InfoLevel.INFO, logExec, context) )
  {
    // One line or indented multiline format
    IndentedLineBuffer iBuff = new IndentedLineBuffer() ;
    if ( true )
      iBuff.incIndent() ;
    else
      iBuff.setFlatMode(true) ;
    query.serialize(iBuff) ;
    String x = iBuff.asString() ;
    _explain(logExec, message, x, true) ;
  }
}

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

public static void explain(String message, Query query, Context context)
{
  if ( explaining(InfoLevel.INFO, logExec, context) )
  {
    // One line or indented multiline format
    IndentedLineBuffer iBuff = new IndentedLineBuffer() ;
    if ( true )
      iBuff.incIndent() ;
    else
      iBuff.setFlatMode(true) ;
    query.serialize(iBuff) ;
    String x = iBuff.asString() ;
    _explain(logExec, message, x, true) ;
  }
}

相关文章