Sparql 扩展其他本体的owl

Sparql 扩展其他本体的owl,sparql,semantic-web,owl,dbpedia,Sparql,Semantic Web,Owl,Dbpedia,我在Protege中创建了以下OWL,当我在dbpedia.org/SPARQL中执行SPARQL时,它不会返回任何内容 @prefix : <http://www.wad.nistorandrei.com/ontology.owl#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @p

我在Protege中创建了以下OWL,当我在dbpedia.org/SPARQL中执行SPARQL时,它不会返回任何内容

@prefix : <http://www.wad.nistorandrei.com/ontology.owl#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<http://www.wad.nistorandrei.com/ontology.owl> a owl:Ontology .
# 
# 
# #################################################################
# #
# #    Object Properties
# #
# #################################################################
# 
# 
# http://www.wad.nistorandrei.com/ontology.owl#type

:type a owl:ObjectProperty ;
    rdfs:isDefinedBy rdf:type ;
    rdfs:label "type" .
# 
# 
# 
# #################################################################
# #
# #    Classes
# #
# #################################################################
# 
# 
# http://www.wad.nistorandrei.com/ontology.owl#Church

:Church a owl:Class ;
    rdfs:subClassOf :Place .
# 
# http://www.wad.nistorandrei.com/ontology.owl#Place

:Place a owl:Class .
# 
# Generated by the OWL API (version 4.1.3.20151118-2017) https://github.com/owlcs/owlapi
@前缀:。
@前缀owl:。
@前缀rdf:。
@前缀xml:。
@前缀xsd:。
@前缀rdfs:。
猫头鹰:本体论。
# 
# 
# #################################################################
# #
##对象属性
# #
# #################################################################
# 
# 
# http://www.wad.nistorandrei.com/ontology.owl#type
:键入owl:ObjectProperty;
rdf:isdefinedbyrdf:type;
rdfs:标签为“类型”。
# 
# 
# 
# #################################################################
# #
##班级
# #
# #################################################################
# 
# 
# http://www.wad.nistorandrei.com/ontology.owl#Church
:教会猫头鹰:班级;
rdfs:子类:位置。
# 
# http://www.wad.nistorandrei.com/ontology.owl#Place
:放置猫头鹰:类。
# 
#由OWL API生成(版本4.1.3.20151118-2017)https://github.com/owlcs/owlapi
这就是我试图执行的查询

PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
            PREFIX dbo: <http://dbpedia.org/ontology/>
            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
            PREFIX dcterms: <http://purl.org/dc/terms/>
            PREFIX ontology: <http://wad.nistorandrei.com/ontology.owl>

            SELECT DISTINCT * WHERE {
                            ?s a dbo:Place;
                            geo:lat ?lat;
                            geo:long ?lng;
                            ontology:type ?type;
                            rdfs:label ?label;
                            dcterms:subject ?sub;
                            dbo:abstract ?description;
                            dbo:thumbnail ?thumbnail .

                        FILTER( lang(?label) = "en" )
                        FILTER( lang(?description) = "en" ) . FILTER ( ( ?lng > 27.577898 && ?lng < 27.597898 && ?lat > 47.144996 && ?lat < 47.164996 ) ) }
        ORDER BY ?s
前缀geo:
前缀dbo:
前缀rdf:
前缀rdfs:
前缀dcterms:
前缀本体:
选择DISTINCT*WHERE{
?s a dbo:地点;
地理:拉特?拉特;
geo:long?lng;
本体:类型?类型;
rdfs:标签?标签;
dcterms:主题?子;
dbo:抽象描述;
缩图?缩图。
过滤器(lang(?label)=“en”)
过滤器(lang(?description)=“en”).过滤器((?lng>27.577898&&?lng<27.597898&&?lat>47.144996&&?lat<47.164996)))
订购人
如果您将“ontology:type?type;”更改为“rdf:type?type”,它将返回我需要的信息

我试图实现的(如果我做得不对的话)是将更多类型映射到一个类型。例如,本体论:教堂至**dbo:宗教建筑或与教堂相关的其他建筑**

对于使用ontology:type的查询来说,重要的是它可以工作

谁能给我一个提示吗

谢谢。

问题 这里有几个问题

错误的前缀 首先,你正在使用

前缀本体:
#-- ...
本体:类型?类型
这意味着本体:type代表

http://wad.nistorandrei.com/ontology.owltype(里面没有#

而您在本体中声明的属性是

http://www.wad.nistorandrei.com/ontology.owl#type(带有#

所以你实际上使用的是不同的虹膜。您应该将前缀声明为:

PREFIX ontology: <http://wad.nistorandrei.com/ontology.owl#>

这将正确处理区域性变体。例如,如果?var绑定到“color”@en gb,它仍然会匹配。

如果想法是基于DBpedia中的数据创建RDF数据,您可能需要使用构造查询来创建相应的三元组。还有一个类似的问题可能会有所帮助,“谢谢你的回答。有没有办法合并两个本体并返回所需的信息?”目前还不清楚“所需的信息是什么”。你能举一个你想得到的结果的例子吗?除此之外,我们只是猜测您要做什么。如果您将查询“ontology:type?type;”更改为“rdf:type?type;”并在中执行查询,您将看到结果。但为什么不直接运行该查询呢?查询正在DBpedia数据中查找三元组。DBpedia有三个表单
a rdf:type b
,但没有任何表单
a yourontology:type b
。你不能做你听起来想做的事。明白了,谢谢你的帮助。谢谢你的回复。有没有一种方法可以合并2个本体并返回所需的信息?您想合并什么?您知道DBpedia数据集有多大吗?合并意味着在本地建立自己的三重存储,然后将DBpedia和本体加载到其中。但即使这样,也没有一个资源包含使用您的词汇表的数据。
filter langMatches(lang(?var), "en")