code: @Override
      public Set<URI> listSubClasses(URI classUri, boolean direct) {
  
          if (classUri == null)
              return ImmutableSet.of();
  
          StringBuilder strBuilder = new StringBuilder()
                  .append("select DISTINCT ?class where { \n");
  
          if (direct) {
              strBuilder
                      .append(" ?class ").append("<").append(RDFS.subClassOf.getURI()).append("> <").append(classUri).append("> . ")
                      .append(" FILTER NOT EXISTS { ?otherSub ").append("<").append(RDFS.subClassOf.getURI()).append(">+ <").append(classUri).append("> . ")
                      .append(" ?class ").append("<").append(RDFS.subClassOf.getURI()).append(">+ ?otherSub . ")
                      .append(" FILTER (( ?otherSub != ?class ) && ( ?otherSub != <").append(classUri).append("> )) } ");
          } else {
              strBuilder.append("?class").append(" <").append(RDFS.subClassOf.getURI()).append(">+ ").append("<").append(classUri.toASCIIString()).append("> .");
          }
  
          strBuilder.append(" }");
          return this.graphStoreManager.listResourcesByQuery(strBuilder.toString(), "class");
      }
docs: Answers a List of all the URIs of the classes that are declared to be sub-classes of this class.
  Note: this is currently dependent on Sesame's specific property for direct subclasses
  
  @param classUri the URI of the class for which to list the subclasses.
  @param direct   if true only the direct subclasses will be listed.
  @return the list of subclasses