SPARQL RDF前缀

时间:2017-11-15 18:05:50

标签: sparql rdf rdfs turtle-rdf

我想知道为什么我从我自己的本体中用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)

}

1 个答案:

答案 0 :(得分:0)

问题是AKSW说的,前缀声明定义错误,因此不会在查询中返回任何结果。

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

相关问题