0

I tried to get soccer players from wikidata since 1 August 2019 with additional information (name, team, team number, apperances, goals) from wikidata with this query:

SELECT ?SoccerPlayerLabel (group_concat(distinct ?TeamLabel;separator=", ") as ?teams) 
(sum(?numMatches) as ?numMatchesTotal) (sum(?numGoals) as ?numGoalsTotal) { 
SELECT ?SoccerPlayer ?SoccerPlayerLabel ?Team ?TeamLabel ?TeamNumber ?numMatches ?numGoals WHERE 
{ ?SoccerPlayer wdt:P106 wd:Q937857; p:P54 
[ ps:P54 ?Team; 
  pq:P1618 ?TeamNumber; 
  pq:P1350 ?numMatches; 
  pq:P1351 ?numGoals]. 
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".} }}group by ?SoccerPlayerLabel

but I couldn't filter returned tuples with the specified date (1 August 2019)

amine4392
  • 79
  • 6
  • 1
    what means "since"? I mean, the date in terms of what? The current team? – UninformedUser Feb 03 '20 at 18:33
  • by the way, regarding your previous question: if you just want the most recent team, you have to use a filter. And you also need an OPTIONAL for the team number, this value does not always exist – UninformedUser Feb 03 '20 at 19:00
  • `SELECT ?SoccerPlayer ?SoccerPlayerLabel ?Team ?TeamLabel ?TeamNumber ?numMatches ?numGoals ?startTime WHERE {?SoccerPlayer wdt:P106 wd:Q937857; p:P54 ?stmt . ?stmt ps:P54 ?Team; pq:P1350 ?numMatches; pq:P1351 ?numGoals; pq:P580 ?startTime . optional {?stmt pq:P1618 ?TeamNumber} filter not exists {?SoccerPlayer p:P54/pq:P580 ?startTimeOther filter(?startTimeOther > ?startTime)} #FILTER(?startTime >= "2018-01-01T00:00:00Z"^^xsd:dateTime). SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".} } limit 100` – UninformedUser Feb 03 '20 at 19:01
  • @AKSW it worked thanks a lot. Now, I wanna ask you how to get the corresponding results from wikipedia with the same entites (same soccer player) – amine4392 Feb 04 '20 at 11:10

0 Answers0