예제 #1
0
  @Test
  public void emptyContent() throws Exception {

    DatatypeCount datatypeCount = new DatatypeCount();

    assertThat(datatypeCount.counts().size(), equalTo(0));
  }
예제 #2
0
  @Test
  public void shouldTrackAnUnknownDatatype() throws Exception {

    DatatypeCount datatypeCount = new DatatypeCount();

    datatypeCount.track(new TripleBuilder().withLiteral("any string").asTriple());

    assertThat(datatypeCount.counts().get(RDFS.Literal.getURI()), equalTo(1l));
  }
예제 #3
0
  @Test
  public void shouldTrackADatatypeTriple() throws Exception {

    DatatypeCount datatypeCount = new DatatypeCount();

    datatypeCount.track(new TripleBuilder().withTypedLiteral("35", "type").asTriple());

    assertThat(datatypeCount.counts().get("type"), equalTo(1l));
  }
예제 #4
0
  @Test
  public void shouldTrackManyOccurrences() throws Exception {

    DatatypeCount datatypeCount = new DatatypeCount();

    datatypeCount
        .track(new TripleBuilder().withLiteral("35").asTriple())
        .track(new TripleBuilder().withLiteral("35").asTriple());

    assertThat(datatypeCount.counts().get(RDFS.Literal.getURI()), equalTo(2l));
  }