Hi and welcome!
You can implement a transaction listener to perform a task (such as logging) on transactions from the SNARL protocol. We have an example of this in our examples repo.
null
doesn't make sense as the object of a triple (or any element of a triple for that matter). We are actively re-working some of our RDF parsing such that this kind of error should be caught at compile time, however until then what you're doing is my recommendation.
If it's too "ugly," perhaps consider tweaking the literal()
method to return an empty String when passed a null value? This is assuming you would want that data loaded at all.