-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