title: SPARQL Query Printing Enumerate Class with JENA JAVA
body: <p>I made this owl model. There is two classes Sensor and Location, and Location is enumerated class.</p>
  
  <pre><code>:Sensor rdf:type owl:Class;
  :Location rdf:type owl:Class ;
                   owl:equivalentClass [ rdf:type owl:Class ;
                                         owl:oneOf ( :Bathroom
                                                     :Bedroom
                                                   )
                                       ] .
  :hasLocation rdf:type owl:ObjectProperty ;
                      rdfs:domain [ rdf:type owl:Class ;
                                    :Sensor
                                  ] ;
                      rdfs:range :Location .
  :Bathing rdf:type owl:NamedIndividual ,
                           ADLOntology:Bathing .
  :Bathroom rdf:type owl:NamedIndividual ,
                            ADLOntology:Location .
  :Window rdf:type owl:NamedIndividual ,
                             :Sensor ;
                    :hasLocation :Bedroom;
                    :hasId "55"^^xsd:int ; .
  </code></pre>
  
  <p>I am trying to get the location of each sensors with their id-number. I wrote my query in Protege and it works fine. But, on JENA it's printing null for the location. I used the <strong>Resource</strong> to print the sensor, but for the location it prints null. I couldn't figure it out the properer way to print the location.</p>
  
  <pre><code>String file = "C:/users/src/data.ttl";
  Model model = FileManager.get().loadModel(file);
  String queryString = "PREFIX : &lt;http://semanticweb.org/sensor#&gt;" +
                       "SELECT ?sensor ?location" +
                       "WHERE {?sensor :hasId \"55"\^^xsd:int." +
                               "?sensor :hasLocation ?location}";
  Query query = QueryFactory.create(queryString);
  try (QueryExecution qexec = QueryExecutionFactory.create(query, model)) {
            ResultSet result = qexec.execSelect();
            for ( ; result.hasNext(); ) {
                    QuerySolution soln = result.nextSolution();
                    Resource sensor= soln.getResource("sensor");
                    Resource location = soln.getResource("location");
                    System.out.println("Sensor" + sensor);
                    System.out.println("Location" + location);
            }
  }
  </code></pre>