Improve RDF parser resilience in smart-api-base.js based on Pascal's suggestion