An abstract implementation of the PK-tree data structure