fix: use NameError to capture lack of rdflib when writing rdf