query: SELECT DISTINCT ?item1 ?item2 ?name1 ?name2 ?instance1 ?instance2 ?sl1 ?sl2 ?value ?dist ?count
  { 
    SELECT DISTINCT ?item1 ?item2 (SAMPLE (?name1) as ?name1) (SAMPLE (?name2) as ?name2) (sample (?instance1) as ?instance1) (sample (?instance2) as ?instance2) ?sl1 ?sl2 ?value ?dist ?count
    {
  
        ?item1 wdt:P1566 ?value .
       #?item1 wdt:P17 wd:Q159 .
  	  ?item2 wdt:P1566 ?value .
       
        #?item1 wdt:P1566 ?values1 .
        #?item2 wdt:P1566 ?values2 .
         
        ?item1 wdt:P625 ?coord1 .
        ?item2 wdt:P625 ?coord2 .
    
        BIND(geof:distance(?coord1, ?coord2) as ?dist)  
  
        FILTER( ?item1 != ?item2 ) .
        FILTER (?dist < 5.01) .
         
        ?item1 wikibase:sitelinks ?sl1 .
        ?item2 wikibase:sitelinks ?sl2 .
    
        OPTIONAL{?item1 wdt:P31 ?instance1 .}
        OPTIONAL{?item2 wdt:P31 ?instance2 .}
     
        FILTER((?instance1=?instance2)||!BOUND(?instance1)||!BOUND(?instance2))
      
  	  #SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,ceb,en" } .
  
        ?item1 rdfs:label ?name1 .
        #FILTER((LANG(?name1)) = "ceb")
   
        ?item2 rdfs:label ?name2 .
        #FILTER((LANG(?name2)) = "sv")
             
       FILTER ( CONTAINS(str(?name1),str(?name2)) || CONTAINS(str(?name2),str(?name1)) )
      
       #FILTER (REGEX( str(?name2), "\\u0029$") || REGEX( str(?name1), "\\u0029$") ). 
       #FILTER REGEX( str(?name2), "\\u0029$") . 
      
       FILTER ((?sl1 < 2) || (?sl2 < 2))    
  
    }
    GROUP BY ?item1 ?item2 ?sl1 ?sl2 ?value ?dist ?count
   
  }
  LIMIT 10000