Would it be better to move this to an exported function of graphdb ?