How to create domain ontology lexicon by getting all the classes name attribute relations and save it in the lists
<p>I am new to the ontology and semantic analysis. currently, I have one public ontology source which was from BBC website. the source is in " .ttl " format. 
I was also to load the source in Jena by using eclipse. However, i was a little lost when i see the code. </p>

<p>Here is some example:</p>

<pre><code>&lt;http://www.bbc.co.uk/ontologies/bbc/Mobile&gt;
      a       &lt;http://www.bbc.co.uk/ontologies/bbc/Platform&gt; ;
      &lt;http://www.w3.org/2000/01/rdf-schema#comment&gt;
              "Represents the web documents designed for a smaller, mobile screen."@en-gb ;
      &lt;http://www.w3.org/2000/01/rdf-schema#isDefinedBy&gt;
              &lt;http://www.bbc.co.uk/ontologies/bbc&gt; ;
      &lt;http://www.w3.org/2000/01/rdf-schema#label&gt;
              "Mobile"@en-gb .

&lt;http://www.bbc.co.uk/ontologies/bbc/primaryContent&gt;
      a       &lt;http://www.w3.org/2002/07/owl#ObjectProperty&gt; ;
      &lt;http://www.w3.org/2000/01/rdf-schema#comment&gt;
              "Represents the fact that a web document has as primary content the creative work (e.g., a news story about Tom Daley is the primary content of a webpage)."@en-gb ;
      &lt;http://www.w3.org/2000/01/rdf-schema#domain&gt;
              &lt;http://www.bbc.co.uk/ontologies/bbc/WebDocument&gt; ;
      &lt;http://www.w3.org/2000/01/rdf-schema#isDefinedBy&gt;
              &lt;http://www.bbc.co.uk/ontologies/bbc&gt; ;
      &lt;http://www.w3.org/2000/01/rdf-schema#label&gt;
              "primaryContent"@en-gb ;
      &lt;http://www.w3.org/2000/01/rdf-schema#range&gt;
              &lt;http://www.bbc.co.uk/ontologies/creativework/CreativeWork&gt; ;
      &lt;http://www.w3.org/2002/07/owl#inverseOf&gt;
              &lt;http://www.bbc.co.uk/ontologies/bbc/primaryContentOf&gt; .
</code></pre>

<p>So how can I getting all the classes name attribute relations and save it in the lists?? 
Is it possible to do it in Python?? As I am not sure hoe rdflib in python can be use</p>

<pre><code>for subj, pred, obj in g:
    subname = subj.split("/")[-1]  
</code></pre>

<p>This way you can get the name of the subject.</p>

python eclipse jena ontology apache-jena