com.hp.hpl.jena.graph.Triple.toString()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(165)

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

Triple.toString介绍

[英]return a human-readable string "subject @predicate object" describing the triple
[中]返回一个人类可读的字符串“subject@predicate object”,描述三元组

代码示例

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

public UpdateDeniedException( String message, Triple triple )
  { 
  super( message + triple.toString() ); 
  this.triple = triple;
  }

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

/**
  return a human-readable string "subject @predicate object" describing the triple
*/
@Override
public String toString()
  { return toString( PrefixMapping.Standard ); }

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

@Override
public void triple(int line, int col, Triple triple)
{
  System.out.print(mark(line, col)) ;
  System.out.print(" ") ;
  System.out.println(triple.toString()) ;
}

代码示例来源:origin: com.marklogic/marklogic-spring-batch

/**
 * Uses the graph that was created to add the triple and either merges or adds based on the 
 * availability of the graph node
 * @param rdfTriple
 * @param graph
 */
private void writeRecords(Triple rdfTriple, Graph graph) {
  // Add triple to the graph
  graph.add(rdfTriple);
  if (dsg.containsGraph(graphNode))
  {
    logger.debug("Yes, we have this graphNode in MarkLogic");
    logger.debug("Triple [" + rdfTriple.toString() + "]");
    dsg.mergeGraph(graphNode, graph);
  }
  else
  {   
    logger.debug("Store the graph in MarkLogic.");
    dsg.addGraph(graphNode, graph);
  }
}

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

/**
   Answer a human-consumable representation of <code>that</code>. The 
   string <code>prefix</code> will appear near the beginning of the string. Nodes
   may be prefix-compressed using <code>that</code>'s prefix-mapping. This
   default implementation will display all the triples exposed by the graph (ie
   including reification triples if it is Standard).
*/
public static String toString( String prefix, Graph that )
  {
  PrefixMapping pm = that.getPrefixMapping();
  StringBuffer b = new StringBuffer( prefix + " {" );
  int count = 0;
  String gap = "";
  ClosableIterator<Triple> it = GraphUtil.findAll( that );
  while (it.hasNext() && count < TOSTRING_TRIPLE_LIMIT) 
    {
    b.append( gap );
    gap = "; ";
    count += 1;
    b.append( it.next().toString( pm ) );
    } 
  if (it.hasNext()) b.append( "..." );
  it.close();
  b.append( "}" );
  return b.toString();
  }

代码示例来源:origin: epimorphics/elda

private String show( Model m, PrefixMapping pm ) {
  StringBuilder sb = new StringBuilder();
  sb.append( "\n" );
  for (Statement s: m.listStatements().toList()) {
    sb.append( "  " ).append( s.asTriple().toString( pm ) ).append( "\n" );
  }
  return sb.toString();
}

相关文章