generalise copyResourceToFile method and fix OWLDatatypeTest