### Question:
SearchAndDiscoveryInterfaces implements eu.cloud4soa.api.repository.SearchAndDiscoveryInterfaces { @Override public synchronized QueryResultTable sparqlSelect(String query) throws SparqlQueryException { Model model = repositoryManager.getModel(); QueryResultTable result; org.ontoware.rdf2go.model.QueryResultTable rdf2goSparqlResult; try { List<QueryResultRow> queryResultRowList = new ArrayList<QueryResultRow>(); rdf2goSparqlResult = model.sparqlSelect(query); List<String> variables = rdf2goSparqlResult.getVariables(); for (Iterator<QueryRow> it = rdf2goSparqlResult.iterator(); it.hasNext();) { QueryRow queryRow = it.next(); Map<String, String> row = new HashMap<String, String>(); for (String varname : variables) { String valueString; try { Node valueNode = queryRow.getValue(varname); if (valueNode instanceof Literal) { valueString = valueNode.asLiteral().getValue(); } else { valueString = valueNode.toString(); } } catch (Exception ex) { valueString = ""; } row.put(varname, valueString); } queryResultRowList.add(new QueryResultRow(row)); } result = new QueryResultTable(queryResultRowList, variables); return result; } catch (Exception ex) { throw new SparqlQueryException(" error in execution model.sparqlSelect: " + ex.getClass().getName() + " - " + ex.getMessage(), ex); } }  @Required void setRepositoryManager(RepositoryManager repositoryManager); @Required void setPaaSOfferingProfilesRepository(PaaSOfferingProfilesRepository paaSOfferingProfilesRepository); @Required void setComputationalConverter(ComputationalConverter computationalConverter); @Required void setPaaSRankingCalculator(PaaSRankingCalculator paaSRankingCalculator); @Override Map<PaaSInstance, Float> searchForMatchingPlatform(ApplicationInstance applicationInstance); @Override PaaSInstance searchForPass(eu.cloud4soa.api.datamodel.frontend.PaaSInstance paaSInstance); @Override synchronized QueryResultTable sparqlSelect(String query);  }### Answer:
@Ignore @Test public void testSparqlSelect() throws Exception { String rdf; String query; QueryResultTable result; int counter; counter = 0; rdf = "http: query = "SELECT ?object WHERE { ?object <" + rdf + "type> <"+ rdf + "Property> }"; System.out.println(query); result = searchAndDiscoveryInterfaces.sparqlSelect(query); for( QueryResultRow row: result) { counter++; System.out.println( row.getStringValue( "object") ); } assertTrue( counter > 0 ); System.out.println("Number of properties: " + counter ); }
@Ignore @Test public void testSparqlSelectSecond() throws Exception { String dct; String rdfs; String query; String varname; QueryResultTable result; int counter; counter = 0; dct = "http: rdfs = "http: varname = "aComment"; query = "SELECT ?"+ varname +" WHERE { <"+ dct + "MediaType> <" + rdfs + "comment> ?" + varname +" }"; System.out.println(query); result = searchAndDiscoveryInterfaces.sparqlSelect(query); System.out.println("Number of properties: " + counter ); for( QueryResultRow row: result) { counter++; System.out.println( row.getStringValue(varname) ); } assertEquals( 1, counter); }