Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-4476

DISTINCT does not eliminate duplicate rows

    XMLWordPrintable

    Details

      Description

      This query:

      SELECT DISTINCT ?language ?languageLabel ?nSpeakers ?Lx ?LxLabel ?time ?country WHERE
      {
          ?language wdt:P31/wdt:P279* wd:Q34770.
          ?language p:P1098 ?nSpeakersStatement.
          ?nSpeakersStatement ps:P1098 ?nSpeakers
          optional {?nSpeakersStatement pq:P518 ?Lx}.
          optional {?nSpeakersStatement pq:P585 ?time}.
          optional {?nSpeakersStatement pq:P17 ?country}.
          FILTER EXISTS {?wikipedia wdt:P407 ?language}.
          SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
          
      }
      

      Produces repeated row for wd:Q29921 even though it should be eliminated by DISTINCT.
      Even more strange, when I add "ORDER BY ?languageLabel" at the end, the duplicate row disappears and the query result count is reduced from 368 to 364. I suspect something is wrong with how DISTINCT eliminates duplicates. I'll try to reduce the example further.

        Attachments

        1. alldata.gz
          3.24 MB
        2. export.csv
          25 kB
        3. export-nodistinct.csv
          25 kB
        4. export-order.csv
          23 kB

          Activity

            People

            Assignee:
            michaelschmidt michaelschmidt
            Reporter:
            stasmalyshev stasmalyshev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: