code: def process_rdfgraph(self, rg, ont=None):
          
          # TODO: ontology metadata
          if ont is None:
              ont = Ontology()
              subjs = list(rg.subjects(RDF.type, SKOS.ConceptScheme))
              if len(subjs) == 0:
                  logging.warning("No ConceptScheme")
              else:
                  ont.id = self._uri2id(subjs[0])
              
          subset_map = {}
          for concept in rg.subjects(RDF.type, SKOS.Concept):
              for s in self._get_schemes(rg, concept):
                  subset_map[self._uri2id(s)] = s
                  
          for concept in sorted(list(rg.subjects(RDF.type, SKOS.Concept))):
              concept_uri = str(concept)
              id=self._uri2id(concept)
              logging.info("ADDING: {}".format(id))
              ont.add_node(id, self._get_label(rg,concept))
                      
              for defn in rg.objects(concept, SKOS.definition):
                  if (defn.language == self.lang):
                      td = TextDefinition(id, escape_value(defn.value))
                      ont.add_text_definition(td)
                      
              for s in rg.objects(concept, SKOS.broader):
                  ont.add_parent(id, self._uri2id(s))
                  
              for s in rg.objects(concept, SKOS.related):
                  ont.add_parent(id, self._uri2id(s), self._uri2id(SKOS.related))
                  
              for m in rg.objects(concept, SKOS.exactMatch):
                  ont.add_xref(id, self._uri2id(m))
                  
              for m in rg.objects(concept, SKOS.altLabel):
                  syn = Synonym(id, val=self._uri2id(m))
                  ont.add_synonym(syn)
                  
              for s in self._get_schemes(rg,concept):
                  ont.add_to_subset(id, self._uri2id(s))
                  
          return ont
docs: Transform a skos terminology expressed in an rdf graph into an Ontology object
  
          Arguments
          ---------
          rg: rdflib.Graph
              graph object
  
          Returns
          -------
          Ontology