/** Test get concept related concepts. */ @Test public void testGetConceptRelatedConcepts() { Map<String, Object> params = new HashMap<String, Object>(); params.put(ConceptInsights.LIMIT, 10); params.put(ConceptInsights.LEVEL, 1); RequestedFields fs = new RequestedFields(); fs.include("abstract"); params.put("concept_fields", fs); Concepts concepts = service.getConceptRelatedConcepts(EXAMPLE_CONCEPT, params); Assert.assertNotNull(concepts); }
/** Test get graph related concepts. */ @Test public void testGetGraphRelatedConcepts() { Map<String, Object> params = new HashMap<String, Object>(); List<Concept> concepts = new ArrayList<Concept>(); concepts.add(EXAMPLE_CONCEPT); params.put(ConceptInsights.LIMIT, 10); params.put(ConceptInsights.LEVEL, 1); RequestedFields fs = new RequestedFields(); fs.include("abstract"); params.put("concept_fields", fs); Concepts conceptResults = service.getGraphRelatedConcepts(Graph.WIKIPEDIA, concepts, params); Assert.assertNotNull(conceptResults); }
/** Test get graphs label search. */ @Test public void testGetGraphsLabelSearch() { Map<String, Object> params = new HashMap<String, Object>(); params.put(ConceptInsights.QUERY, "cognitv"); params.put(ConceptInsights.LIMIT, 10); params.put(ConceptInsights.PREFIX, false); RequestedFields fs = new RequestedFields(); fs.include("abstract"); params.put("concept_fields", fs); Matches matches = service.searchGraphsConceptByLabel(Graph.WIKIPEDIA, params); Assert.assertNotNull(matches); Assert.assertFalse(matches.getMatches().isEmpty()); }