维基数据查询服务,为 values/string 过滤 above/below 特定值
Wikidata Query Service, filtering for values/string that lay above/below a certain value
我进行了查询,显示了 'found in taxon' 'Chlamydia trachomatis D/UW-3/CX' 的所有项目。这些项目必须具有属性 P644(基因组起点)和 P645(基因组终点)。到目前为止,这是有效的。但后来我想根据 'genomic start' 和 'genomic end' 的值过滤这些项目。在我的示例中,我想接收所有项目,其中 'genomic start' 高于“100”且 'genomic end' 低于“3000”。但它没有用。我使用 FILTER 的方式不对吗?
这是我直接在维基数据查询服务页面中的代码:
Wikidata Query Service
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").
}
您需要先将值转换为 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).
}
我进行了查询,显示了 'found in taxon' 'Chlamydia trachomatis D/UW-3/CX' 的所有项目。这些项目必须具有属性 P644(基因组起点)和 P645(基因组终点)。到目前为止,这是有效的。但后来我想根据 'genomic start' 和 'genomic end' 的值过滤这些项目。在我的示例中,我想接收所有项目,其中 'genomic start' 高于“100”且 'genomic end' 低于“3000”。但它没有用。我使用 FILTER 的方式不对吗?
这是我直接在维基数据查询服务页面中的代码: Wikidata Query Service
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").
}
您需要先将值转换为 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).
}