Reputation: 1224
Is there some way to obtain only goals that soccer players scored in Fiorentina with dbpedia.org SPARQL endpoint? I tried the following query, but unfortunately I obtain goals for each season.
select * where {
?player a dbo:SoccerPlayer.
?player dbo:team <http://dbpedia.org/resource/ACF_Fiorentina>.
?player dbp:position <http://dbpedia.org/resource/Forward_(association_football)>.
?player dbp:goals ?goal.
}
limit 10000
Upvotes: 2
Views: 90
Reputation: 85873
I think you can do this. If you browse the data for Silva, you'll see a number of career stations, e.g., station 12, each of which has a number of goals. That means you can do:
select * where {
?player a dbo:SoccerPlayer ;
dbp:position <http://dbpedia.org/resource/Forward_(association_football)> ;
dbo:careerStation ?station .
?station dbo:numberOfGoals ?goals ;
dbo:team dbr:ACF_Fiorentina .
}
Of course, a player might have multiple stations on the same team, so you'd still want to aggregate over each player and sum the goals:
select ?player (sum(?goals) as ?totalGoals) where {
?player a dbo:SoccerPlayer ;
dbp:position <http://dbpedia.org/resource/Forward_(association_football)> ;
dbo:careerStation ?station .
?station dbo:numberOfGoals ?goals ;
dbo:team dbr:ACF_Fiorentina .
}
group by ?player
There are some other questions that involve querying career stations that might be useful:
Upvotes: 3