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

x33g5p2x  于2022-01-20 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(154)

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

Graph.isEmpty介绍

[英]Answer true iff this graph is empty. "Empty" means "has as few triples as it can manage", because an inference graph may have irremovable axioms and their consequences.
[中]如果此图为空,则回答true。“空”意味着“有尽可能少的三元组”,因为推理图可能有不可移动的公理及其结果。

代码示例

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

@Override
public boolean isEmpty()
{
  return graph.isEmpty() ;
}

代码示例来源:origin: net.sourceforge.owlapi/pellet-jena-ignazio1977

/**
 * {@inheritDoc}
 */
@Override
public boolean isEmpty() {
  for (final Graph g : m_subGraphs) {
    if( !g.isEmpty() )
      return false;
  }
  
  return true;
}

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

@Override
public boolean isEmpty()
{ return base.isEmpty(); }

代码示例来源:origin: org.appdapter/org.appdapter.lib.remote

@Override public boolean isEmpty() {
  return g.isEmpty();
}

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

@Override
public boolean isEmpty()
{ return graph.isEmpty(); }

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

/**
  Answer true iff this graph is empty. [Used to be in QueryHandler, but moved in
  here because it's a more primitive operation.]
*/
@Override
public boolean isEmpty() {
  return fdata.getGraph().isEmpty();
}

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

private void clearGraph(Graph graph) {
  if ( !graph.isEmpty() )
    graph.clear() ;
}

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

private void write(Graph graph)
  {
    writeBase(baseURI) ;
    writePrefixes(prefixMap) ;
    if ( ! prefixMap.isEmpty() && !graph.isEmpty() )
      out.println() ;
    writeGraphTTL(graph) ;
  }
}

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

@Override
public Model load(String uri) {
  Node graphNode = NodeFactory.createURI(uri);
  DatasetGraphAccessor accessor = this.getAccessor();
  Graph g = accessor.httpGet(graphNode);
  if (g == null || g.isEmpty()) {
    return null;
  }
  GraphStore gs = GraphStoreFactory.create(g);
  Dataset ds = gs.toDataset();
  Model m = ds.getDefaultModel();
  return m;
}

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

@Test public void load_dataset_01()
{
  DatasetGraphTDB dsg = TDBFactory.createDatasetGraph() ;
  TDBLoader.load(dsg, DIR+"data-1.nq", false) ;
  assertTrue(dsg.getDefaultGraph().isEmpty()) ;
  assertEquals(1, dsg.getGraph(g).size()) ;
}

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

@Test public void load_dataset_02()
{
  DatasetGraphTDB dsg = TDBFactory.createDatasetGraph() ;
  InputStream in = IO.openFile(DIR+"data-1.nq") ;
  TDBLoader.load(dsg, in, false) ;
  assertTrue(dsg.getDefaultGraph().isEmpty()) ;
  assertEquals(1, dsg.getGraph(g).size()) ;
}

相关文章