Added missing GRAPH elements that had disappeared mysteriously
Added missing target_name (from ChEMBL) to SPARQL query
Change !=0 to !==0 (to avoid inserting erroneous limits for _pageSize=all
Added regular expression to change all 'COUNT ( ?var' to 'COUNT ( DISTINCT ?var'. Due to issue with OpenRDF parser used by the query expander.