Sparql 仅从dbpedia获取英文值和整数

Sparql 仅从dbpedia获取英文值和整数,sparql,dbpedia,Sparql,Dbpedia,我试图从dbpedia中只检索英文值,可能还有整数。例如,下面的SPARQL查询 PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-

我试图从dbpedia中只检索英文值,可能还有整数。例如,下面的SPARQL查询

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dbo: <http://dbpedia.org/ontology/>
select distinct ?p ?o where {
dbr:Cristiano_Ronaldo ?p ?o
filter(langMatches(lang(?o),'en'))}
}
前缀owl:
前缀xsd:
前缀rdfs:
前缀rdf:
前缀foaf:
前缀dc:
前缀dbr:
前缀db2:
前缀dbpedia:
前缀skos:
前缀dbo:
选择不同的p?o,其中{
dbr:克里斯蒂亚诺·罗纳尔多?p?o
过滤器(langMatches(lang(?o),'en'))}
}
它正确地返回英文值。然而,它遗漏了重要的细节,如出生日期、身高、帽子数量等,因为它是整数,所以被遗漏了。如何创建一个RDF结果集,该结果集包含有关克里斯蒂亚诺·罗纳尔多的一组适当信息?

前缀dbr:
PREFIX dbr: <http://dbpedia.org/resource/>
SELECT DISTINCT ?p ?o where {
  dbr:Cristiano_Ronaldo ?p ?o
  BIND(datatype(?o) as ?dt)
  FILTER(IF(isliteral(?o) && !bound(?dt), langMatches(lang(?o),'en'), true))
}
选择不同的p?o,其中{ dbr:克里斯蒂亚诺·罗纳尔多?p?o 绑定(数据类型(?o)为?dt) 过滤器(IF(isliteral(?o)和&!bound(?dt),langMatches(lang(?o),'en'),true)) }
这给了我整个RDF。没有过滤掉任何内容。啊,对不起。现在好多了?它返回除字符串文本外的所有内容,仅返回英文文本。