org.apache.jena.graph.Graph.getStatisticsHandler()方法的使用及代码示例

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

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

Graph.getStatisticsHandler介绍

[英]Answer this Graph's statistics handler, or null if there isn't one. Every call to this method on a particular graph delivers the same (==) answer.
[中]回答此图的统计处理程序,如果没有,则回答null。在特定图形上对该方法的每次调用都会提供相同的(=)答案。

代码示例

代码示例来源:origin: apache/jena

@Override
public GraphStatisticsHandler getStatisticsHandler()
{
  return graph.getStatisticsHandler() ;
}

代码示例来源:origin: apache/jena

@Override
public GraphStatisticsHandler getStatisticsHandler()
{ return base.getStatisticsHandler(); }

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

@Override
public long getStatistic( Node S, Node P, Node O )
  {
  long result = 0;
  for (int i = 0; i < mu.m_subGraphs.size(); i += 1)
    {
    Graph g = mu.m_subGraphs.get( i );
    GraphStatisticsHandler s = g.getStatisticsHandler();
    long n = s.getStatistic( S, P, O );
    if (n < 0) return n;
    result += n;
    }
  return result;
  }

代码示例来源:origin: vivo-project/Vitro

@Override
public GraphStatisticsHandler getStatisticsHandler() {
  try {
    regenerateIfClosed();
    sendTestQuery();
    return g.getStatisticsHandler();
  } catch (Exception e) {
    regenerate();
    return g.getStatisticsHandler();
  }
}

代码示例来源:origin: apache/jena

@Override
public GraphStatisticsHandler getStatisticsHandler()
    throws ReadDeniedException, AuthenticationRequiredException {
  checkRead();
  return holder.getBaseItem().getStatisticsHandler();
}

代码示例来源:origin: apache/jena

public void testGetStatisticsHandler()
{
  Graph g = getGraph();
  GraphStatisticsHandler h = g.getStatisticsHandler();
  assertSame( h, g.getStatisticsHandler() );
}

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

public void testGetStatisticsHandler()
{
  Graph g = getGraph();
  GraphStatisticsHandler h = g.getStatisticsHandler();
  assertSame( h, g.getStatisticsHandler() );
}

代码示例来源:origin: apache/jena

@ContractTest
public void testGetStatisticsHandler()
{
  Graph g = producer.newInstance();
  GraphStatisticsHandler sh = g.getStatisticsHandler();
  if (sh != null)
  {
    assertSame(
        "getStatisticsHandler must always return the same object",
        sh, g.getStatisticsHandler());
  }
}

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

@ContractTest
public void testGetStatisticsHandler()
{
  Graph g = producer.newInstance();
  GraphStatisticsHandler sh = g.getStatisticsHandler();
  if (sh != null)
  {
    assertSame(
        "getStatisticsHandler must always return the same object",
        sh, g.getStatisticsHandler());
  }
}

代码示例来源:origin: apache/jena

private void testStatsWithAllVariables( String triples )
  {
  Graph g = getGraphWith( triples );
  GraphStatisticsHandler h = g.getStatisticsHandler();
  assertEquals( g.size(), h.getStatistic( Node.ANY, Node.ANY, Node.ANY ) );
  }

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

private void testStatsWithAllVariables( String triples )
  {
  Graph g = getGraphWith( triples );
  GraphStatisticsHandler h = g.getStatisticsHandler();
  assertEquals( g.size(), h.getStatistic( Node.ANY, Node.ANY, Node.ANY ) );
  }

代码示例来源:origin: apache/jena

private void testStatsWithAllVariables(String triples)
{
  Graph g = graphWith(producer.newInstance(), triples);
  GraphStatisticsHandler h = g.getStatisticsHandler();
  if (h != null)
  {
    assertEquals(g.size(),
        h.getStatistic(Node.ANY, Node.ANY, Node.ANY));
  }
}

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

private void testStatsWithAllVariables(String triples)
{
  Graph g = graphWith(producer.newInstance(), triples);
  GraphStatisticsHandler h = g.getStatisticsHandler();
  if (h != null)
  {
    assertEquals(g.size(),
        h.getStatistic(Node.ANY, Node.ANY, Node.ANY));
  }
}

代码示例来源:origin: apache/jena

private void testStatsWithConcreteTriple( int expect, String triple, String graph )
  {
  Graph g = getGraphWith( graph );
  GraphStatisticsHandler h = g.getStatisticsHandler();
  Triple t = triple( triple );
  assertEquals( expect, h.getStatistic( t.getSubject(), t.getPredicate(), t.getObject() ) );
  }

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

private void testStatsWithConcreteTriple( int expect, String triple, String graph )
  {
  Graph g = getGraphWith( graph );
  GraphStatisticsHandler h = g.getStatisticsHandler();
  Triple t = triple( triple );
  assertEquals( expect, h.getStatistic( t.getSubject(), t.getPredicate(), t.getObject() ) );
  }

代码示例来源:origin: apache/jena

private void testStatsWithConcreteTriple(int expect, String triple,
    String graph)
{
  Graph g = graphWith(producer.newInstance(), graph);
  GraphStatisticsHandler h = g.getStatisticsHandler();
  if (h != null)
  {
    Triple t = triple(triple);
    assertEquals(expect, h.getStatistic(t.getSubject(),
        t.getPredicate(), t.getObject()));
  }
}

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

private void testStatsWithConcreteTriple(int expect, String triple,
    String graph)
{
  Graph g = graphWith(producer.newInstance(), graph);
  GraphStatisticsHandler h = g.getStatisticsHandler();
  if (h != null)
  {
    Triple t = triple(triple);
    assertEquals(expect, h.getStatistic(t.getSubject(),
        t.getPredicate(), t.getObject()));
  }
}

代码示例来源:origin: apache/jena

public void testDoubletonStatisticsWithTriples()
  {
  Graph g = getGraphWith( "a P b; a P c; a Q b; x S y" );
  GraphStatisticsHandler h = g.getStatisticsHandler();
  assertNotNull( h );
  assertEquals( -1L, h.getStatistic( node( "a" ), node( "P" ), Node.ANY ) );
  assertEquals( -1L, h.getStatistic( Node.ANY, node( "P" ), node( "b"  ) ) );
  assertEquals( -1L, h.getStatistic( node( "a" ), Node.ANY, node( "b" ) ) );
//
  assertEquals( 0L, h.getStatistic( node( "no" ), node( "P" ), Node.ANY ) );
  }

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

public void testDoubletonStatisticsWithTriples()
  {
  Graph g = getGraphWith( "a P b; a P c; a Q b; x S y" );
  GraphStatisticsHandler h = g.getStatisticsHandler();
  assertNotNull( h );
  assertEquals( -1L, h.getStatistic( node( "a" ), node( "P" ), Node.ANY ) );
  assertEquals( -1L, h.getStatistic( Node.ANY, node( "P" ), node( "b"  ) ) );
  assertEquals( -1L, h.getStatistic( node( "a" ), Node.ANY, node( "b" ) ) );
//
  assertEquals( 0L, h.getStatistic( node( "no" ), node( "P" ), Node.ANY ) );
  }

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

public void testSingletonStatisticsWithSingleTriple()
  {
  Graph g = getGraphWith( "a P b" );
  GraphStatisticsHandler h = g.getStatisticsHandler();
  assertNotNull( h );
  assertEquals( 1L, h.getStatistic( node( "a" ), Node.ANY, Node.ANY ) );
  assertEquals( 0L, h.getStatistic( node( "x" ), Node.ANY, Node.ANY ) );
//
  assertEquals( 1L, h.getStatistic( Node.ANY, node( "P" ), Node.ANY ) );
  assertEquals( 0L, h.getStatistic( Node.ANY, node( "Q" ), Node.ANY ) );
//
  assertEquals( 1L, h.getStatistic( Node.ANY, Node.ANY, node( "b" ) ) );
  assertEquals( 0L, h.getStatistic( Node.ANY, Node.ANY, node( "y" ) ) );
  }

相关文章