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

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

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

Graph.getCapabilities介绍

[英]returns this Graph's capabilities
[中]返回此图表的功能

代码示例

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

@Override
public Capabilities getCapabilities() {
  // Not stricly accurate.
  return base.getCapabilities();
}

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

@Override
public Capabilities getCapabilities()
{
  return graph.getCapabilities() ;
}

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

protected GraphPlain(Graph other) {
  super(other);
  capabilities = new WrappedCapabilities(base.getCapabilities()) {
    @Override public boolean handlesLiteralTyping() { return false; }
  };
}

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

protected GraphPlain(Graph other) {
  super(other);
  capabilities = new WrappedCapabilities(base.getCapabilities()) {
    @Override public boolean handlesLiteralTyping() { return false; }
  };
}

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

@Override
public Capabilities getCapabilities() {
  // Not stricly accurate.
  return base.getCapabilities();
}

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

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

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

/** Return a graph that only has term-equality
 * and storage in the {@code base} graph.
 * Update affects the base graph. 
 */ 
public static Graph plain(Graph base) {
  if ( ! base.getCapabilities().handlesLiteralTyping() )
    return base;
  return new GraphPlain(base);
}

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

/** Return a graph that only has term-equality
 * and storage in the {@code base} graph.
 * Update affects the base graph. 
 */ 
public static Graph plain(Graph base) {
  if ( ! base.getCapabilities().handlesLiteralTyping() )
    return base;
  return new GraphPlain(base);
}

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

/**
  pending on use-cases.
*/
public void testTheyreThere()
  {
  Graph g = Factory.createDefaultGraph();
  g.getCapabilities();
  }

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

@Override
public SecuredCapabilities getCapabilities() {
  return new SecuredCapabilities(getSecurityEvaluator(), getModelIRI(),
      holder.getBaseItem().getCapabilities());
}

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

@BeforeClass public static void setUp() {
  graph = new GraphMem();
  if ( ! graph.getCapabilities().handlesLiteralTyping() )
    throw new IllegalArgumentException("Test graph does not do the value thing");  
  graphAdd(graph, "s p o ; s p 1 ; s p 01");
}

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

@BeforeClass public static void setUp() {
  graph = new GraphMem();
  if ( ! graph.getCapabilities().handlesLiteralTyping() )
    throw new IllegalArgumentException("Test graph does not do the value thing");  
  graphAdd(graph, "s p o ; s p 1 ; s p 01");
}

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

public void testHasCapabilities()
{
  Graph g = getGraph();
  Capabilities c = g.getCapabilities();
  boolean sa = c.sizeAccurate();
  boolean aaSome = c.addAllowed();
  boolean daSome = c.deleteAllowed();
}

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

public void testHasCapabilities()
{
  Graph g = getGraph();
  Capabilities c = g.getCapabilities();
  boolean sa = c.sizeAccurate();
  boolean aaSome = c.addAllowed();
  boolean daSome = c.deleteAllowed();
}

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

@Test public void zero_basic_1() {
  DatasetGraph dsg = DatasetGraphZero.create();
  assertFalse(dsg.find().hasNext());
  assertTrue(dsg.supportsTransactionAbort());
  assertEquals(0, dsg.getDefaultGraph().size());
  assertFalse(dsg.getDefaultGraph().getCapabilities().addAllowed());
}

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

@Test public void sink_basic_1() {
  DatasetGraph dsg = DatasetGraphSink.create();
  assertFalse(dsg.find().hasNext());
  assertTrue(dsg.supportsTransactionAbort());
  assertEquals(0, dsg.getDefaultGraph().size());
  assertTrue(dsg.getDefaultGraph().getCapabilities().addAllowed());
}

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

public void testNoMatchAgainstUnlanguagesLiteral()
{
  Graph m = graphWith( "a p 'chat'en; a p 'chat'" );
  if (m.getCapabilities().handlesLiteralTyping())
  {
    Node chaten = node( "'chat'en" ), chatEN = node( "'chat'EN" );
    assertDiffer( chaten, chatEN );
    assertTrue( chaten.sameValueAs( chatEN ) );
    assertEquals( chaten.getIndexingValue(), chatEN.getIndexingValue() );
    assertEquals( 1, m.find( Node.ANY, Node.ANY, chaten ).toList().size() );
    assertEquals( 1, m.find( Node.ANY, Node.ANY, chatEN ).toList().size() );        
  }
}

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

public void testMatchBothLanguagedLiteralsCaseInsensitive()
{
  Graph m = graphWith( "a p 'chat'en; a p 'chat'EN" );
  if (m.getCapabilities().handlesLiteralTyping())
  {
    Node chaten = node( "'chat'en" ), chatEN = node( "'chat'EN" );
    assertDiffer( chaten, chatEN );
    assertTrue( chaten.sameValueAs( chatEN ) );
    assertEquals( chaten.getIndexingValue(), chatEN.getIndexingValue() );
    assertEquals( 2, m.find( Node.ANY, Node.ANY, chaten ).toList().size() );
    assertEquals( 2, m.find( Node.ANY, Node.ANY, chatEN ).toList().size() );
  }
}

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

public void testMatchBothLanguagedLiteralsCaseInsensitive()
{
  Graph m = graphWith( "a p 'chat'en; a p 'chat'EN" );
  if (m.getCapabilities().handlesLiteralTyping())
  {
    Node chaten = node( "'chat'en" ), chatEN = node( "'chat'EN" );
    assertDiffer( chaten, chatEN );
    assertTrue( chaten.sameValueAs( chatEN ) );
    assertEquals( chaten.getIndexingValue(), chatEN.getIndexingValue() );
    assertEquals( 2, m.find( Node.ANY, Node.ANY, chaten ).toList().size() );
    assertEquals( 2, m.find( Node.ANY, Node.ANY, chatEN ).toList().size() );
  }
}

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

public void testNoMatchAgainstUnlanguagesLiteral()
{
  Graph m = graphWith( "a p 'chat'en; a p 'chat'" );
  if (m.getCapabilities().handlesLiteralTyping())
  {
    Node chaten = node( "'chat'en" ), chatEN = node( "'chat'EN" );
    assertDiffer( chaten, chatEN );
    assertTrue( chaten.sameValueAs( chatEN ) );
    assertEquals( chaten.getIndexingValue(), chatEN.getIndexingValue() );
    assertEquals( 1, m.find( Node.ANY, Node.ANY, chaten ).toList().size() );
    assertEquals( 1, m.find( Node.ANY, Node.ANY, chatEN ).toList().size() );        
  }
}

相关文章