Defining, enforcing and checking privacy policies in data-intensive applications