Jean-Claude, the variable isn't visible, or in scope, to your select statement
this is how you can to do it PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX wikibase: <http://wikiba.se/ontology#> PREFIX bd: <http://www.bigdata.com/rdf#> SELECT * WHERE { SERVICE <https://query.wikidata.org/bigdata/namespace/wdq/sparql> { SELECT ?p ?propLabel ?o ?oLabel WHERE { BIND(<http://www.wikidata.org/entity/Q640447> as ?wikidata) ?wikidata ?p ?o . ?prop wikibase:directClaim ?p . SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr" .} } } } On Thu, Dec 19, 2019 at 3:48 PM Jean-Claude Moissinac < jean-claude.moissi...@telecom-paristech.fr> wrote: > Hello > > In an instance of Fuseki, I'm trying the following query > > PREFIX wdt: <http://www.wikidata.org/prop/direct/> > > prefix wikibase: <http://wikiba.se/ontology#> > > PREFIX bd: <http://www.bigdata.com/rdf#> > > SELECT * where > > { > > bind(<http://www.wikidata.org/entity/Q640447> as ?wikidata) > > service <https://query.wikidata.org/bigdata/namespace/wdq/sparql> { > > select ?p ?propLabel ?o ?oLabel where { > > ?wikidata ?p ?o . ?prop wikibase:directClaim ?p . SERVICE wikibase:label { > bd:serviceParam wikibase:language "en,fr" . > > } } } } > > > which fails with an error 500 (Error 500: HTTP 500 error making the query: > Internal Server Error) > > While the following one gives results: > > PREFIX wdt: <http://www.wikidata.org/prop/direct/> > > prefix wikibase: <http://wikiba.se/ontology#> > > PREFIX bd: <http://www.bigdata.com/rdf#> > > SELECT * where { > > bind(<http://www.wikidata.org/entity/Q640447> as ?wikidata) > > service <https://query.wikidata.org/bigdata/namespace/wdq/sparql> { > > select ?p ?propLabel ?o ?oLabel where { > > <http://www.wikidata.org/entity/Q640447> ?p ?o . > > ?prop wikibase:directClaim ?p . SERVICE wikibase:label { bd:serviceParam > wikibase:language "en,fr" . > > } } } } > > > In my real query, in place of the bind, I have some code which selects some > wikidata entities. The goal is to get a wikidata description of these > entities > > Have you some ideas? > > > -- > Jean-Claude Moissinac > -- --- Marco Neumann KONA