2017-03-09 83 views

回答

2

您使用子查詢。例如,

select ?country ?capital { 
    { select ?country { 
     #-- criteria for selecting country 
    } 

    ?country :hasCapital ?country 
} 

注意,在平凡的情況下,你不會需要一個單獨的子查詢,你可以只是做:

select ?country ?capital { 
    #-- criteria for selecting country 
    ?country :hasCapital ?country 
} 
+0

是的,我使用了嵌套查詢來解決它。謝謝! – jango

+0

@jango如果這工作,請考慮[接受答案](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work)。 –