@Test public void testTypes$discardNewIndividual() { DataSet data=exampleDataSet(); Individual<?,?> individual = data.individualOfId(BLANK_NODE); IndividualHelperImpl sut = new IndividualHelperImpl(individual); NewIndividual foundIndividual = data.individual(URI.create(""), NewIndividual.class); individual.addValue(RDF.TYPE.as(URI.class), foundIndividual); assertThat(sut.types(),hasSize(0)); }
@Override public Set<URI> types() { Property property = this.individual.property(RDF.TYPE.as(URI.class)); if(property==null) { return Collections.emptySet(); } TypeCollector collector = new TypeCollector(); for(Value value:property) { value.accept(collector); } return collector.collectedTypes(); }
IndividualHelperImpl implements IndividualHelper { @Override public Set<URI> types() { Property property = this.individual.property(RDF.TYPE.as(URI.class)); if(property==null) { return Collections.emptySet(); } TypeCollector collector = new TypeCollector(); for(Value value:property) { value.accept(collector); } return collector.collectedTypes(); } }
IndividualHelperImpl implements IndividualHelper { @Override public Set<URI> types() { Property property = this.individual.property(RDF.TYPE.as(URI.class)); if(property==null) { return Collections.emptySet(); } TypeCollector collector = new TypeCollector(); for(Value value:property) { value.accept(collector); } return collector.collectedTypes(); } IndividualHelperImpl(Individual<?,?> individual); }
IndividualHelperImpl implements IndividualHelper { @Override public Set<URI> types() { Property property = this.individual.property(RDF.TYPE.as(URI.class)); if(property==null) { return Collections.emptySet(); } TypeCollector collector = new TypeCollector(); for(Value value:property) { value.accept(collector); } return collector.collectedTypes(); } IndividualHelperImpl(Individual<?,?> individual); @Override Set<URI> types(); @Override PropertyHelper property(URI propertyId); @Override PropertyHelper property(String propertyId); @Override PropertyHelper property(Term property); }
IndividualHelperImpl implements IndividualHelper { @Override public Set<URI> types() { Property property = this.individual.property(RDF.TYPE.as(URI.class)); if(property==null) { return Collections.emptySet(); } TypeCollector collector = new TypeCollector(); for(Value value:property) { value.accept(collector); } return collector.collectedTypes(); } IndividualHelperImpl(Individual<?,?> individual); @Override Set<URI> types(); @Override PropertyHelper property(URI propertyId); @Override PropertyHelper property(String propertyId); @Override PropertyHelper property(Term property);  }