Mining the Semantic Web: a Logic based Methodology