我可以通过运行下面的sparql来获取玩家,teamName,city,dob,no和玩家的位置但是我如何得到团队的摘要(描述)呢?
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}.
}
下面的查询将为我提供Barc的描述,但如何将这两个查询结合起来将结果中的摘要包括在内?
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"))
}
答案 0 :(得分:1)
我想我已经明白了:
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"))
}