query-sparql: better file handling