code: def inferNamespacePrefix(aUri):
      
      stringa = aUri.__str__()
      try:
          prefix = stringa.replace("#", "").split("/")[-1]
      except:
          prefix = ""
      return prefix
docs: From a URI returns the last bit and simulates a namespace prefix when rendering the ontology.
  
      eg from <'http://www.w3.org/2008/05/skos#'>
          it returns the 'skos' string