TIl*_*lls 3 rdf sparql wikidata
我进行了查询,显示了“分类单元”“沙眼衣原体D / UW-3 / CX”中找到的所有项目。这些项目必须具有属性P644(基因组起始)和P645(基因组终止)。到目前为止,这有效。但是后来我想根据“基因组起点”和“基因组终点”的值来过滤这些项目。在我的示例中,我想接收“基因组起始值”高于“ 100”且“基因组终止值”低于“ 3000”的所有项目。但这没有用。我不是以正确的方式使用FILTER吗?
这是我的直接在Wikidata查询服务页面中的代码: Wikidata查询服务
SELECT ?item ?genomic_start ?genomic_end
Where{
?item wdt:P703 wd:Q20800373. #P703:found in taxon
?item wdt:P644 ?genomic_start.
?item wdt:P645 ?genomic_end.
FILTER (?genomic_start > "100").
FILTER (?genomic_end < "3000").
}
Run Code Online (Sandbox Code Playgroud)
您需要先将值转换为int才能使用>或<:
SELECT ?item ?genomic_start ?genomic_end
Where{
?item wdt:P703 wd:Q20800373. #P703:found in taxon
?item wdt:P644 ?genomic_start.
?item wdt:P645 ?genomic_end.
FILTER (xsd:integer(?genomic_start) > 100).
FILTER (xsd:integer(?genomic_end) < 3000).
}
Run Code Online (Sandbox Code Playgroud)