2017-03-09 95 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)。 –