0

I'm trying to get a list of general speed limits for a given country from WikiData using SPARQLE.

For example France:

SELECT ?speed ?qualifierLabel WHERE {
    wd:Q142
        wdt:P3086 ?speed ;
       p:P3086 [
            ps:P3086 ?speed ;
            pq:P3005 ?qualifier ;
        ] . 
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}

This gives me 1 result. The web page knows 6 speed limits. For Germany (Q183) the same query gives me 2 results, the web page knows 3.

What's the problem here?

Update: UninformedUser has solved half of the problem, the info for France can be queried now. But for Germany this doesn't work 100%:

SELECT ?speed ?qualifierLabel WHERE {
    wd:Q183
       p:P3086 [
            ps:P3086 ?speed ;
            pq:P3005 ?qualifier ;
        ] . 
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}

You get only 2 results, while the web page lists 3. (Maybe because one of the results is "no value"? Is that filtered out?)

leuk98743
  • 131
  • 7
  • https://stackoverflow.com/questions/61627558/wikidata-truthy-data-dump - you mixed up the way how to query i) only truthy data and ii) all data, a join on `?speed` prevents all 6 results. Long story short, remove `wdt:P3086 ?speed ;` – UninformedUser Jun 20 '23 at 12:24
  • @UninformedUser: Thanks, you're right, that gets me all 6 results for France. But for Germany I still get only 2 of the 3 results. Do know the secret for this, too? – leuk98743 Jun 20 '23 at 15:56
  • BTW, do you know a good page that explains the SPARQL syntax? I tried to understand the Wikidata:SPARQL tutorial, but it only confuses me. – leuk98743 Jun 20 '23 at 15:59

0 Answers0