Index: BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/OWLQueryBuilderImpl.java
===================================================================
--- BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/OWLQueryBuilderImpl.java (revision 27)
+++ BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/OWLQueryBuilderImpl.java (revision 28)
@@ -53,11 +53,11 @@
 	public static void main(String[] args) throws Exception {
 		String sparqlEndpoint = "http://dbpedia.org/sparql";
-//		String sparqlEndpoint = "http://lsd.dbcls.jp/sparql";
+		// String sparqlEndpoint = "http://lsd.dbcls.jp/sparql";
 		String keyword = "artiste";
-//		String keyword = "Agent";
+		// String keyword = "Agent";
 		String[] graphURIs = new String[0];
 
 		OWLQueryBuilder builder = new OWLQueryBuilderImpl(sparqlEndpoint);
-		SClass[] clz = builder.getOWLClasses(graphURIs, keyword);
+		SClass[] clz = builder.getOWLClasses(graphURIs, keyword, false);
 		for (SClass cls : clz) {
 			System.out.println(cls);
@@ -76,6 +76,5 @@
 			}
 		}
-		
-		
+
 		/*
 		 * System.out.println("CLS-INS"); cls =
@@ -115,11 +114,15 @@
 	 * @since 28.01.2014
 	 */
-	public SClass[] getOWLClasses(String[] graphURIs, String keyword)
-			throws Exception {
+	public SClass[] getOWLClasses(String[] graphURIs, String keyword,
+			boolean countInstances) throws Exception {
 		StringBuffer queryStr = new StringBuffer();
 		queryStr.append("PREFIX owl: <http://www.w3.org/2002/07/owl#>\n");
 		queryStr.append("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n");
 		queryStr.append("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n");
-		queryStr.append("SELECT DISTINCT ?c ?pLabel (COUNT(?i) AS ?numOfInstances)\n");
+		if (countInstances) {
+			queryStr.append("SELECT DISTINCT ?c ?pLabel (COUNT(?i) AS ?numOfInstances)\n");
+		} else {
+			queryStr.append("SELECT DISTINCT ?c ?pLabel \n");
+		}
 		if (graphURIs != null) {
 			for (String graphURI : graphURIs) {
@@ -135,17 +138,22 @@
 		queryStr.append("      ?c rdfs:label ?label.\n");
 		queryStr.append("      ?c rdfs:label ?pLabel.\n");
-		queryStr.append("      ?i rdf:type ?c.\n");
-
+		if (countInstances) {
+			queryStr.append("      ?i rdf:type ?c.\n");
+		}
 		// queryStr.append("      ?c rdfs:label ");
 		// queryStr.append(keyword);
 		// queryStr.append(".");
-
-		queryStr.append("  FILTER (\n");
-		queryStr.append("    REGEX( ?label , \"");
-		queryStr.append(keyword);
-		queryStr.append("\" , \"i\" )\n");
-		queryStr.append("  )");
-		queryStr.append("\n}  GROUP BY ?c ?pLabel");
-
+		if (keyword != null && keyword.length() != 0) {
+			queryStr.append("  FILTER (\n");
+			queryStr.append("    REGEX( ?label , \"");
+			queryStr.append(keyword);
+			queryStr.append("\" , \"i\" )\n");
+			queryStr.append("  )");
+		}
+		if (countInstances) {
+			queryStr.append("\n}  GROUP BY ?c ?pLabel");
+		} else {
+			queryStr.append("\n}");
+		}
 		System.out.println(queryStr.toString());
 
@@ -295,13 +303,12 @@
 		}
 		queryStr.append("WHERE{\n");
-//		queryStr.append("  { ?c rdf:type rdfs:Class. }\n  UNION\n  { ?c rdf:type owl:Class. }\n");
+		// queryStr.append("  { ?c rdf:type rdfs:Class. }\n  UNION\n  { ?c rdf:type owl:Class. }\n");
 		queryStr.append("  { ?p rdfs:domain <");
 		queryStr.append(originClass);
 		queryStr.append(">.\n    ?p rdfs:range ?c.\n");
 
-		
 		if (countLinks) {
 			queryStr.append("    ?o ?p ?s.");
-		}else{
+		} else {
 			queryStr.append("filter(exists{\n");
 			queryStr.append("  ?o rdf:type ?c.\n");
@@ -320,5 +327,5 @@
 		if (countLinks) {
 			queryStr.append("    ?s ?p ?o.");
-		}else{
+		} else {
 			queryStr.append("filter(exists{\n");
 			queryStr.append("  ?s rdf:type ?c.\n");
Index: BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/OWLQueryBuilder.java
===================================================================
--- BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/OWLQueryBuilder.java (revision 26)
+++ BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/OWLQueryBuilder.java (revision 28)
@@ -20,9 +20,10 @@
 	 * @param graphURIs縲讀懃ｴ｢蟇ｾ雎｡縺ｮgraph縺ｮURI驟榊� (null繧�聞縺�縺ｮ驟榊�繧ょ庄)
 	 * @param keyword ��ull繧�ｩｺ譁�ｭ励�荳榊庄��
+	 * @param countInstances 繧ｯ繝ｩ繧ｹ縺ｫ螻槭＠縺ｦ縺�ｋ繧､繝ｳ繧ｹ繧ｿ繝ｳ繧ｹ縺ｮ謨ｰ繧呈焚縺医ｋ蝣ｴ蜷医�true繧剃ｸ弱∴繧�
 	 * @return 繧ｯ繝ｩ繧ｹURI縺ｮ驟榊�
 	 * @throws Exception
 	 * @since 28.01.2014
 	 */
-	public SClass[] getOWLClasses(String[] graphURIs, String keyword) throws Exception;
+	public SClass[] getOWLClasses(String[] graphURIs, String keyword, boolean countInstances) throws Exception;
 
 	/**
