0
select distinct ?label ?resource count(distinct ?type) as ?score 
where
  {
    values ?type
      { <http://dbpedia.org/class/yago/Abstraction100002137> 
        <http://dbpedia.org/class/yago/Company108058098> 
        <http://dbpedia.org/class/yago/ElectronicsCompany108003035>
        <http://dbpedia.org/class/yago/Group100031264> 
        <http://dbpedia.org/class/yago/Institution108053576> 
        <http://dbpedia.org/class/yago/Organization108008335> 
      }
    ?resource rdfs:label ?label ;
              foaf:name  ?name ;
              a          ?type .
    FILTER (lang(?label) = 'en').
  } 
ORDER BY DESC(?score)
limit 10

I am trying to run this query but it shows transaction timeout, I cut out many of these links from this query, but still it shows same issue

TallTed
  • 9,069
  • 2
  • 22
  • 37
Anuj tyagi
  • 11
  • 3
  • 1
    what is the purpose of the query? the score is computed for what? I don't get what you count here, it will be always 6. And you're not grouping by each resource just in case you want to have the number of types per resource. The values of `foaf:name` aren't even used in the query. So, would be good if you explain what the query is supposed to do – UninformedUser Jun 27 '19 at 14:07
  • `select ?resource ?label (count(distinct ?cls) as ?score) where { {select ?resource { values ?type { } ?resource a ?type . } } ?resource rdfs:label ?label; a ?cls FILTER (lang(?label) = 'en'). } group by ?resource ?label ORDER BY DESC(?score) limit 10` – UninformedUser Jun 27 '19 at 14:48

0 Answers0