I try to query a current (rev 1356848) Fuseki endpoint with a list of
VALUES and to update another one with aggregated results. It did not
work as expected, and I could reproduce the behaviour with the standard
books endpoint and an a (somehow contrieved) query:
 
When I execute the following statement 
 
  CONSTRUCT { $book dc:description ?dummy }
  WHERE {
    SERVICE <http://sparql.org/books/sparql>
    { SELECT ?book (COUNT(?title) AS ?dummy)
      WHERE { $book dc:title $title }
      GROUP BY $book
    }
    VALUES ?title {
      "Harry Potter and the Chamber of Secrets"
      "Harry Potter and the Philosopher's Stone"
    }
  }
 
I'd expect two triples to be produced - 
 
  <http://example.org/book/book1> dc:description  1 .
  <http://example.org/book/book2> dc:description  1 .
 
However, I get 7 triples, for book1 - book7.
 
A direct query against http://sparql.org/books/sparql
 
  CONSTRUCT { ?book dc:description ?dummy }
  WHERE {
    SELECT ?book (COUNT(?title) AS ?dummy)
    WHERE { $book dc:title $title }
    GROUP BY $book
    VALUES ?title {
      "Harry Potter and the Chamber of Secrets"
      "Harry Potter and the Philosopher's Stone"
    }
  }
 
works as expected. And so does a federated query without the
aggregation:
 
  CONSTRUCT { $book dc:title ?title }
  WHERE {
    SERVICE <http://sparql.org/books/sparql>
    { SELECT ?book ?title
      WHERE { $book dc:title $title }
    }
    VALUES ?title {
      "Harry Potter and the Chamber of Secrets"
      "Harry Potter and the Philosopher's Stone"
    }
  }
 
Am I missing something?
 
Cheers, Joachim

Reply via email to