@Test
public void testUKATSamples() throws IOException {
InputStream skosFile = getClass().getResourceAsStream("/skos_samples/ukat_examples.n3");
String conceptURI = "http://www.ukat.org.uk/thesaurus/concept/859";
SKOSEngine skosEngine = SKOSEngineFactory.getSKOSEngine(skosFile, "N3");
// testing pref-labels
String[] prefLabel = skosEngine.getPrefLabels(conceptURI);
assertEquals(1, prefLabel.length);
assertEquals("weapons", prefLabel[0]);
// testing alt-labels
String[] altLabel = skosEngine.getAltLabels(conceptURI);
assertEquals(2, altLabel.length);
assertTrue(Arrays.asList(altLabel).contains("armaments"));
assertTrue(Arrays.asList(altLabel).contains("arms"));
// testing broader
String[] broader = skosEngine.getBroaderConcepts(conceptURI);
assertEquals(1, broader.length);
assertEquals("http://www.ukat.org.uk/thesaurus/concept/5060", broader[0]);
// testing narrower
String[] narrower = skosEngine.getNarrowerConcepts(conceptURI);
assertEquals(2, narrower.length);
assertTrue(Arrays.asList(narrower).contains(
"http://www.ukat.org.uk/thesaurus/concept/18874"));
assertTrue(Arrays.asList(narrower).contains(
"http://www.ukat.org.uk/thesaurus/concept/7630"));
// testing broader labels
String[] broaderLabels = skosEngine.getBroaderLabels(conceptURI);
assertEquals(3, broaderLabels.length);
assertTrue(Arrays.asList(broaderLabels).contains(
"military equipment"));
assertTrue(Arrays.asList(broaderLabels).contains(
"defense equipment and supplies"));
assertTrue(Arrays.asList(broaderLabels).contains("ordnance"));
// testing narrower labels
String[] narrowerLabels = skosEngine.getNarrowerLabels(conceptURI);
assertEquals(2, narrowerLabels.length);
assertTrue(Arrays.asList(narrowerLabels).contains("ammunition"));
assertTrue(Arrays.asList(narrowerLabels).contains("artillery"));
}