title: How to read out specific values from an OWL Ontology using Java
body: <p>I've got an OWL Ontology:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;rdf:RDF
      xmlns="http://www.owl-ontologies.com/Ontology1272923485.owl#"
      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
      xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
      xmlns:owl="http://www.w3.org/2002/07/owl#"
      xml:base="http://www.owl-ontologies.com/Ontology1272923485.owl"&gt;
    &lt;owl:Ontology rdf:about=""/&gt;
    &lt;owl:Class rdf:ID="studypath"&gt;
      &lt;owl:disjointWith&gt;
        &lt;owl:Class rdf:ID="module"/&gt;
      &lt;/owl:disjointWith&gt;
      &lt;owl:disjointWith&gt;
        &lt;owl:Class rdf:ID="docent"/&gt;
      &lt;/owl:disjointWith&gt;
    &lt;/owl:Class&gt;
    &lt;owl:Class rdf:about="#docent"&gt;
      &lt;owl:disjointWith&gt;
        &lt;owl:Class rdf:about="#module"/&gt;
      &lt;/owl:disjointWith&gt;
      &lt;owl:disjointWith rdf:resource="#studypath"/&gt;
      &lt;rdfs:subClassOf&gt;
        &lt;owl:Restriction&gt;
          &lt;owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
                              &gt;1&lt;/owl:minCardinality&gt;
          &lt;owl:valuesFrom&gt;
            &lt;owl:Class rdf:about="#module"/&gt;
          &lt;/owl:valuesFrom&gt;
          &lt;owl:onProperty&gt;
            &lt;owl:ObjectProperty rdf:ID="responsiblefor"/&gt;
          &lt;/owl:onProperty&gt;
        &lt;/owl:Restriction&gt;
      &lt;/rdfs:subClassOf&gt;
      &lt;rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
    &lt;/owl:Class&gt;
    &lt;owl:Class rdf:about="#module"&gt;
      &lt;rdfs:subClassOf&gt;
        &lt;owl:Restriction&gt;
          &lt;owl:onProperty&gt;
            &lt;owl:ObjectProperty rdf:ID="predecessor_module"/&gt;
          &lt;/owl:onProperty&gt;
          &lt;owl:someValuesFrom rdf:resource="#module"/&gt;
        &lt;/owl:Restriction&gt;
      &lt;/rdfs:subClassOf&gt;
      &lt;rdfs:subClassOf&gt;
        &lt;owl:Restriction&gt;
          &lt;owl:someValuesFrom rdf:resource="#module"/&gt;
          &lt;owl:onProperty&gt;
            &lt;owl:ObjectProperty rdf:ID="folgemodule"/&gt;
          &lt;/owl:onProperty&gt;
        &lt;/owl:Restriction&gt;
      &lt;/rdfs:subClassOf&gt;
      &lt;rdfs:subClassOf&gt;
        &lt;owl:Restriction&gt;
          &lt;owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
                              &gt;1&lt;/owl:minCardinality&gt;
          &lt;owl:onProperty&gt;
            &lt;owl:ObjectProperty rdf:ID="offeredfor"/&gt;
          &lt;/owl:onProperty&gt;
          &lt;owl:valuesFrom rdf:resource="#studypath"/&gt;
        &lt;/owl:Restriction&gt;
      &lt;/rdfs:subClassOf&gt;
      &lt;rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
      &lt;owl:disjointWith rdf:resource="#docent"/&gt;
      &lt;owl:disjointWith rdf:resource="#studypath"/&gt;
    &lt;/owl:Class&gt;
    &lt;owl:ObjectProperty rdf:about="#predecessor_module"&gt;
      &lt;rdfs:range rdf:resource="#module"/&gt;
      &lt;rdfs:domain rdf:resource="#module"/&gt;
      &lt;owl:inverseOf&gt;
        &lt;owl:ObjectProperty rdf:about="#folgemodule"/&gt;
      &lt;/owl:inverseOf&gt;
    &lt;/owl:ObjectProperty&gt;
    &lt;owl:ObjectProperty rdf:about="#folgemodule"&gt;
      &lt;owl:inverseOf rdf:resource="#predecessor_module"/&gt;
      &lt;rdfs:range rdf:resource="#module"/&gt;
      &lt;rdfs:domain rdf:resource="#module"/&gt;
    &lt;/owl:ObjectProperty&gt;
    &lt;owl:ObjectProperty rdf:about="#offeredfor"&gt;
      &lt;rdfs:range rdf:resource="#studypath"/&gt;
      &lt;rdfs:domain rdf:resource="#module"/&gt;
    &lt;/owl:ObjectProperty&gt;
    &lt;owl:ObjectProperty rdf:about="#responsiblefor"&gt;
      &lt;rdfs:domain rdf:resource="#docent"/&gt;
      &lt;rdfs:range rdf:resource="#module"/&gt;
    &lt;/owl:ObjectProperty&gt;
    &lt;module rdf:ID="Datenbanken"&gt;
      &lt;offeredfor&gt;
        &lt;studypath rdf:ID="WIN"/&gt;
      &lt;/offeredfor&gt;
    &lt;/module&gt;
    &lt;docent rdf:ID="John_Smith"&gt;
      &lt;responsiblefor rdf:resource="#Datenbanken"/&gt;
    &lt;/docent&gt;
    &lt;module rdf:ID="Softwaretechnik"/&gt;
    &lt;docent rdf:ID="Wayne_Smith"&gt;
      &lt;responsiblefor rdf:resource="#Softwaretechnik"/&gt;
    &lt;/docent&gt;
  &lt;/rdf:RDF&gt;
  </code></pre>
  
  <p>Now I am using Java API for querying the ontology. If I have <code>Wayne_Smith</code>, for example, how can I query for the module he is responsible for?</p>