docs: def uri2niceString(aUri, namespaces=None):
      """
      From a URI, returns a nice string representation that uses also the namespace symbols
      Cuts the uri of the namespace, and replaces it with its shortcut (for base, attempts to infer it or leaves it blank)
  
      Namespaces are a list
  
      [('xml', rdflib.URIRef('http://www.w3.org/XML/1998/namespace'))
      ('', rdflib.URIRef('http://cohereweb.net/ontology/cohere.owl#'))
      (u'owl', rdflib.URIRef('http://www.w3.org/2002/07/owl#'))
      ('rdfs', rdflib.URIRef('http://www.w3.org/2000/01/rdf-schema#'))
      ('rdf', rdflib.URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#'))
      (u'xsd', rdflib.URIRef('http://www.w3.org/2001/XMLSchema#'))]
  
      """
      if not namespaces:
          namespaces = NAMESPACES_DEFAULT
  
      if not aUri:
          stringa = ""
      elif type(aUri) == rdflib.term.URIRef:
          # we have a URI: try to create a qName
          stringa = aUri.toPython()
          for aNamespaceTuple in namespaces:
              try:  # check if it matches the available NS
                  if stringa.find(aNamespaceTuple[1].__str__()) == 0:
                      if aNamespaceTuple[0]:  # for base NS, it's empty
                          stringa = aNamespaceTuple[0] + ":" + stringa[len(
                              aNamespaceTuple[1].__str__()):]
                      else:
                          prefix = inferNamespacePrefix(aNamespaceTuple[1])
                          if prefix:
                              stringa = prefix + ":" + stringa[len(
                                  aNamespaceTuple[1].__str__()):]
                          else:
                              stringa = ":" + stringa[len(aNamespaceTuple[1].
                                                          __str__()):]
              except:
                  stringa = "error"
  
      elif type(aUri) == rdflib.term.Literal:
          stringa = "\"%s\"" % aUri  # no string casting so to prevent encoding errors
      else:
          # print(type(aUri))
          if type(aUri) == type(u''):
              stringa = aUri
          else:
              stringa = aUri.toPython()
      return stringa