user2846043
user2846043

Reputation: 25

Dbpedia sparql - How to get the abstract for a team

I can get the player, teamName, city, dob, no and position of player by running the below sparql but how do I get the abstract (description) of the team please?

PREFIX dbpedia2: <http://dbpedia.org/property/>
SELECT *
WHERE {
?player dbpedia2:currentclub ?teamName.
OPTIONAL {?player dbpedia2:cityofbirth ?city}.
OPTIONAL {?player dbpedia2:dateOfBirth ?dob}.
OPTIONAL {?player dbpedia2:clubnumber ?no}.
OPTIONAL {?player dbpedia2:position ?position}.
}

Below query will get me the description of Barc but how do I combine these two queries to include the abstract in the result please?

prefix dbpedia: <http://dbpedia.org/resource/>
prefix dbpedia-owl: <http://dbpedia.org/ontology/>
select ?abstract ?thumbnail where { 
  <http://dbpedia.org/resource/FC_Barcelona> dbpedia-owl:abstract ?abstract ;
                                         dbpedia-owl:thumbnail ?thumbnail .
filter(langMatches(lang(?abstract),"en"))
}

Upvotes: 0

Views: 417

Answers (1)

user2846043
user2846043

Reputation: 25

I think I've got it:

PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
SELECT *
WHERE {
?player dbpedia2:currentclub ?teamName.
?teamName dbpedia-owl:abstract ?abstract.
OPTIONAL {?teamName dbpedia2:ground ?ground}.
OPTIONAL {?teamName dbpedia2:capacity ?capacity}.
OPTIONAL {?teamName dbpedia2:manager ?manager}.
OPTIONAL {?player dbpedia2:cityofbirth ?city}.
OPTIONAL {?player dbpedia2:dateOfBirth ?dob}.
OPTIONAL {?player dbpedia2:clubnumber ?no}.
OPTIONAL {?player dbpedia2:position ?position}.
filter(langMatches(lang(?abstract),"en"))
}

Upvotes: 1

Related Questions