Fixes to SPARQL and metadata mappings, new SQL script with metadata available