鉴于此 RDF:
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE rdf:RDF [<!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'>
<!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#'>]>
<rdf:RDF xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.example.org/"
xmlns:dnr="http://www.dotnetrdf.org/configuration#"
xmlns:nss="http://www.example.org/startTime"
xmlns:nse="http://www.example.org/endTime#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
<rdf:Description rdf:about="Fadi">
<ns2914:be xmlns:ns2914="http://example.org/">May</ns2914:be>
<nss:startTime>00:00:13</nss:startTime>
<nse:endTime>00:00:16</nse:endTime>
</rdf:Description>
<rdf:Description rdf:about="Fadi">
<ns194:not xmlns:ns194="http://example.org/">Good</ns194:not>
<nss:startTime>00:00:19</nss:startTime>
<nse:endTime>00:00:21</nse:endTime>
</rdf:Description>
<rdf:Description rdf:about="She">
<ns195:be xmlns:ns195="http://example.org/">Good</ns195:be>
<nss:startTime>00:00:21</nss:startTime>
<nse:endTime>00:00:24</nse:endTime>
</rdf:Description>
</rdf:RDF>
如何通过有关对象的查询获取 startTime 和 endTime?我尝试使用:
PREFIX nss: <http://www.example.org/startTime>
PREFIX nse: <http://www.example.org/endTime#>
SELECT *
WHERE
{
?s ?p ?o .
FILTER(REGEX(?o, 'Good', 'i'))
?s nss:startTime ?startTime ;
nse:endTime ?endTime .
}
但它只给了我第一个?startTime
和?endTime
For The Subject 它找到的 Object Good
。
我需要以下答案:
?s,?p,?o,?startTime,?endTime
Fadi,not,Good,00:00:19,00:00:21
She,be,Good,00:00:21,00:00:24