Stephen,

I'm neither an expert in SPARQL nor Virtuoso, but I tend to believe  
the syntax of the (full) query is invalid - I think UNION can only be  
used to combine graph patterns, not full queries (like in SQL). Maybe  
some of the experts here or on the Virtuoso mailing list[1] could  
clarify? (The query returns: S0022 Error SQ200: No column s-12-2.text)

Additionally, this snippet is of interest to me:

SELECT DISTINCT * WHERE {
     {<http://dbpedia.org/resource/Microsoft> dbpedia2:abstract ?text.}
     UNION
     {<http://dbpedia.org/resource/Microsoft> dbpedia2:abstract ?text.  
FILTER langMatches( lang(?text), "FR" )}
}
LIMIT 1

How do you know that the second pattern has preference? Is this  
somewhere documented, SPARQL specification, Virtuoso?

Best,

Martin

[1] <https://lists.sourceforge.net/lists/listinfo/virtuoso-users>


Am 31.12.2009 um 23:16 schrieb Stephen Hatton:

> Thanks for your help Martin.
> I tried your suggestion using UNION, but now I have another question.
>
> In the following example I successfully use a UNION and LIMIT to
> restrict the results to the first result containing text either inthe
> preferred language or in the next available language (the fallback
> result).
>
> The problem I have is using this as a subquery so that the results are
> combined into a larger set of results. If you uncomment the second
> half of the example below, instead of returning one or two results it
> will return none.
>
> Example:
> http://dbpedia.org/snorql/?query=SELECT+*+WHERE+%7B%0D%0A++%7B%0D%0A++++SELECT+DISTINCT+*+WHERE+%7B%0D%0A++++++%7B%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FMicrosoft%3E+dbpedia2%3Aabstract+%3Ftext.%7D%0D%0A++++++UNION%0D%0A++++++%7B%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FMicrosoft%3E+dbpedia2%3Aabstract+%3Ftext.+FILTER+langMatches%28+lang%28%3Ftext%29%2C+%22FR%22+%29%7D%0D%0A++++%7D%0D%0A++++LIMIT+1%0D%0A++%7D%0D%0A++%23UNION%0D%0A++%23%7B%0D%0A++++%23SELECT+DISTINCT+*+WHERE+%7B%0D%0A++++++%23%7B%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FGoogle%3E+dbpedia2%3Aabstract+%3Ftext.%7D%0D%0A++++++%23UNION%0D%0A++++++%23%7B%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FGoogle%3E+dbpedia2%3Aabstract+%3Ftext.+FILTER+langMatches%28+lang%28%3Ftext%29%2C+%22FR%22+%29%7D%0D%0A++++%23%7D%0D%0A++++%23LIMIT+1%0D%0A++%23%7D%0D%0A%7D
>
> Thank you,
> Stephen Hatton
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast  
> and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Dbpedia-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to