org.apache.clerezza.commons.rdf.Graph.size()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(106)

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

Graph.size介绍

暂无

代码示例

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

@Override
  public Integer run() {
    return graph.size();
  }
});

代码示例来源:origin: org.apache.clerezza/rdf.core

@Override
protected int performSize() {
  return triples.size();
}

代码示例来源:origin: org.apache.clerezza/rdf.core

@Override
  public Integer run() {
    return graph.size();
  }
});

代码示例来源:origin: org.apache.clerezza.commons-rdf/commons-rdf-impl-utils

@Override
public int performSize() {
  return graph.size();
}

代码示例来源:origin: org.apache.clerezza/rdf.utils

@Override
public int performSize() {
  int size = 0;
  for (Graph graph : baseTripleCollections) {
    size += graph.size();
  }
  return size;
}

代码示例来源:origin: org.apache.clerezza.commons-rdf/commons-rdf-impl-utils

@Override
public int size() {
  return wrapped.size();
}

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

@Override
protected int performSize() {
  return triples.size();
}

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

@Override
public int size() {
  return wrapped.size();
}

代码示例来源:origin: org.apache.clerezza/rdf.core

@Override
public int size() {
  checkRead();
  return wrapped.size();
}

代码示例来源:origin: org.apache.clerezza/rdf.jena.tdb.storage

@Override
public int size() {
  // TODO: How to get the proper size based on graphType
  return graphNameIndex.getGraph().size();
}

代码示例来源:origin: org.apache.clerezza/rdf.core.test

@Test
public void testGetSize() throws Exception {
  Graph graph = getEmptyGraph();
  // The test graph must always be empty after test fixture setup
  Assert.assertEquals(0, graph.size());
}

代码示例来源:origin: org.apache.clerezza/rdf.core.test

@Test
public void testRemoveAllTriples() {
  Graph graph = getEmptyGraph();
  Assert.assertEquals(0, graph.size());
  graph.add(new TripleImpl(uriRef1, uriRef2, uriRef3));
  graph.add(new TripleImpl(uriRef2, uriRef3, uriRef4));
  Assert.assertEquals(2, graph.size());
  graph.clear();
  Assert.assertEquals(0, graph.size());
}

代码示例来源:origin: org.apache.clerezza/rdf.core.test

@Test
public void testAddSingleTriple() throws Exception {
  Graph graph = getEmptyGraph();
  final Triple triple= createTriple(
      "http://example.org/ontology/Person",
      "http://example.org/ontology/hasName",
      "http://example.org/people/alice");
  Assert.assertEquals(0, graph.size());
  Assert.assertTrue(graph.add(triple));
  Assert.assertEquals(1, graph.size());
}

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

@Test
public void testAddSingleTriple() throws Exception {
  Graph graph = getEmptyGraph();
  final Triple triple= createTriple(
      "http://example.org/ontology/Person",
      "http://example.org/ontology/hasName",
      "http://example.org/people/alice");
  Assert.assertEquals(0, graph.size());
  Assert.assertTrue(graph.add(triple));
  Assert.assertEquals(1, graph.size());
}

代码示例来源:origin: org.apache.clerezza/rdf.core.test

@Test
public void testAddSameTripleTwice() throws Exception {
  Graph graph = getEmptyGraph();
  final Triple triple= createTriple(
      "http://example.org/ontology/Person",
      "http://example.org/ontology/hasName",
      "http://example.org/people/alice");
  Assert.assertEquals(0, graph.size());
  Assert.assertTrue(graph.add(triple));
  Assert.assertFalse(graph.add(triple)); // ImmutableGraph does not change
  Assert.assertEquals(1, graph.size());
}

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

@Test
public void testAddSameTripleTwice() throws Exception {
  Graph graph = getEmptyGraph();
  final Triple triple= createTriple(
      "http://example.org/ontology/Person",
      "http://example.org/ontology/hasName",
      "http://example.org/people/alice");
  Assert.assertEquals(0, graph.size());
  Assert.assertTrue(graph.add(triple));
  Assert.assertFalse(graph.add(triple)); // ImmutableGraph does not change
  Assert.assertEquals(1, graph.size());
}

代码示例来源:origin: org.apache.clerezza/rdf.core.test

@Test
public void testUseTypedLiterals() {
  Graph graph = getEmptyGraph();
  Assert.assertEquals(0, graph.size());
  Literal value = new TypedLiteralImpl("<elem>value</elem>",xmlLiteralType);
  final TripleImpl triple1 = new TripleImpl(uriRef1, uriRef2, value);
  graph.add(triple1);
  Iterator<Triple> tripleIter = graph.filter(uriRef1, uriRef2, null);
  Assert.assertTrue(tripleIter.hasNext());
  RDFTerm gotValue = tripleIter.next().getObject();
  Assert.assertEquals(value, gotValue);
}

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

@Test
public void testUseTypedLiterals() {
  Graph graph = getEmptyGraph();
  Assert.assertEquals(0, graph.size());
  Literal value = new TypedLiteralImpl("<elem>value</elem>",xmlLiteralType);
  final TripleImpl triple1 = new TripleImpl(uriRef1, uriRef2, value);
  graph.add(triple1);
  Iterator<Triple> tripleIter = graph.filter(uriRef1, uriRef2, null);
  Assert.assertTrue(tripleIter.hasNext());
  RDFTerm gotValue = tripleIter.next().getObject();
  Assert.assertEquals(value, gotValue);
}

代码示例来源:origin: org.apache.clerezza/rdf.core.test

@Test
public void testRemoveSingleTriple() throws Exception {
  Graph graph = getEmptyGraph();
  final Triple triple= createTriple(
      "http://example.org/ontology/Person",
      "http://example.org/ontology/hasName",
      "http://example.org/people/alice");
  Assert.assertTrue(graph.add(triple));
  Assert.assertTrue(graph.remove(triple));
  Assert.assertEquals(0, graph.size());
}

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

@Test
public void testRemoveSingleTriple() throws Exception {
  Graph graph = getEmptyGraph();
  final Triple triple= createTriple(
      "http://example.org/ontology/Person",
      "http://example.org/ontology/hasName",
      "http://example.org/people/alice");
  Assert.assertTrue(graph.add(triple));
  Assert.assertTrue(graph.remove(triple));
  Assert.assertEquals(0, graph.size());
}

相关文章