/** * Gets whether the set contains a characteristic for the given predicate * * @param n * Predicate * @return True if contained in the set, false otherwise */ public boolean hasCharacteristic(Node n) { return this.hasCharacteristic(new NodeWritable(n)); }
/** * Gets whether the set contains a characteristic for the given predicate * * @param uri * Predicate URI * @return True if contained in the set, false otherwise */ public boolean hasCharacteristic(String uri) { return this.hasCharacteristic(NodeFactory.createURI(uri)); }
/** * Gets whether the set contains a characteristic for the given predicate * * @param n * Predicate * @return True if contained in the set, false otherwise */ public boolean hasCharacteristic(Node n) { return this.hasCharacteristic(new NodeWritable(n)); }
/** * Gets whether the set contains a characteristic for the given predicate * * @param uri * Predicate URI * @return True if contained in the set, false otherwise */ public boolean hasCharacteristic(String uri) { return this.hasCharacteristic(NodeFactory.createURI(uri)); }
/** * Test characteristic set reduction * * @throws IOException */ @Test public void characteristic_set_reducer_06() throws IOException { MapReduceDriver<CharacteristicSetWritable, CharacteristicSetWritable, CharacteristicSetWritable, CharacteristicSetWritable, CharacteristicSetWritable, NullWritable> driver = this .getMapReduceDriver(); this.createSet(driver, 2, 1, "http://predicate", "http://other"); this.createSet(driver, 1, 1, "http://other"); driver.runTest(false); driver = getMapReduceDriver(); createSet(driver, 2, 1, "http://predicate", "http://other"); createSet(driver, 1, 1, "http://other"); List<Pair<CharacteristicSetWritable, NullWritable>> results = driver.run(); for (Pair<CharacteristicSetWritable, NullWritable> pair : results) { CharacteristicSetWritable cw = pair.getFirst(); boolean expectTwo = cw.hasCharacteristic("http://predicate"); Assert.assertEquals(expectTwo ? 2 : 1, cw.getCount().get()); } } }