0

I used this request to retrieve soccer players and some of their properties (name, team, team number, apperances, goals) since the last two years:

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 200

I want to retrieve the corresponding entites from wikipedia with the same properties

amine4392
  • 79
  • 6
  • with exactly the same properties? Just repeat the triple pattern but use a different var for the player. Just as a sketch: `SELECT ?SoccerPlayer ?numGoals WHERE {?SoccerPlayer wdt:numGoals ?numGoals . ?SoccerPlayerOther wdt:numGoals ?numGoals . filter(?SoccerPlayer != ?SoccerPlayerOther)}` - just do it for all properties. But I doubt you'll find anything with exactly all those properties. I mean, same team, same number of goals, same matches? Would be weird, right? – UninformedUser Feb 04 '20 at 13:09
  • @AKSW should I use the mediaWiki Api or there is an endpoint to query wikipedia? – amine4392 Feb 04 '20 at 14:04
  • I misread the question, here for Wikipedia pages a sketch query: `select ?SoccerPlayer ?article { ?SoccerPlayer wdt:P106 wd:Q937857 . OPTIONAL { ?article schema:about ?SoccerPlayer . ?article schema:isPartOf . } } limit 100` - you have to add it to your query then – UninformedUser Feb 04 '20 at 15:57

0 Answers0