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

NotMaterializedException with ORDER BY clause

    XMLWordPrintable

    Details

      Description

      This query:

      PREFIX wikibase: <http://wikiba.se/ontology#>
      PREFIX p: <http://www.wikidata.org/prop/>
      PREFIX v: <http://www.wikidata.org/prop/statement/>
      PREFIX q: <http://www.wikidata.org/prop/qualifier/>
      PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
      PREFIX prov: <http://www.w3.org/ns/prov#> 
      
      SELECT ?work ?workLabel ?author ?authorLabel ?genre ?location ?locationLabel ?geo ?location_statement ?citat  WHERE {
        ?work wdt:P31/wdt:P279* wd:Q386724 . 
        ?work wdt:P50 ?author .
        ?work p:P840 ?location_statement .
        ?location_statement v:P840 ?location .
        ?location wdt:P17 wd:Q35 .
        ?location wdt:P625 ?geo . 
        OPTIONAL {
          ?location_statement prov:wasDerivedFrom ?ref .
          ?ref pr:P1683 ?citat .
        }
      } 
      

      works on query.wikidata.org and finishes in ~16s producing 144 results.
      However, if I add an ORDER BY to it like this:

      prefix pr: <http://www.wikidata.org/prop/reference/>
      PREFIX wd: <http://www.wikidata.org/entity/>
      PREFIX wdt: <http://www.wikidata.org/prop/direct/>
      PREFIX wikibase: <http://wikiba.se/ontology#>
      PREFIX p: <http://www.wikidata.org/prop/>
      PREFIX v: <http://www.wikidata.org/prop/statement/>
      PREFIX q: <http://www.wikidata.org/prop/qualifier/>
      PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
      PREFIX prov: <http://www.w3.org/ns/prov#> 
      
      SELECT ?work ?workLabel ?author ?authorLabel ?genre ?location ?locationLabel ?geo ?location_statement ?citat  WHERE {
        ?work wdt:P31/wdt:P279* wd:Q386724 . 
        ?work wdt:P50 ?author .
        ?work p:P840 ?location_statement .
        ?location_statement v:P840 ?location .
        ?location wdt:P17 wd:Q35 .
        ?location wdt:P625 ?geo . 
        OPTIONAL {
          ?location_statement prov:wasDerivedFrom ?ref .
          ?ref pr:P1683 ?citat .
        }
      } ORDER BY ?work ?author
      

      which should be negligible since there's only 144 results - it produces a NotMaterializedException exception (see full exception in the comment).

        Attachments

        1. query.tsv
          77 kB
        2. solutions.cvs.gz
          2.03 MB

          Activity

            People

            Assignee:
            bryanthompson bryanthompson
            Reporter:
            stasmalyshev stasmalyshev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: