Exemplo n.º 1
0
  @Test
  public void emptyContent() throws Exception {

    DatatypeCount datatypeCount = new DatatypeCount();

    assertThat(datatypeCount.counts().size(), equalTo(0));
  }
Exemplo n.º 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));
  }
Exemplo n.º 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));
  }
Exemplo n.º 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));
  }