protected HttpUriRequest createBadAnnotProfileWithSubgraphsRequest(int n) throws URISyntaxException { URIBuilder uriBuilder = new URIBuilder() .setScheme("http") .setHost("localhost") .setPort(9031) .setPath("/owlsim/getAttributeInformationProfile/"); List<OWLClass> allClasses = new ArrayList<OWLClass>(); allClasses.addAll(g.getAllOWLClasses()); Collections.shuffle(allClasses); int i = 0; for (OWLClass c : allClasses) { String id = g.getIdentifier(c); uriBuilder.addParameter("a", id); // get at least one ancestor of each class OWLClass r = (OWLClass) g.getAncestors(c).iterator().next(); uriBuilder.addParameter("r", g.getIdentifier(r)); i++; if (i >= n) break; } uriBuilder.addParameter("a", "BOGUS:1234567"); uriBuilder.addParameter("r", "BOGUS:0000003"); Random rand = new Random(); int r = 0; // get some random classes for (i = 0; i < n; i++) { r = rand.nextInt(allClasses.size()); OWLClass c = allClasses.get(r); String id = g.getIdentifier(c); uriBuilder.addParameter("r", id); i++; if (i >= n) break; } uriBuilder.addParameter("limit", "5"); URI uri = uriBuilder.build(); LOG.info("Getting URL=" + uri); HttpUriRequest httpUriRequest = new HttpGet(uri); LOG.info("Got URL=" + uri); return httpUriRequest; }