0

我想知道为什么我从我自己的本体中使用 SPARQL 查询的所有内容都有一个巨大的前缀?

我对这一切都很陌生,所以我可能做错了什么,但是运行这个查询

base <http://kasperrt/interests.ttl#>
prefix interests: <http://kasperrt.no/interests.ttl>

SELECT DISTINCT ?class ?s ?a
WHERE {
  ?s a ?class .
}
LIMIT 25
OFFSET 0

为什么所有东西都以http://www.semanticweb.org/kasperrt/ontologies/2017/10/untitled-ontology-7之类的东西为前缀 ?

为什么这个查询不返回任何东西?

base <http://kasperrt/interests.ttl#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix interests: <http://kasperrt.no/interests.ttl>

SELECT DISTINCT ?interest1 ?interest2 ?name1 ?name2
WHERE {
    ?interest1
        rdfs:label ?name1;
        interests:Location ?location1.

    ?interest2
        rdfs:label ?name2;
        interests:Location ?location2.


  filter(?location1 != ?location2)

}
4

1 回答 1

0

问题正如 AKSW 所说,前缀声明定义错误,因此在查询中没有返回任何结果。

查询中未指定本体 IRI。请记住在正确使用 Protégé 时进行重构(正如 Stanislav Kralin 所说)。

于 2017-11-20T11:56:10.923 回答