Thank's for the reply.
But the intent is to select some instances of the ?wikidata variable
outside the service <> {...}
Your proposal works, but you can't obtain the ?wikidata instances outside
the service
The goal is to have some sparql code which select instances of ?wikidata
outside of the service and then, to get the triples associated to the
?wikidata instances in the service (so, in wikidata).
(the bind was just a way to illustrate a code which set a ?wikidata
instance outside the service).
It's seem to me that it is simple example of a fedarated query: I've
entities in a context (my fuseki triple store), and I would like to access
to what is known by wikidata about these entities.


--
Jean-Claude Moissinac



Le jeu. 19 déc. 2019 à 18:35, Marco Neumann <[email protected]> a
écrit :

> 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 <
> [email protected]> 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
>

Reply via email to