在sparql中匹配两个单词

问题描述 投票:0回答:1

[如何列出获奖者的奖项(由其标签给予),其贡献的描述(由诺贝尔奖:动机)包含“人类”一词和“和平”一词(即,两个词都必须存在) 。

我使用了the the full-text search feature of Blazegraph中的bds:search命名空间。访问此链接后,我编写了此查询Free text search in sparql when you have multiword and scaping character

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bds: <http://www.bigdata.com/rdf/search#>
PREFIX nobel: <http://data.nobelprize.org/terms/>

SELECT ?awards  ?description  
WHERE { 
  ?entity rdfs:label   ?awards  .
  ?entity nobel:motivation ?description  .
   FILTER ( bds:search ( ?description, '"human" AND "peace"' ) ) 
}

此查询在执行时返回了以下错误,如图所示。Error Image如何更正此查询并获得所需结果?您可以查看此数据集的规格或下载RDF dump of the datasetenter image description here

sparql rdf semantic-web ontology rdfs
1个回答
0
投票

使用bds:search搜索“人类”类别。然后对“和平”应用过滤器并包含函数。

© www.soinside.com 2019 - 2024. All rights reserved.