code: def isValidList(self, l):  # modified to flatten lists specified using [ a rdf:List; ] syntax
          
          try:
              if self.store.value(l, RDF.first) is None:
                  return False
          except:
              return False
          while l:
              if l != RDF.nil:
                  po = list(self.store.predicate_objects(l))
                  if (RDF.type, RDF.List) in po and len(po) == 3:
                      pass
                  elif len(po) != 2:
                      return False
              l = self.store.value(l, RDF.rest)
          return True
docs: Checks if l is a valid RDF list, i.e. no nodes have other properties.