Fixed malformated SPARQL query during insert_links