[英]How to find titles containing a string using SPARQL?
例如,如何使用SPARQL查找標題中包含字符串“ shape”的Wikimedia Commons類別?
我也想問一下如何更改腳本以:
這是一個基本版本,使用regex
將結果過濾為包含“ shape”的結果。 對於所需的其他String功能(第1點和第2點),您應該在這里查看SPARQL String函數 。
您對我的第3點和第4點不清楚,我建議為他們發布一個專門的其他問題。
select distinct ?catName where {
?s wdt:P373 ?catName. # Name of the Wikimedia Commons category for ?s
Filter (regex (?catName,"shape")) # basic filtering of the results to those containg "shape"
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.