Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sparql 如何穿越skos:列出各个城市的旅游景点的更广泛属性_Sparql_Dbpedia - Fatal编程技术网

Sparql 如何穿越skos:列出各个城市的旅游景点的更广泛属性

Sparql 如何穿越skos:列出各个城市的旅游景点的更广泛属性,sparql,dbpedia,Sparql,Dbpedia,任何对我学习的帮助都将不胜感激 问题陈述: 需要打印各个城市的旅游景点列表 我有一个类别,我必须探索。问题是这个类别是一个SKO:更广泛的其他类别,如http://dbpedia.org/page/Category:Tourism_in_Bratislava 这本身就是一个skos:更广泛的http://dbpedia.org/page/Category:Visitor_attractions_in_Bratislava 其中包含dcterms:主题属性,是旅游景点列表。 我必须探索所有城市,从

任何对我学习的帮助都将不胜感激

问题陈述:

需要打印各个城市的旅游景点列表

我有一个类别,我必须探索。问题是这个类别是一个SKO:更广泛的其他类别,如http://dbpedia.org/page/Category:Tourism_in_Bratislava 这本身就是一个skos:更广泛的http://dbpedia.org/page/Category:Visitor_attractions_in_Bratislava 其中包含dcterms:主题属性,是旅游景点列表。 我必须探索所有城市,从旅游开始,按城市分类

我所做的

问题:

skos:broader正在进一步探索这个图表,我想把它限制到访客级别。另外,skos:Brother正在探索所有类别,但我希望它只针对游客景点类别进行探索

第1级:城市旅游->探索所有SKO:范围更广

第二级:旅游城市->仅探索类别:游客景点城市

第三级:不要进一步探索

这是可以实现的吗


如果问题不清楚,请务必告诉我。谢谢

终于解决了这个问题,我不知道这是否是唯一可行的选择:

SELECT DISTINCT (str(?city) as ?City) (str(?label) as ?Attractions)
WHERE { 
?entity skos:broader <http://dbpedia.org/resource/Category:Tourism_by_city> .
?places skos:broader ?entity .
?places rdfs:label ?city .
FILTER langMatches(lang(?city),"en") .
?attractions dcterms:subject ?places .
?attractions rdfs:label ?label .
FILTER langMatches(lang(?label),"en").
FILTER (if (isliteral(?city ),  contains(str(?city ), "Visitor"), false))
} 
ORDER BY ASC(?city)

,我也有同样的问题,你能给我一些步骤来做这件事吗。我想列出“dbpedia”或“wikipedia”中的所有吸引人的地方?你能详细说明一下吗?或者发布一个问题本身。谢谢
SELECT DISTINCT (str(?city) as ?City) (str(?label) as ?Attractions)
WHERE { 
?entity skos:broader <http://dbpedia.org/resource/Category:Tourism_by_city> .
?places skos:broader ?entity .
?places rdfs:label ?city .
FILTER langMatches(lang(?city),"en") .
?attractions dcterms:subject ?places .
?attractions rdfs:label ?label .
FILTER langMatches(lang(?label),"en").
FILTER (if (isliteral(?city ),  contains(str(?city ), "Visitor"), false))
} 
ORDER BY ASC(?city)