-2
我有两个where
子句。此查询中的逻辑错误?
PREFIX tourister: <PREFIX_VALUE>
SELECT ?a
WHERE {
{?a tourister:hasRating ?b .
?b ?c '5'@string } .
{?a tourister:hasFeature ?b .
?b ?c 'Pool'@string }
}
它们工作得很好,当对自己执行,或者如果他们之间有一个UNION
条款,但是,我要寻找交集。从我在线阅读的内容中,我发现,'.
'可用于交集。但是,使用.
,我得到0个结果。不,语法错误,逻辑错误。
而且,请注意,上述查询中的PREFIX_VALUE
不是错误,我故意省略了它。
<!-- http://tourister.space/ontologies/tourism#TESTInd -->
<owl:NamedIndividual rdf:about="http://tourister.space/ontologies/tourism#TESTInd">
<rdf:type rdf:resource="http://tourister.space/ontologies/tourism#Hotel"/>
<hasFeature rdf:resource="http://tourister.space/ontologies/tourism#TESTIndFeature"/>
<hasRating rdf:resource="http://tourister.space/ontologies/tourism#TESTIndRating"/>
</owl:NamedIndividual>
<!-- http://tourister.space/ontologies/tourism#TESTIndFeature -->
<owl:NamedIndividual rdf:about="http://tourister.space/ontologies/tourism#TESTIndFeature">
<rdf:type rdf:resource="http://tourister.space/ontologies/tourism#Feature"/>
<hasName xml:lang="string">Pool</hasName>
</owl:NamedIndividual>
<!-- http://tourister.space/ontologies/tourism#TESTIndRating -->
<owl:NamedIndividual rdf:about="http://tourister.space/ontologies/tourism#TESTIndRating">
<rdf:type rdf:resource="http://tourister.space/ontologies/tourism#Rating"/>
<hasStarRating xml:lang="string">5</hasStarRating>
</owl:NamedIndividual>
我们需要更多的细节。请参阅http://stackoverflow.com/help/mcve – AndyS
为什么不能使用更简单的查询并删除内部大括号?我建议你为语言值使用一些适当的语言标签,而不是'字符串' – AKSW
RDF也是不正确的。 'XML:LANG = “字符串”'??我建议不要手写RDF/XML。这根本不是人类可读的。 – scotthenninger