diff --git a/framework/src/main/java/com/kgshape/app/Query.java b/framework/src/main/java/com/kgshape/app/Query.java
index 21932e35d3125ac49e4329769a4b698485c7f28b..39aadd375d0a83ea05321e4331de6b2517608558 100644
--- a/framework/src/main/java/com/kgshape/app/Query.java
+++ b/framework/src/main/java/com/kgshape/app/Query.java
@@ -1,15 +1,15 @@
 package com.kgshape.app;
 
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.nio.file.FileSystemNotFoundException;
-
 import org.apache.jena.query.QueryExecution;
 import org.apache.jena.query.QueryExecutionFactory;
 import org.apache.jena.rdf.model.Model;
 import org.apache.jena.riot.Lang;
 import org.apache.jena.riot.RDFDataMgr;
 
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.FileSystemNotFoundException;
+
 /**
  * Queries a remote endpoint.
  */
@@ -22,20 +22,81 @@ public class Query {
                 PREFIX o: <http://dbpedia.org/ontology/>
                 select distinct ?subj where {?subj a o:Language} LIMIT 20
                 """;
-        // Get 100 different actors
-        String construct_query = """
+
+        String format_construct_all = """
                 PREFIX o: <http://dbpedia.org/ontology/>
-                CONSTRUCT {?person ?pred ?obj}
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                CONSTRUCT {
+                    ?subj ?pred ?obj.
+                }
                 WHERE {
-                    ?person ?pred ?obj
-                {
-                    SELECT DISTINCT(?person)
-                    WHERE {
-                      ?person a o:Actor
-                    } LIMIT 100
-                  }
+                    ?subj ?pred ?obj.
+                    {
+                        SELECT DISTINCT(?subj)
+                        WHERE {
+                            ?subj a o:%1$s
+                        } LIMIT 100
+                    }
                 }
                 """;
+
+        String format_construct = """
+                PREFIX o: <http://dbpedia.org/ontology/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                CONSTRUCT {
+                    ?subj ?pred ?obj.
+                    ?subj a o:%1$s.
+                }
+                WHERE {
+                    ?subj ?pred ?obj.
+                    {
+                        SELECT DISTINCT(?subj)
+                        WHERE {
+                          ?subj a o:%1$s
+                        } LIMIT 100
+                    }
+                    {
+                        SELECT DISTINCT ?pred WHERE {
+                            ?pred rdfs:domain o:%1$s.
+                        }
+                    }
+                }
+                """;
+        String format_construct_super = """
+                PREFIX o: <http://dbpedia.org/ontology/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                CONSTRUCT {
+                    ?subj ?pred ?obj.
+                    ?subj a ?class.
+                }
+                WHERE {
+                    ?subj ?pred ?obj.
+                    ?subj a ?class.
+                    {
+                        SELECT DISTINCT(?subj)
+                        WHERE {
+                          ?subj a o:%1$s
+                        } LIMIT 100
+                    }
+                    {
+                        SELECT DISTINCT ?pred WHERE {
+                            {
+                                ?pred rdfs:domain ?class.
+                            }
+                        }
+                    }
+                    {
+                        SELECT ?class WHERE {
+                            o:%1$s rdfs:subClassOf* ?class.
+                        }
+                    }
+                }
+                """;
+//        System.out.println(construct_query);
+
         String construct_query2 = """
                 PREFIX o: <http://dbpedia.org/ontology/>
                 PREFIX dbr: <http://dbpedia.org/resource/>
@@ -47,8 +108,26 @@ public class Query {
         // You can also open this endpoint in the browser and test the above query
         String endpoint = "https://dbpedia.org/sparql";
 
+        // Pick the name of the class we want to extract from the arguments
+        String className;
+        if (args.length < 1) {
+            className = "Artist";
+        } else {
+            className = args[0];
+        }
+
+
+        String construct_query = String.format(format_construct, className);
         Model fetchedModel = fetchConstruct(endpoint, construct_query);
-        writeModel(fetchedModel, "rdf_file.ttl");
+        writeModel(fetchedModel, "rdf_" + className + ".ttl");
+
+        String construct_query_super = String.format(format_construct_super, className);
+        fetchedModel = fetchConstruct(endpoint, construct_query_super);
+        writeModel(fetchedModel, "rdf_" + className + "_super.ttl");
+
+        String construct_query_all = String.format(format_construct_all, className);
+        fetchedModel = fetchConstruct(endpoint, construct_query_all);
+        writeModel(fetchedModel, "rdf_" + className + "_all.ttl");
     }
 
     public static Model fetchConstruct(String endpoint, String query) {