我有一些本体(campus.owl)。有树类(学生,体育,讲师)。 Student类接合与讲师类使用“有”的对象属性和Student类加入了与运动类具有“isPlay”对象属性。

问题

我想用一些SPARQL查询来获取学生和讲师之间的对象属性。

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX my: <http://www.semanticweb.org/ontologies/2010/5/Ontology1275975684120.owl#>

SELECT ?prop
WHERE {
  ?prop ..........???
}

我该如何操作?

有帮助吗?

解决方案

SELECT ?prop WHERE { ?student ?prop ?lecturer.
                     ?student a <student>.
                     ?lecturer a <lecturer>.
                     }

我认为这会做你想要什么。

如果你想获得说不上属性信息,你可以这样做

SELECT ?prop, ?pp, ?oo WHERE {
                     ?prop ?pp ?oo.
                     ?student ?prop ?lecturer.
                     ?student a <student>.
                     ?lecturer a <lecturer>.
                     }
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top