<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-11615</id>
	<title>Nabble - w3.org - public-rdf-dawg-comments</title>
	<updated>2009-12-15T02:15:55Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/w3.org---public-rdf-dawg-comments-f11615.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/w3.org---public-rdf-dawg-comments-f11615.html" />
	<subtitle type="html">This is a forum for public feedback to documents created by the RDF Data Access Working Group.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26793174</id>
	<title>Re: Comments on SPARQL 1.1</title>
	<published>2009-12-15T02:15:55Z</published>
	<updated>2009-12-15T02:15:55Z</updated>
	<author>
		<name>Steve Harris-11</name>
	</author>
	<content type="html">Rob,
&lt;br&gt;&lt;br&gt;Thank you for your comments. Responses to your queries are inline below.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Hi all
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; Here are my comments/questions on the draft. &amp;nbsp;Some of this is based &amp;nbsp;
&lt;br&gt;on
&lt;br&gt;&amp;nbsp;&amp;gt; personal opinion and some of this is based on starting to try and &amp;nbsp;
&lt;br&gt;implement
&lt;br&gt;&amp;nbsp;&amp;gt; some of this stuff in my SPARQL implementation in my latest &amp;nbsp;
&lt;br&gt;development
&lt;br&gt;&amp;nbsp;&amp;gt; builds of dotNetRDF (early Alpha release .Net RDF library).
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; Aggregates
&lt;br&gt;&amp;nbsp;&amp;gt; - I definitely support the use of a separate HAVING keyword, I &amp;nbsp;
&lt;br&gt;agree with
&lt;br&gt;&amp;nbsp;&amp;gt; Leigh that it makes clear that the type of constraint is different &amp;nbsp;
&lt;br&gt;and helps
&lt;br&gt;&amp;nbsp;&amp;gt; SQL programmers make the move to SPARQL by making the syntax familiar
&lt;br&gt;&lt;br&gt;The WG has not yet made a decision on which syntax to use, but the &amp;nbsp;
&lt;br&gt;editors are currently considering the options.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; - The proposed grammar has a couple of things which bug me:
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp;1. It allows for a Having clause without a Group By clause which &amp;nbsp;
&lt;br&gt;doesn't
&lt;br&gt;&amp;nbsp;&amp;gt; necessarily make sense depending on the constraint given. &amp;nbsp;I assume &amp;nbsp;
&lt;br&gt;that if
&lt;br&gt;&amp;nbsp;&amp;gt; you have a Having clause without a Group By then it should act as a &amp;nbsp;
&lt;br&gt;Filter
&lt;br&gt;&amp;nbsp;&amp;gt; on the result set?
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp;The only reason I can see for allowing this is if the having &amp;nbsp;
&lt;br&gt;clause uses
&lt;br&gt;&amp;nbsp;&amp;gt; an aggregate then this makes sense in some circumstances e.g. &amp;nbsp;
&lt;br&gt;seeing whether
&lt;br&gt;&amp;nbsp;&amp;gt; there are a given number of Triples matching a pattern:
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; SELECT * WHERE {?s a ?type} HAVING (COUNT(?s) &amp;gt; 10)
&lt;br&gt;&lt;br&gt;Currently the proposal is that by default a binding multiset will &amp;nbsp;
&lt;br&gt;consist of 1 groups containing all solutions. This is compatible with &amp;nbsp;
&lt;br&gt;the way SQL works. However this design is not final, and may well &amp;nbsp;
&lt;br&gt;change in the near future.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp;2. What is the intended meaning of grouping by an aggregate since &amp;nbsp;
&lt;br&gt;the
&lt;br&gt;&amp;nbsp;&amp;gt; grammar permits this? &amp;nbsp;Should this be permitted at all?
&lt;br&gt;&lt;br&gt;Perhaps not. The grammar does not explicitly rule out all the &amp;nbsp;
&lt;br&gt;syntactically invalid expressions, some things are left to the &amp;nbsp;
&lt;br&gt;application, to reduce the complexity of the grammar.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; - On the subject of which aggregates to include I think the ones &amp;nbsp;
&lt;br&gt;currently
&lt;br&gt;&amp;nbsp;&amp;gt; proposed are all useful and I can't think of any obvious missing &amp;nbsp;
&lt;br&gt;ones. &amp;nbsp;With
&lt;br&gt;&amp;nbsp;&amp;gt; regards to how MIN and MAX should operate would it be reasonable to &amp;nbsp;
&lt;br&gt;suggest
&lt;br&gt;&amp;nbsp;&amp;gt; that since SPARQL defines a partial ordering over values that MIN/ 
&lt;br&gt;MAX should
&lt;br&gt;&amp;nbsp;&amp;gt; return the minimum/maximum based on that ordering. &amp;nbsp;This is much &amp;nbsp;
&lt;br&gt;easier to
&lt;br&gt;&amp;nbsp;&amp;gt; implement than doing some form of type detection or having some &amp;nbsp;
&lt;br&gt;complex
&lt;br&gt;&amp;nbsp;&amp;gt; algorithm for how they operate over mixed datatypes. &amp;nbsp;While it does &amp;nbsp;
&lt;br&gt;have the
&lt;br&gt;&amp;nbsp;&amp;gt; disadvantage or potentially returning different results depending &amp;nbsp;
&lt;br&gt;on how
&lt;br&gt;&amp;nbsp;&amp;gt; exactly the SPARQL engine orders values I would be happy with this
&lt;br&gt;&amp;nbsp;&amp;gt; behaviour. &amp;nbsp;If people really need type specific minima/maxima then &amp;nbsp;
&lt;br&gt;they can
&lt;br&gt;&amp;nbsp;&amp;gt; use appropriate FILTERs in their queries or possibly extra &amp;nbsp;
&lt;br&gt;aggregates could
&lt;br&gt;&amp;nbsp;&amp;gt; be introduced eg. NMIN/NMAX (Numeric minimum/maximum)
&lt;br&gt;&lt;br&gt;This is the behavior that the group is proposing to go with.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Subqueries
&lt;br&gt;&amp;nbsp;&amp;gt; - I would appreciate some clearer guidance on variable scoping as I &amp;nbsp;
&lt;br&gt;don't
&lt;br&gt;&amp;nbsp;&amp;gt; feel comfortable attempting to implement these until I have a &amp;nbsp;
&lt;br&gt;better idea of
&lt;br&gt;&amp;nbsp;&amp;gt; how this should work.
&lt;br&gt;&lt;br&gt;Certainly. The intention is that only variables projected from the &amp;nbsp;
&lt;br&gt;subquery be in scope in the outer expression.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Projection Expressions
&lt;br&gt;&amp;nbsp;&amp;gt; - I like these very much and have implemented these already. &amp;nbsp;I &amp;nbsp;
&lt;br&gt;personally
&lt;br&gt;&amp;nbsp;&amp;gt; don't like the idea of a LET keyword, it certainly restricts the &amp;nbsp;
&lt;br&gt;ability of
&lt;br&gt;&amp;nbsp;&amp;gt; the SPARQL processor to decide in what order it wishes to execute &amp;nbsp;
&lt;br&gt;the query.
&lt;br&gt;&amp;nbsp;&amp;gt; Plus to my mind it starts to make SPARQL into the equivalent of &amp;nbsp;
&lt;br&gt;Transact SQL
&lt;br&gt;&amp;nbsp;&amp;gt; (and other vendor specific SQL stored procedure languages) which &amp;nbsp;
&lt;br&gt;feels wrong
&lt;br&gt;&amp;nbsp;&amp;gt; to me.
&lt;br&gt;&lt;br&gt;The ordering concern is not necessarily a problem, depending on how &amp;nbsp;
&lt;br&gt;LET would be defined.
&lt;br&gt;&lt;br&gt;Your concern in the second point is noted.
&lt;br&gt;&lt;br&gt;The group has previously decided not to to address LET like structures &amp;nbsp;
&lt;br&gt;in this version of the recommendation, as yet that decision has not &amp;nbsp;
&lt;br&gt;been revisited.
&lt;br&gt;&lt;br&gt;Steve Harris,
&lt;br&gt;on behalf of the SPARQL working group.
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Comments-on-SPARQL-1.1-tp26793174p26793174.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26684466</id>
	<title>Re: Some comments on the SPARQL 1.1 draft documents</title>
	<published>2009-12-07T13:26:22Z</published>
	<updated>2009-12-07T13:26:22Z</updated>
	<author>
		<name>Axel Polleres-2</name>
	</author>
	<content type="html">Hi Ben,
&lt;br&gt;&lt;br&gt;First, thanks for your comments.
&lt;br&gt;&lt;br&gt;&amp;gt; The first, smaller point was a disappointment with the choice 
&lt;br&gt;&amp;gt; of RDF/XML as the one standard required to be supported by the 
&lt;br&gt;&amp;gt; new RDF graph HTTP management API. [...] Other easy to parse 
&lt;br&gt;&amp;gt; protocols have existed for years. Why the continued support 
&lt;br&gt;&amp;gt; of RDF/XML as the canonical standard?
&lt;br&gt;&lt;br&gt;The working group is operating in the W3C realm, and RDF/XML is the only normative format to exchange RDF at this point. While other formats are being used and supported, the standardisation of these formats is not in the scope of the SPARQL WG.
&lt;br&gt;&lt;br&gt;&amp;gt; The larger point was that the sizable syntax extensions make a
&lt;br&gt;&amp;gt; protocol with limited adoption even more difficult to implement.
&lt;br&gt;&amp;gt; Implementations do not exist for several popular web development
&lt;br&gt;&amp;gt; languages, and enlarging the syntax only increases the range of
&lt;br&gt;&amp;gt; features that are 'required' to be supported.
&lt;br&gt;&lt;br&gt;In case this is referring to the Update part of the protocol, let us emphasize that we do not require nor intend that a SPARQL endpoint has to support both SPARQL/Query and SPARQL/Update. In this sense, and in the sense that SPARQL1.1 shall be fully upwards compatible, any SPARQL endpoint implementing only query shall be fully conformant.
&lt;br&gt;&lt;br&gt;There are a large number of implementations of SPARQL 1.0 in a wide variety of language environments spanning both scripting languages and compiled languages. You can see a community-maintained list of implementations here: &lt;a href=&quot;http://esw.w3.org/topic/SparqlImplementations&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://esw.w3.org/topic/SparqlImplementations&lt;/a&gt;&lt;br&gt;&lt;br&gt;The Working Group selected the current set of deliverables based upon three months of deliberations that included feedback from both SPARQL implementors and users as to what features &amp; extensions are most widely needed for improved utility and interoperability of SPARQL.
&lt;br&gt;&lt;br&gt;&amp;gt; I suggested that a better route would be to establish a more
&lt;br&gt;&amp;gt; machine-friendly format as the standard, and define SPARQL in terms of
&lt;br&gt;&amp;gt; how it compiles into that. &amp;nbsp;That algebra, already published alongside
&lt;br&gt;&amp;gt; the syntax, is readably expressible as S-expressions, and those should
&lt;br&gt;&amp;gt; be the protocol, with the human-readable form as an addendum. &amp;nbsp;The end
&lt;br&gt;&amp;gt; result is that *every* language feature can easily be subject to
&lt;br&gt;&amp;gt; extension, service discovery, and the incremental implementation that
&lt;br&gt;&amp;gt; small-scale open source projects need, instead of only those features
&lt;br&gt;&amp;gt; expressible by extension functions.
&lt;br&gt;&lt;br&gt;I am not sure what exactly you are referring to here, but the goal of the group is to develop widely requested and implemented extensions &amp;nbsp;of SPARQL in an upwards compatible fashion. This does not foresee to change the format of the language radically, nor have concrete proposals for such new format been suggested when the group was chartered.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; The service discovery feature was an excellent step in the right
&lt;br&gt;&amp;gt; direction, and some of us would love to see it apply to everything
&lt;br&gt;&amp;gt; SPARQL can do, not just part of it.
&lt;br&gt;&lt;br&gt;Thank you for this comment. Indeed the service description feature is intended to be minimal and extensible by external vocabularies to describe e.g. datasets, additional endpoint features, etc. The group will very much welcome such proposals which might, if widely used, be adopted in further versions of the standard.
&lt;br&gt;&lt;br&gt;with best regards, 
&lt;br&gt;Axel Polleres, on behalf of the SPARQL WG
&lt;br&gt;&lt;br&gt;&lt;br&gt;On 5 Nov 2009, at 21:00, Ben Lavender wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I posted some comments about the 1.1 draft on my blog, which Axel
&lt;br&gt;&amp;gt; Polleres asked that I post here. &amp;nbsp;I will not paste the entire
&lt;br&gt;&amp;gt; contents, as I suffer from a clinical lack of conciseness. &amp;nbsp;Instead, I
&lt;br&gt;&amp;gt; will say my two main points and link.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The first, smaller point was a disappointment with the choice of
&lt;br&gt;&amp;gt; RDF/XML as the one standard required to be supported by the new RDF
&lt;br&gt;&amp;gt; graph HTTP management API. &amp;nbsp;The protocol has issues marked as
&lt;br&gt;&amp;gt; 'postponed' for years. &amp;nbsp;Other easy to parse protocols have existed for
&lt;br&gt;&amp;gt; years. &amp;nbsp;Why the continued support of RDF/XML as the canonical
&lt;br&gt;&amp;gt; standard?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The larger point was that the sizable syntax extensions make a
&lt;br&gt;&amp;gt; protocol with limited adoption even more difficult to implement.
&lt;br&gt;&amp;gt; Implementations do not exist for several popular web development
&lt;br&gt;&amp;gt; languages, and enlarging the syntax only increases the range of
&lt;br&gt;&amp;gt; features that are 'required' to be supported.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I suggested that a better route would be to establish a more
&lt;br&gt;&amp;gt; machine-friendly format as the standard, and define SPARQL in terms of
&lt;br&gt;&amp;gt; how it compiles into that. &amp;nbsp;That algebra, already published alongside
&lt;br&gt;&amp;gt; the syntax, is readably expressible as S-expressions, and those should
&lt;br&gt;&amp;gt; be the protocol, with the human-readable form as an addendum. &amp;nbsp;The end
&lt;br&gt;&amp;gt; result is that *every* language feature can easily be subject to
&lt;br&gt;&amp;gt; extension, service discovery, and the incremental implementation that
&lt;br&gt;&amp;gt; small-scale open source projects need, instead of only those features
&lt;br&gt;&amp;gt; expressible by extension functions.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Further, it's worth noting that SQL has spent the last 20 years being
&lt;br&gt;&amp;gt; abstracted away by necessarily complicated libraries, and having the
&lt;br&gt;&amp;gt; structure of a query language be well-defined in a machine-readable
&lt;br&gt;&amp;gt; format seems to be more forward-looking than the incidental details of
&lt;br&gt;&amp;gt; a human-readable version.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The service discovery feature was an excellent step in the right
&lt;br&gt;&amp;gt; direction, and some of us would love to see it apply to everything
&lt;br&gt;&amp;gt; SPARQL can do, not just part of it.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The long-winded version is at:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://bhuga.net/2009/11/w3c-going-wrong-direction-sparql-11&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://bhuga.net/2009/11/w3c-going-wrong-direction-sparql-11&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Ben Lavender
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Some-comments-on-the-SPARQL-1.1-draft-documents-tp26222210p26684466.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26572717</id>
	<title>Re: SPARQL 1.1 Aggregates</title>
	<published>2009-11-30T02:54:15Z</published>
	<updated>2009-11-30T02:54:15Z</updated>
	<author>
		<name>Axel Polleres-2</name>
	</author>
	<content type="html">Hi Toby,
&lt;br&gt;&lt;br&gt;As for MEAN/MEDIAN, this issue is being discussed, as for the others,
&lt;br&gt;can you give us an indication which current system implements these?
&lt;br&gt;the main rationale with the new features which we try to violate only in exceptional cases is
&lt;br&gt;that we aim to standardise what is implemented by systems &amp;quot;out there&amp;quot;. Others can be added by 
&lt;br&gt;means of the standard extensibility mechanisms. 
&lt;br&gt;&lt;br&gt;As for LONGEST/SHORTEST, that seems to be doable with MIN/MAX in combination with 
&lt;br&gt;fn:string-length(), right?
&lt;br&gt;&lt;br&gt;best,
&lt;br&gt;Axel
&lt;br&gt;&lt;br&gt;On 30 Nov 2009, at 09:46, Toby Inkster wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I see that the built-in set of aggregates for SPARQL 1.1 has not yet
&lt;br&gt;&amp;gt; been decided.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The current list is quite numerically oriented. Here are some I'd like
&lt;br&gt;&amp;gt; to see:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CONCAT - concatenates values, with an optional second
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parameter to provide a joiner character. Result
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; is a plain literal with no language.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XML_CONCAT - Concatenates values into an XMLLiteral
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using an SPARQL-Results-like structure.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LONGEST/SHORTEST - returns the longest or shortest
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result (in terms of character count). Optional
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; second parameter specifies a language.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MODE/MEDIAN - while AVG returns the mean result, these
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; two would return other kinds of average. With
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; named graphs, the same triple can occur
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; multiple times, so MODE makes sense. Optional
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; second parameter specifies a language.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In the case where I've indicated that the second parameter specifies a
&lt;br&gt;&amp;gt; language, the aggregate function would work like this:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1. Do any values in the list match the specified language?
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Using same definition of &amp;quot;match&amp;quot; as langMatches.)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If so, then discard any results which don't match.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2. Run the aggregate as normal.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So for example, on the following graph:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;a href=&quot;http://example.com/cat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/cat&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rdfs:label &amp;quot;cat&amp;quot;@en, &amp;quot;chat&amp;quot;@fr, &amp;quot;feline&amp;quot;@en, &amp;quot;felis&amp;quot;@la.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This SPARQL query:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT ?resource (SHORTEST(?label,&amp;quot;fr&amp;quot;) AS ?mylabel)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE { ?resource rdfs:label ?label . }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Would return:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; resource &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | mylabel
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -------------------------+-----------
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;a href=&quot;http://example.com/cat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/cat&lt;/a&gt;&amp;gt; | &amp;quot;chat&amp;quot;@fr
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Because the non-French values would be discarded, with the shortest
&lt;br&gt;&amp;gt; remaining label being selected. However, this:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT ?resource (SHORTEST(?label,&amp;quot;de&amp;quot;) AS ?mylabel)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE { ?resource rdfs:label ?label . }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Would return
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; resource &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | mylabel
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -------------------------+-----------
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;a href=&quot;http://example.com/cat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/cat&lt;/a&gt;&amp;gt; | &amp;quot;cat&amp;quot;@en
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; There was no German label in the data, so the discarding step never
&lt;br&gt;&amp;gt; happens - thus the shortest of any language is selected.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I think in terms of presenting views of graph data, having these
&lt;br&gt;&amp;gt; aggregate language preferences (and they're preferences, not filters, as
&lt;br&gt;&amp;gt; the second example illustrates) would be very useful - especially for
&lt;br&gt;&amp;gt; &amp;quot;label&amp;quot; and &amp;quot;description&amp;quot; kinds of fields.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; While I'm giving examples, I'll provide some for CONCAT and XML_CONCAT:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ?resource
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (CONCAT(?label, &amp;quot;;&amp;quot;) AS ?concat)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (XML_CONCAT(?label) AS ?xmlconcat)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE { ?resource rdfs:label ?label . }
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ORDER BY ?label
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ?concat would be &amp;quot;cat;chat;feline;felis&amp;quot; (the ORDER BY clause having
&lt;br&gt;&amp;gt; been used by the aggregate function). ?xmlconcat would be:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;quot;&amp;quot;&amp;quot;&amp;lt;literal xml:lang=&amp;quot;en&amp;quot;&amp;gt;cat&amp;lt;/literal&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;literal xml:lang=&amp;quot;fr&amp;quot;&amp;gt;chat&amp;lt;/literal&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;literal xml:lang=&amp;quot;en&amp;quot;&amp;gt;feline&amp;lt;/literal&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;literal xml:lang=&amp;quot;la&amp;quot;&amp;gt;felis&amp;lt;/literal&amp;gt;&amp;quot;&amp;quot;&amp;quot;^^rdf:XMLLiteral
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Perhaps the data type could be more specialised - instead of
&lt;br&gt;&amp;gt; rdf:XMLLiteral, it could be, say, sparql:XMLResultsLiteral, which SPARQL
&lt;br&gt;&amp;gt; libraries could recognise and automagically parse for you.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Toby A Inkster
&lt;br&gt;&amp;gt; &amp;lt;mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26572717&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mail@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://tobyinkster.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tobyinkster.co.uk&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/SPARQL-1.1-Aggregates-tp26571832p26572717.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26571832</id>
	<title>SPARQL 1.1 Aggregates</title>
	<published>2009-11-30T01:46:24Z</published>
	<updated>2009-11-30T01:46:24Z</updated>
	<author>
		<name>Toby Inkster-4</name>
	</author>
	<content type="html">I see that the built-in set of aggregates for SPARQL 1.1 has not yet
&lt;br&gt;been decided.
&lt;br&gt;&lt;br&gt;The current list is quite numerically oriented. Here are some I'd like
&lt;br&gt;to see:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CONCAT - concatenates values, with an optional second
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parameter to provide a joiner character. Result
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; is a plain literal with no language.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XML_CONCAT - Concatenates values into an XMLLiteral
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using an SPARQL-Results-like structure.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LONGEST/SHORTEST - returns the longest or shortest
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result (in terms of character count). Optional
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; second parameter specifies a language.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MODE/MEDIAN - while AVG returns the mean result, these
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; two would return other kinds of average. With
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; named graphs, the same triple can occur
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; multiple times, so MODE makes sense. Optional
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; second parameter specifies a language.
&lt;br&gt;&lt;br&gt;In the case where I've indicated that the second parameter specifies a
&lt;br&gt;language, the aggregate function would work like this:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1. Do any values in the list match the specified language?
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Using same definition of &amp;quot;match&amp;quot; as langMatches.)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If so, then discard any results which don't match.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2. Run the aggregate as normal.
&lt;br&gt;&lt;br&gt;So for example, on the following graph:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;a href=&quot;http://example.com/cat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/cat&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rdfs:label &amp;quot;cat&amp;quot;@en, &amp;quot;chat&amp;quot;@fr, &amp;quot;feline&amp;quot;@en, &amp;quot;felis&amp;quot;@la.
&lt;br&gt;&lt;br&gt;This SPARQL query:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT ?resource (SHORTEST(?label,&amp;quot;fr&amp;quot;) AS ?mylabel)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE { ?resource rdfs:label ?label . }
&lt;br&gt;&lt;br&gt;Would return:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; resource &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | mylabel
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -------------------------+-----------
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;a href=&quot;http://example.com/cat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/cat&lt;/a&gt;&amp;gt; | &amp;quot;chat&amp;quot;@fr
&lt;br&gt;&lt;br&gt;Because the non-French values would be discarded, with the shortest
&lt;br&gt;remaining label being selected. However, this:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT ?resource (SHORTEST(?label,&amp;quot;de&amp;quot;) AS ?mylabel)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE { ?resource rdfs:label ?label . }
&lt;br&gt;&lt;br&gt;Would return
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; resource &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | mylabel
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -------------------------+-----------
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;a href=&quot;http://example.com/cat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://example.com/cat&lt;/a&gt;&amp;gt; | &amp;quot;cat&amp;quot;@en
&lt;br&gt;&lt;br&gt;There was no German label in the data, so the discarding step never
&lt;br&gt;happens - thus the shortest of any language is selected.
&lt;br&gt;&lt;br&gt;I think in terms of presenting views of graph data, having these
&lt;br&gt;aggregate language preferences (and they're preferences, not filters, as
&lt;br&gt;the second example illustrates) would be very useful - especially for
&lt;br&gt;&amp;quot;label&amp;quot; and &amp;quot;description&amp;quot; kinds of fields.
&lt;br&gt;&lt;br&gt;While I'm giving examples, I'll provide some for CONCAT and XML_CONCAT:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ?resource
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (CONCAT(?label, &amp;quot;;&amp;quot;) AS ?concat)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (XML_CONCAT(?label) AS ?xmlconcat)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE { ?resource rdfs:label ?label . }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ORDER BY ?label
&lt;br&gt;&lt;br&gt;?concat would be &amp;quot;cat;chat;feline;felis&amp;quot; (the ORDER BY clause having
&lt;br&gt;been used by the aggregate function). ?xmlconcat would be:
&lt;br&gt;&lt;br&gt;&amp;quot;&amp;quot;&amp;quot;&amp;lt;literal xml:lang=&amp;quot;en&amp;quot;&amp;gt;cat&amp;lt;/literal&amp;gt;
&lt;br&gt;&amp;lt;literal xml:lang=&amp;quot;fr&amp;quot;&amp;gt;chat&amp;lt;/literal&amp;gt;
&lt;br&gt;&amp;lt;literal xml:lang=&amp;quot;en&amp;quot;&amp;gt;feline&amp;lt;/literal&amp;gt;
&lt;br&gt;&amp;lt;literal xml:lang=&amp;quot;la&amp;quot;&amp;gt;felis&amp;lt;/literal&amp;gt;&amp;quot;&amp;quot;&amp;quot;^^rdf:XMLLiteral 
&lt;br&gt;&lt;br&gt;Perhaps the data type could be more specialised - instead of
&lt;br&gt;rdf:XMLLiteral, it could be, say, sparql:XMLResultsLiteral, which SPARQL
&lt;br&gt;libraries could recognise and automagically parse for you.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Toby A Inkster
&lt;br&gt;&amp;lt;mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26571832&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mail@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://tobyinkster.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tobyinkster.co.uk&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/SPARQL-1.1-Aggregates-tp26571832p26571832.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26437549</id>
	<title>Re: Inferencing on graph patterns</title>
	<published>2009-11-19T18:28:27Z</published>
	<updated>2009-11-19T18:28:27Z</updated>
	<author>
		<name>Enrico Franconi</name>
	</author>
	<content type="html">Ooops, sorry: I realise just now that you were talking about OWL2 *RL*.
&lt;br&gt;I don't have a full picture of OWL2 RL, but: if OWL2 RL allows for &amp;nbsp;
&lt;br&gt;recursive rules, then again SPARQL can not encode it due to a data &amp;nbsp;
&lt;br&gt;complexity argument - linear time lower bound for recursive rules as &amp;nbsp;
&lt;br&gt;opposed to AC0 (sub-linear and sub-logspace) upper bound for SPARQL.
&lt;br&gt;cheers
&lt;br&gt;--e.
&lt;br&gt;&lt;br&gt;On 20 Nov 2009, at 02:20, Enrico Franconi wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On 14 Nov 2009, at 11:41, Simon Reinhardt wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Note, however, that you may get what you want with a different &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; query.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; For &amp;nbsp;example, in this case, the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; SELECT ?type WHERE { ex:C1 rdfs:subclass ?type. }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; will return all possible types.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Ok. Querying for inferred types was just an example, the initial &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; use case that brought me to this was actually a bit more complex &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; (property restrictions). For this that kind of inferencing would &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; have made the query a lot simpler. But it should still be possible &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; to cover a lot of the inferencing &amp;quot;rules&amp;quot; with SPARQL, especially &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; with property paths. Maybe it's worth investigating at some point &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; how much of OWL 2 RL could be implemented with pure SPARQL - and &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; what extensions would be needed to add the missing bits. But that's &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; just something to keep in mind for the future. :-)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you fix the entailment regime to RDFS, then very little of OWL2 &amp;nbsp;
&lt;br&gt;&amp;gt; can be encoded in SPARQL, since it is has been shown that the &amp;nbsp;
&lt;br&gt;&amp;gt; computational complexities diverge too much. There are also simple &amp;nbsp;
&lt;br&gt;&amp;gt; counter-examples showing that it does not make sense to have an OWL2 &amp;nbsp;
&lt;br&gt;&amp;gt; entailment regime in SPARQL, since you would get unsound results &amp;nbsp;
&lt;br&gt;&amp;gt; (wrt OWL2 semantics) very easily. So, really, SPARQL can hardly go &amp;nbsp;
&lt;br&gt;&amp;gt; beyond RDFS.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; cheers
&lt;br&gt;&amp;gt; --e.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [1] Enrico Franconi. The logic of RDF and SPARQL: a tutorial. &amp;nbsp;
&lt;br&gt;&amp;gt; Invited talk at the 25th ACM Symposium on Principles of Database &amp;nbsp;
&lt;br&gt;&amp;gt; Systems (PODS-2006), in Chicago IL, on 26-28 June 2006. &amp;lt;&lt;a href=&quot;http://www.inf.unibz.it/~franconi/papers/franconi-slides-pods-2006.pdf&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.inf.unibz.it/~franconi/papers/franconi-slides-pods-2006.pdf&lt;/a&gt;&amp;nbsp;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;/div&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;smime.p7s&lt;/strong&gt; (3K) &lt;a href=&quot;http://old.nabble.com/attachment/26437549/0/smime.p7s&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Inferencing-on-graph-patterns-tp26265355p26437549.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26437492</id>
	<title>Re: Inferencing on graph patterns</title>
	<published>2009-11-19T18:20:35Z</published>
	<updated>2009-11-19T18:20:35Z</updated>
	<author>
		<name>Enrico Franconi</name>
	</author>
	<content type="html">On 14 Nov 2009, at 11:41, Simon Reinhardt wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; Note, however, that you may get what you want with a different query.
&lt;br&gt;&amp;gt;&amp;gt; For &amp;nbsp;example, in this case, the
&lt;br&gt;&amp;gt;&amp;gt; SELECT ?type WHERE { ex:C1 rdfs:subclass ?type. }
&lt;br&gt;&amp;gt;&amp;gt; will return all possible types.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Ok. Querying for inferred types was just an example, the initial use &amp;nbsp;
&lt;br&gt;&amp;gt; case that brought me to this was actually a bit more complex &amp;nbsp;
&lt;br&gt;&amp;gt; (property restrictions). For this that kind of inferencing would &amp;nbsp;
&lt;br&gt;&amp;gt; have made the query a lot simpler. But it should still be possible &amp;nbsp;
&lt;br&gt;&amp;gt; to cover a lot of the inferencing &amp;quot;rules&amp;quot; with SPARQL, especially &amp;nbsp;
&lt;br&gt;&amp;gt; with property paths. Maybe it's worth investigating at some point &amp;nbsp;
&lt;br&gt;&amp;gt; how much of OWL 2 RL could be implemented with pure SPARQL - and &amp;nbsp;
&lt;br&gt;&amp;gt; what extensions would be needed to add the missing bits. But that's &amp;nbsp;
&lt;br&gt;&amp;gt; just something to keep in mind for the future. :-)
&lt;/div&gt;&lt;/div&gt;If you fix the entailment regime to RDFS, then very little of OWL2 can &amp;nbsp;
&lt;br&gt;be encoded in SPARQL, since it is has been shown that the &amp;nbsp;
&lt;br&gt;computational complexities diverge too much. There are also simple &amp;nbsp;
&lt;br&gt;counter-examples showing that it does not make sense to have an OWL2 &amp;nbsp;
&lt;br&gt;entailment regime in SPARQL, since you would get unsound results (wrt &amp;nbsp;
&lt;br&gt;OWL2 semantics) very easily. So, really, SPARQL can hardly go beyond &amp;nbsp;
&lt;br&gt;RDFS.
&lt;br&gt;&lt;br&gt;cheers
&lt;br&gt;--e.
&lt;br&gt;&lt;br&gt;[1] Enrico Franconi. The logic of RDF and SPARQL: a tutorial. Invited &amp;nbsp;
&lt;br&gt;talk at the 25th ACM Symposium on Principles of Database Systems &amp;nbsp;
&lt;br&gt;(PODS-2006), in Chicago IL, on 26-28 June 2006. &amp;lt;&lt;a href=&quot;http://www.inf.unibz.it/~franconi/papers/franconi-slides-pods-2006.pdf&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.inf.unibz.it/~franconi/papers/franconi-slides-pods-2006.pdf&lt;/a&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;smime.p7s&lt;/strong&gt; (3K) &lt;a href=&quot;http://old.nabble.com/attachment/26437492/0/smime.p7s&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Inferencing-on-graph-patterns-tp26265355p26437492.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26437407</id>
	<title>Re: Inferencing on graph patterns</title>
	<published>2009-11-19T18:09:01Z</published>
	<updated>2009-11-19T18:09:01Z</updated>
	<author>
		<name>Enrico Franconi</name>
	</author>
	<content type="html">&lt;br&gt;On 14 Nov 2009, at 05:30, Ivan Herman wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; Consider the following data in a store:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; (1) ex:C1 rdfs:subClassOf ex:C2 .
&lt;br&gt;&amp;gt;&amp;gt; (2) :myC1 a ex:C1 .
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Now when you do the following query at the endpoint for the store:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; SELECT ?type WHERE { ?x a ex:C1 , ?type }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; and it supports the RDFS entailment regime the result would be &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; ex:C1 and
&lt;br&gt;&amp;gt;&amp;gt; ex:C2 because the store would infer :myC1 to be of type ex:C2, either
&lt;br&gt;&amp;gt;&amp;gt; when the data got added or on-the-fly.
&lt;br&gt;&amp;gt;&amp;gt; But what if the store didn't contain triple (2) and so no data &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; about any
&lt;br&gt;&amp;gt;&amp;gt; instances of those two classes? Is there any way that it could make
&lt;br&gt;&amp;gt;&amp;gt; inferences about the data in the WHERE clause and therefore infer &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; that
&lt;br&gt;&amp;gt;&amp;gt; ?x would be of type ex:C2 as well? I guess not since this is &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; querying by
&lt;br&gt;&amp;gt;&amp;gt; matching patterns rather than &amp;quot;query by example&amp;quot;. But I can see &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; various
&lt;br&gt;&amp;gt;&amp;gt; uses for this. So if this is not how it's currently defined to work,
&lt;br&gt;&amp;gt;&amp;gt; have you considered this?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The inference regime is defined on possible solution. That indeed &amp;nbsp;
&lt;br&gt;&amp;gt; means
&lt;br&gt;&amp;gt; that no inference is made on variables which means, as you say, that
&lt;br&gt;&amp;gt; without &amp;nbsp;the triple (2) the required results will not be returned. And
&lt;br&gt;&amp;gt; there is &amp;nbsp;no mechanism envisioned in SPARQL to achieve that.
&lt;/div&gt;&lt;/div&gt;The real &amp;quot;logical&amp;quot; reason why the answer is empty is that the ?x &amp;nbsp;
&lt;br&gt;variable is understood to be existential, so you are actually asking &amp;nbsp;
&lt;br&gt;&amp;quot;all the types of an object ?x if such object ?x *exists* and it is of &amp;nbsp;
&lt;br&gt;type ex:C1&amp;quot;. But without (2) it is not guaranteed that such an object &amp;nbsp;
&lt;br&gt;*necessarily* exists, therefore the answer is empty.
&lt;br&gt;&lt;br&gt;&amp;gt; Note, however, that you may get what you want with a different query.
&lt;br&gt;&amp;gt; For &amp;nbsp;example, in this case, the
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SELECT ?type WHERE { ex:C1 rdfs:subclass ?type. }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; will return all possible types.
&lt;br&gt;&lt;br&gt;Well, only the one that can be inferred by the transitive closure of &amp;nbsp;
&lt;br&gt;rdfs:subClassOf. Indeed rdfs will never return any other type which &amp;nbsp;
&lt;br&gt;could be inferred by other means -- look at some examples of &amp;nbsp;
&lt;br&gt;inferences that will never be drawn by RDFS in the attachment.
&lt;br&gt;&lt;br&gt;cheers
&lt;br&gt;--e.
&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;rdfs-incompleteness.png&lt;/strong&gt; (71K) &lt;a href=&quot;http://old.nabble.com/attachment/26437407/0/rdfs-incompleteness.png&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;smime.p7s&lt;/strong&gt; (3K) &lt;a href=&quot;http://old.nabble.com/attachment/26437407/1/smime.p7s&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Inferencing-on-graph-patterns-tp26265355p26437407.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26426250</id>
	<title>Re: Comments on SPARQL 1.1 WD 20091022</title>
	<published>2009-11-19T05:28:58Z</published>
	<updated>2009-11-19T05:28:58Z</updated>
	<author>
		<name>Andy Seaborne</name>
	</author>
	<content type="html">&lt;br&gt;On 24/10/2009 14:09, Leigh Dodds wrote:
&lt;br&gt;Leigh,
&lt;br&gt;&lt;br&gt;Thank you for your comments.
&lt;br&gt;&lt;br&gt;This first published working draft contains the new areas for query that 
&lt;br&gt;the working group is progressing. &amp;nbsp;The material will be integrated with 
&lt;br&gt;the the previous version of the query language to produce a single, new 
&lt;br&gt;document for SPARQL 1.1 Query.
&lt;br&gt;&lt;br&gt;Things may be a little rough in this first draft ...
&lt;br&gt;&lt;br&gt;Leigh Dodds wrote:
&lt;br&gt;&amp;nbsp; &amp;gt; Hi,
&lt;br&gt;&amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp; &amp;gt; Here are some personal comments/questions on the 22/10/2009 WD of 
&lt;br&gt;SPARQL 1.1.
&lt;br&gt;&amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp; &amp;gt; * Example in Section 2. I don't think the project expression conforms
&lt;br&gt;&amp;nbsp; &amp;gt; with grammar shown latter in the doc; missing brackets? I know this is
&lt;br&gt;&amp;nbsp; &amp;gt; still up for discussion, but thought I'd point it out
&lt;br&gt;&lt;br&gt;Yes - it's not consistent. &amp;nbsp;The WG had not reached a conclusion on the
&lt;br&gt;exact syntax at the time of publication.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;gt; * Section 2, Syntax. re: the note about using FILTER instead of
&lt;br&gt;&amp;nbsp; &amp;gt; HAVING. Assuming I'm reading the comment correctly, I think for
&lt;br&gt;&amp;nbsp; &amp;gt; readability purposes its better to have a separate keyword (HAVING)
&lt;br&gt;&amp;nbsp; &amp;gt; rather than re-use the FILTER keyword. I think its clearer that there
&lt;br&gt;&amp;nbsp; &amp;gt; are different constraints (i.e. aggregates allowed or not) on the
&lt;br&gt;&amp;nbsp; &amp;gt; expression, and retains similarity with SQL.
&lt;br&gt;&amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp; &amp;gt; * Section 3. Text above example query is wrong, I think it should
&lt;br&gt;&amp;nbsp; &amp;gt; ready &amp;quot;from all the people that Alice knows&amp;quot;, not &amp;quot;that know Alice&amp;quot;.
&lt;br&gt;&lt;br&gt;Agreed.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp; &amp;gt; * Section 4. What is the rationale for including both a FILTER and a
&lt;br&gt;&amp;nbsp; &amp;gt; graph pattern operator for EXISTS/NOT EXISTS? If there are benefits in
&lt;br&gt;&amp;nbsp; &amp;gt; terms of expressivity or ease of implementation it would be good to be
&lt;br&gt;&amp;nbsp; &amp;gt; able to call these out in the specification.
&lt;br&gt;&lt;br&gt;If the working group decides to allow EXISTS/NOT EXISTS in FILTERs, then 
&lt;br&gt;there will be a example to illustrate the point.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;gt; * Section 4. The NOT EXISTS and EXISTS graph pattern operators are
&lt;br&gt;&amp;nbsp; &amp;gt; described as &amp;quot;applying only to variables defined earlier in the
&lt;br&gt;&amp;nbsp; &amp;gt; pattern&amp;quot;. What does &amp;quot;earlier&amp;quot; mean if a SPARQL processor can re-order
&lt;br&gt;&amp;nbsp; &amp;gt; the statements for optimization purposes? Does use of those operators
&lt;br&gt;&amp;nbsp; &amp;gt; have some impact on an implementations ability to do that?
&lt;br&gt;&lt;br&gt;It's loose wording to discuss the scoping of variables. &amp;nbsp;&amp;quot;earlier&amp;quot; means 
&lt;br&gt;the pattern to the left or above of the NOT EXISTS.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp; &amp;gt; Cheers,
&lt;br&gt;&amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp; &amp;gt; L.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Andy
&lt;br&gt;&amp;nbsp; &amp;nbsp; on behalf of the SPARQL Working Group
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Comments-on-SPARQL-1.1-WD-20091022-tp26038959p26426250.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26349330</id>
	<title>Re: Inferencing on graph patterns</title>
	<published>2009-11-14T03:41:44Z</published>
	<updated>2009-11-14T03:41:44Z</updated>
	<author>
		<name>Simon Reinhardt</name>
	</author>
	<content type="html">Ivan Herman wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Dear Simon,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks for your comments. And apologies for the somewhat late reply.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You wrote:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; In trying to understand SPARQL 1.1 Entailment Regimes [1] I was
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; wondering if inferencing will ever take place on the RDF data in graph
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; patterns themselves. Consider the following data in a store:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; (1) ex:C1 rdfs:subClassOf ex:C2 .
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; (2) :myC1 a ex:C1 .
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; Now when you do the following query at the endpoint for the store:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; SELECT ?type WHERE { ?x a ex:C1 , ?type }
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; and it supports the RDFS entailment regime the result would be ex:C1 and
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; ex:C2 because the store would infer :myC1 to be of type ex:C2, either
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; when the data got added or on-the-fly.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; But what if the store didn't contain triple (2) and so no data about any
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; instances of those two classes? Is there any way that it could make
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; inferences about the data in the WHERE clause and therefore infer that
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; ?x would be of type ex:C2 as well? I guess not since this is querying by
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; matching patterns rather than &amp;quot;query by example&amp;quot;. But I can see various
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; uses for this. So if this is not how it's currently defined to work,
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; have you considered this?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The inference regime is defined on possible solution. That indeed means
&lt;br&gt;&amp;gt; that no inference is made on variables which means, as you say, that
&lt;br&gt;&amp;gt; without &amp;nbsp;the triple (2) the required results will not be returned. And
&lt;br&gt;&amp;gt; there is &amp;nbsp;no mechanism envisioned in SPARQL to achieve that.
&lt;/div&gt;&lt;br&gt;Thanks for your reply, Ivan. Yes, that makes sense. And fair enough. :-)
&lt;br&gt;&lt;br&gt;&amp;gt; Note, however, that you may get what you want with a different query.
&lt;br&gt;&amp;gt; For &amp;nbsp;example, in this case, the
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp;SELECT ?type WHERE { ex:C1 rdfs:subclass ?type. }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; will return all possible types.
&lt;br&gt;&lt;br&gt;Ok. Querying for inferred types was just an example, the initial use case that brought me to this was actually a bit more complex (property restrictions). For this that kind of inferencing would have made the query a lot simpler. But it should still be possible to cover a lot of the inferencing &amp;quot;rules&amp;quot; with SPARQL, especially with property paths. Maybe it's worth investigating at some point how much of OWL 2 RL could be implemented with pure SPARQL - and what extensions would be needed to add the missing bits. But that's just something to keep in mind for the future. :-)
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&amp;nbsp; Simon
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Inferencing-on-graph-patterns-tp26265355p26349330.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26347355</id>
	<title>Re: Inferencing on graph patterns</title>
	<published>2009-11-13T21:30:40Z</published>
	<updated>2009-11-13T21:30:40Z</updated>
	<author>
		<name>Ivan Herman-2</name>
	</author>
	<content type="html">Dear Simon,
&lt;br&gt;&lt;br&gt;Thanks for your comments. And apologies for the somewhat late reply.
&lt;br&gt;&lt;br&gt;You wrote:
&lt;br&gt;&amp;nbsp;&amp;gt; In trying to understand SPARQL 1.1 Entailment Regimes [1] I was
&lt;br&gt;&amp;nbsp;&amp;gt; wondering if inferencing will ever take place on the RDF data in graph
&lt;br&gt;&amp;nbsp;&amp;gt; patterns themselves. Consider the following data in a store:
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; (1) ex:C1 rdfs:subClassOf ex:C2 .
&lt;br&gt;&amp;nbsp;&amp;gt; (2) :myC1 a ex:C1 .
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; Now when you do the following query at the endpoint for the store:
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; SELECT ?type WHERE { ?x a ex:C1 , ?type }
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; and it supports the RDFS entailment regime the result would be ex:C1 and
&lt;br&gt;&amp;nbsp;&amp;gt; ex:C2 because the store would infer :myC1 to be of type ex:C2, either
&lt;br&gt;&amp;nbsp;&amp;gt; when the data got added or on-the-fly.
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; But what if the store didn't contain triple (2) and so no data about any
&lt;br&gt;&amp;nbsp;&amp;gt; instances of those two classes? Is there any way that it could make
&lt;br&gt;&amp;nbsp;&amp;gt; inferences about the data in the WHERE clause and therefore infer that
&lt;br&gt;&amp;nbsp;&amp;gt; ?x would be of type ex:C2 as well? I guess not since this is querying by
&lt;br&gt;&amp;nbsp;&amp;gt; matching patterns rather than &amp;quot;query by example&amp;quot;. But I can see various
&lt;br&gt;&amp;nbsp;&amp;gt; uses for this. So if this is not how it's currently defined to work,
&lt;br&gt;&amp;nbsp;&amp;gt; have you considered this?
&lt;br&gt;&lt;br&gt;The inference regime is defined on possible solution. That indeed means
&lt;br&gt;that no inference is made on variables which means, as you say, that
&lt;br&gt;without &amp;nbsp;the triple (2) the required results will not be returned. And
&lt;br&gt;there is &amp;nbsp;no mechanism envisioned in SPARQL to achieve that.
&lt;br&gt;&lt;br&gt;Note, however, that you may get what you want with a different query.
&lt;br&gt;For &amp;nbsp;example, in this case, the
&lt;br&gt;&lt;br&gt;&amp;nbsp;SELECT ?type WHERE { ex:C1 rdfs:subclass ?type. }
&lt;br&gt;&lt;br&gt;will return all possible types.
&lt;br&gt;&lt;br&gt;Sincerely
&lt;br&gt;&lt;br&gt;Ivan
&lt;br&gt;On behalf of the SPARQL Working Group
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Ivan Herman, W3C Semantic Web Activity Lead
&lt;br&gt;Home: &lt;a href=&quot;http://www.w3.org/People/Ivan/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/People/Ivan/&lt;/a&gt;&lt;br&gt;mobile: +31-641044153
&lt;br&gt;PGP Key: &lt;a href=&quot;http://www.ivan-herman.net/pgpkey.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ivan-herman.net/pgpkey.html&lt;/a&gt;&lt;br&gt;FOAF: &lt;a href=&quot;http://www.ivan-herman.net/foaf.rdf&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ivan-herman.net/foaf.rdf&lt;/a&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;smime.p7s&lt;/strong&gt; (5K) &lt;a href=&quot;http://old.nabble.com/attachment/26347355/0/smime.p7s&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Inferencing-on-graph-patterns-tp26265355p26347355.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26337278</id>
	<title>Re: Comments on SPARQL 1.1</title>
	<published>2009-11-13T06:08:51Z</published>
	<updated>2009-11-13T06:08:51Z</updated>
	<author>
		<name>Lee Feigenbaum-2</name>
	</author>
	<content type="html">Rob,
&lt;br&gt;&lt;br&gt;Thanks for all of the feedback, it's very helpful. We're working through 
&lt;br&gt;all of these issues right now, so we'll get back to you with a better 
&lt;br&gt;response in due course.
&lt;br&gt;&lt;br&gt;Lee
&lt;br&gt;&lt;br&gt;Rob Vesse wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi all
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Here are my comments/questions on the draft. &amp;nbsp;Some of this is based on
&lt;br&gt;&amp;gt; personal opinion and some of this is based on starting to try and implement
&lt;br&gt;&amp;gt; some of this stuff in my SPARQL implementation in my latest development
&lt;br&gt;&amp;gt; builds of dotNetRDF (early Alpha release .Net RDF library).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Aggregates
&lt;br&gt;&amp;gt; - I definitely support the use of a separate HAVING keyword, I agree with
&lt;br&gt;&amp;gt; Leigh that it makes clear that the type of constraint is different and helps
&lt;br&gt;&amp;gt; SQL programmers make the move to SPARQL by making the syntax familiar
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; - The proposed grammar has a couple of things which bug me:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; 1. It allows for a Having clause without a Group By clause which doesn't
&lt;br&gt;&amp;gt; necessarily make sense depending on the constraint given. &amp;nbsp;I assume that if
&lt;br&gt;&amp;gt; you have a Having clause without a Group By then it should act as a Filter
&lt;br&gt;&amp;gt; on the result set?
&lt;br&gt;&amp;gt; &amp;nbsp; The only reason I can see for allowing this is if the having clause uses
&lt;br&gt;&amp;gt; an aggregate then this makes sense in some circumstances e.g. seeing whether
&lt;br&gt;&amp;gt; there are a given number of Triples matching a pattern:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; SELECT * WHERE {?s a ?type} HAVING (COUNT(?s) &amp;gt; 10)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; 2. What is the intended meaning of grouping by an aggregate since the
&lt;br&gt;&amp;gt; grammar permits this? &amp;nbsp;Should this be permitted at all?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; - On the subject of which aggregates to include I think the ones currently
&lt;br&gt;&amp;gt; proposed are all useful and I can't think of any obvious missing ones. &amp;nbsp;With
&lt;br&gt;&amp;gt; regards to how MIN and MAX should operate would it be reasonable to suggest
&lt;br&gt;&amp;gt; that since SPARQL defines a partial ordering over values that MIN/MAX should
&lt;br&gt;&amp;gt; return the minimum/maximum based on that ordering. &amp;nbsp;This is much easier to
&lt;br&gt;&amp;gt; implement than doing some form of type detection or having some complex
&lt;br&gt;&amp;gt; algorithm for how they operate over mixed datatypes. &amp;nbsp;While it does have the
&lt;br&gt;&amp;gt; disadvantage or potentially returning different results depending on how
&lt;br&gt;&amp;gt; exactly the SPARQL engine orders values I would be happy with this
&lt;br&gt;&amp;gt; behaviour. &amp;nbsp;If people really need type specific minima/maxima then they can
&lt;br&gt;&amp;gt; use appropriate FILTERs in their queries or possibly extra aggregates could
&lt;br&gt;&amp;gt; be introduced eg. NMIN/NMAX (Numeric minimum/maximum)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Subqueries
&lt;br&gt;&amp;gt; - I would appreciate some clearer guidance on variable scoping as I don't
&lt;br&gt;&amp;gt; feel comfortable attempting to implement these until I have a better idea of
&lt;br&gt;&amp;gt; how this should work.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Projection Expressions
&lt;br&gt;&amp;gt; - I like these very much and have implemented these already. &amp;nbsp;I personally
&lt;br&gt;&amp;gt; don't like the idea of a LET keyword, it certainly restricts the ability of
&lt;br&gt;&amp;gt; the SPARQL processor to decide in what order it wishes to execute the query.
&lt;br&gt;&amp;gt; Plus to my mind it starts to make SPARQL into the equivalent of Transact SQL
&lt;br&gt;&amp;gt; (and other vendor specific SQL stored procedure languages) which feels wrong
&lt;br&gt;&amp;gt; to me.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Rob Vesse
&lt;br&gt;&amp;gt; dotNetRDF Lead Developer
&lt;br&gt;&amp;gt; ================================================================
&lt;br&gt;&amp;gt; Developer Discussion &amp; Feature Request -
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26337278&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dotnetrdf-develop@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Bug Reports - &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26337278&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dotnetrdf-bugs@...&lt;/a&gt;
&lt;br&gt;&amp;gt; User Help &amp; Support - &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26337278&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dotnetrdf-support@...&lt;/a&gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Website: &lt;a href=&quot;http://www.dotnetrdf.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.dotnetrdf.org&lt;/a&gt;&lt;br&gt;&amp;gt; User Guide: &lt;a href=&quot;http://www.dotnetrdf.org/content.asp?pageID=User%20Guide&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.dotnetrdf.org/content.asp?pageID=User%20Guide&lt;/a&gt;&lt;br&gt;&amp;gt; API: &lt;a href=&quot;http://www.dotnetrdf.org/api/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.dotnetrdf.org/api/&lt;/a&gt;&lt;br&gt;&amp;gt; ================================================================
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Comments-on-SPARQL-1.1-tp26335671p26337278.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26335671</id>
	<title>Comments on SPARQL 1.1</title>
	<published>2009-11-13T02:46:45Z</published>
	<updated>2009-11-13T02:46:45Z</updated>
	<author>
		<name>Rob Vesse</name>
	</author>
	<content type="html">Hi all
&lt;br&gt;&lt;br&gt;Here are my comments/questions on the draft. &amp;nbsp;Some of this is based on
&lt;br&gt;personal opinion and some of this is based on starting to try and implement
&lt;br&gt;some of this stuff in my SPARQL implementation in my latest development
&lt;br&gt;builds of dotNetRDF (early Alpha release .Net RDF library).
&lt;br&gt;&lt;br&gt;Aggregates
&lt;br&gt;- I definitely support the use of a separate HAVING keyword, I agree with
&lt;br&gt;Leigh that it makes clear that the type of constraint is different and helps
&lt;br&gt;SQL programmers make the move to SPARQL by making the syntax familiar
&lt;br&gt;&lt;br&gt;- The proposed grammar has a couple of things which bug me:
&lt;br&gt;&lt;br&gt;&amp;nbsp; 1. It allows for a Having clause without a Group By clause which doesn't
&lt;br&gt;necessarily make sense depending on the constraint given. &amp;nbsp;I assume that if
&lt;br&gt;you have a Having clause without a Group By then it should act as a Filter
&lt;br&gt;on the result set?
&lt;br&gt;&amp;nbsp; The only reason I can see for allowing this is if the having clause uses
&lt;br&gt;an aggregate then this makes sense in some circumstances e.g. seeing whether
&lt;br&gt;there are a given number of Triples matching a pattern:
&lt;br&gt;&lt;br&gt;SELECT * WHERE {?s a ?type} HAVING (COUNT(?s) &amp;gt; 10)
&lt;br&gt;&lt;br&gt;&amp;nbsp; 2. What is the intended meaning of grouping by an aggregate since the
&lt;br&gt;grammar permits this? &amp;nbsp;Should this be permitted at all?
&lt;br&gt;&lt;br&gt;- On the subject of which aggregates to include I think the ones currently
&lt;br&gt;proposed are all useful and I can't think of any obvious missing ones. &amp;nbsp;With
&lt;br&gt;regards to how MIN and MAX should operate would it be reasonable to suggest
&lt;br&gt;that since SPARQL defines a partial ordering over values that MIN/MAX should
&lt;br&gt;return the minimum/maximum based on that ordering. &amp;nbsp;This is much easier to
&lt;br&gt;implement than doing some form of type detection or having some complex
&lt;br&gt;algorithm for how they operate over mixed datatypes. &amp;nbsp;While it does have the
&lt;br&gt;disadvantage or potentially returning different results depending on how
&lt;br&gt;exactly the SPARQL engine orders values I would be happy with this
&lt;br&gt;behaviour. &amp;nbsp;If people really need type specific minima/maxima then they can
&lt;br&gt;use appropriate FILTERs in their queries or possibly extra aggregates could
&lt;br&gt;be introduced eg. NMIN/NMAX (Numeric minimum/maximum)
&lt;br&gt;&lt;br&gt;Subqueries
&lt;br&gt;- I would appreciate some clearer guidance on variable scoping as I don't
&lt;br&gt;feel comfortable attempting to implement these until I have a better idea of
&lt;br&gt;how this should work.
&lt;br&gt;&lt;br&gt;Projection Expressions
&lt;br&gt;- I like these very much and have implemented these already. &amp;nbsp;I personally
&lt;br&gt;don't like the idea of a LET keyword, it certainly restricts the ability of
&lt;br&gt;the SPARQL processor to decide in what order it wishes to execute the query.
&lt;br&gt;Plus to my mind it starts to make SPARQL into the equivalent of Transact SQL
&lt;br&gt;(and other vendor specific SQL stored procedure languages) which feels wrong
&lt;br&gt;to me.
&lt;br&gt;&lt;br&gt;Rob Vesse
&lt;br&gt;dotNetRDF Lead Developer
&lt;br&gt;================================================================
&lt;br&gt;Developer Discussion &amp; Feature Request -
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26335671&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dotnetrdf-develop@...&lt;/a&gt;
&lt;br&gt;Bug Reports - &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26335671&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dotnetrdf-bugs@...&lt;/a&gt;
&lt;br&gt;User Help &amp; Support - &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26335671&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dotnetrdf-support@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;Website: &lt;a href=&quot;http://www.dotnetrdf.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.dotnetrdf.org&lt;/a&gt;&lt;br&gt;User Guide: &lt;a href=&quot;http://www.dotnetrdf.org/content.asp?pageID=User%20Guide&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.dotnetrdf.org/content.asp?pageID=User%20Guide&lt;/a&gt;&lt;br&gt;API: &lt;a href=&quot;http://www.dotnetrdf.org/api/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.dotnetrdf.org/api/&lt;/a&gt;&lt;br&gt;================================================================
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Comments-on-SPARQL-1.1-tp26335671p26335671.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26265355</id>
	<title>Inferencing on graph patterns</title>
	<published>2009-11-09T04:06:41Z</published>
	<updated>2009-11-09T04:06:41Z</updated>
	<author>
		<name>Simon Reinhardt</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;In trying to understand SPARQL 1.1 Entailment Regimes [1] I was wondering if inferencing will ever take place on the RDF data in graph patterns themselves. Consider the following data in a store:
&lt;br&gt;&lt;br&gt;(1) ex:C1 rdfs:subClassOf ex:C2 .
&lt;br&gt;(2) :myC1 a ex:C1 .
&lt;br&gt;&lt;br&gt;Now when you do the following query at the endpoint for the store:
&lt;br&gt;&lt;br&gt;SELECT ?type WHERE { ?x a ex:C1 , ?type }
&lt;br&gt;&lt;br&gt;and it supports the RDFS entailment regime the result would be ex:C1 and ex:C2 because the store would infer :myC1 to be of type ex:C2, either when the data got added or on-the-fly.
&lt;br&gt;&lt;br&gt;But what if the store didn't contain triple (2) and so no data about any instances of those two classes? Is there any way that it could make inferences about the data in the WHERE clause and therefore infer that ?x would be of type ex:C2 as well? I guess not since this is querying by matching patterns rather than &amp;quot;query by example&amp;quot;. But I can see various uses for this. So if this is not how it's currently defined to work, have you considered this?
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;&amp;nbsp; Simon
&lt;br&gt;&lt;br&gt;&lt;br&gt;[1] &lt;a href=&quot;http://www.w3.org/TR/2009/WD-sparql11-entailment-20091022/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/TR/2009/WD-sparql11-entailment-20091022/&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Inferencing-on-graph-patterns-tp26265355p26265355.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26222210</id>
	<title>Some comments on the SPARQL 1.1 draft documents</title>
	<published>2009-11-05T13:00:56Z</published>
	<updated>2009-11-05T13:00:56Z</updated>
	<author>
		<name>Ben Lavender-2</name>
	</author>
	<content type="html">I posted some comments about the 1.1 draft on my blog, which Axel
&lt;br&gt;Polleres asked that I post here. &amp;nbsp;I will not paste the entire
&lt;br&gt;contents, as I suffer from a clinical lack of conciseness. &amp;nbsp;Instead, I
&lt;br&gt;will say my two main points and link.
&lt;br&gt;&lt;br&gt;The first, smaller point was a disappointment with the choice of
&lt;br&gt;RDF/XML as the one standard required to be supported by the new RDF
&lt;br&gt;graph HTTP management API. &amp;nbsp;The protocol has issues marked as
&lt;br&gt;'postponed' for years. &amp;nbsp;Other easy to parse protocols have existed for
&lt;br&gt;years. &amp;nbsp;Why the continued support of RDF/XML as the canonical
&lt;br&gt;standard?
&lt;br&gt;&lt;br&gt;The larger point was that the sizable syntax extensions make a
&lt;br&gt;protocol with limited adoption even more difficult to implement.
&lt;br&gt;Implementations do not exist for several popular web development
&lt;br&gt;languages, and enlarging the syntax only increases the range of
&lt;br&gt;features that are 'required' to be supported.
&lt;br&gt;&lt;br&gt;I suggested that a better route would be to establish a more
&lt;br&gt;machine-friendly format as the standard, and define SPARQL in terms of
&lt;br&gt;how it compiles into that. &amp;nbsp;That algebra, already published alongside
&lt;br&gt;the syntax, is readably expressible as S-expressions, and those should
&lt;br&gt;be the protocol, with the human-readable form as an addendum. &amp;nbsp;The end
&lt;br&gt;result is that *every* language feature can easily be subject to
&lt;br&gt;extension, service discovery, and the incremental implementation that
&lt;br&gt;small-scale open source projects need, instead of only those features
&lt;br&gt;expressible by extension functions.
&lt;br&gt;&lt;br&gt;Further, it's worth noting that SQL has spent the last 20 years being
&lt;br&gt;abstracted away by necessarily complicated libraries, and having the
&lt;br&gt;structure of a query language be well-defined in a machine-readable
&lt;br&gt;format seems to be more forward-looking than the incidental details of
&lt;br&gt;a human-readable version.
&lt;br&gt;&lt;br&gt;The service discovery feature was an excellent step in the right
&lt;br&gt;direction, and some of us would love to see it apply to everything
&lt;br&gt;SPARQL can do, not just part of it.
&lt;br&gt;&lt;br&gt;The long-winded version is at:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bhuga.net/2009/11/w3c-going-wrong-direction-sparql-11&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://bhuga.net/2009/11/w3c-going-wrong-direction-sparql-11&lt;/a&gt;&lt;br&gt;&lt;br&gt;Ben Lavender
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Some-comments-on-the-SPARQL-1.1-draft-documents-tp26222210p26222210.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26191847</id>
	<title>Re: Concerning LET or AS</title>
	<published>2009-11-03T22:58:05Z</published>
	<updated>2009-11-03T22:58:05Z</updated>
	<author>
		<name>Jeremy Carroll-2</name>
	</author>
	<content type="html">As a personal comment, (sorry you are probably sick of me now). I don't 
&lt;br&gt;particularly seek a response to this comment.
&lt;br&gt;&lt;br&gt;I am surprised that there is concern that the LET single assignment 
&lt;br&gt;construct may mislead users into having an incorrect processing model in 
&lt;br&gt;their heads that might be overly procedural.
&lt;br&gt;&lt;br&gt;This surprise is because the whole point about having a declarative 
&lt;br&gt;semantics is that the processing model is irrelevant. Thus, with a 
&lt;br&gt;declarative language, we expect, perhaps even desire, that users have 
&lt;br&gt;incorrect processing models. Each implementation is free to use their 
&lt;br&gt;own processing model, and the user works with their own. For example, 
&lt;br&gt;when running an XSLT script, if it has some side effect of writing a 
&lt;br&gt;message to the console, it is often surprising when these messages get 
&lt;br&gt;written. This is because the easiest way to think of the XSLT processing 
&lt;br&gt;model is top-down left-to-right, but good implementations tend to be 
&lt;br&gt;lazy. This mismatch between the users model and the implementor's 
&lt;br&gt;reality is desirable because:
&lt;br&gt;a) it makes it easier for the user to understand the language
&lt;br&gt;b) it allows the implementor to efficiently implement the language
&lt;br&gt;c) the declarative language design ensures that it doesn't matter that 
&lt;br&gt;these two views of the processing model differ, perhaps radically.
&lt;br&gt;&lt;br&gt;So, I think an advantage of the term LET as opposed to BIND (say) is 
&lt;br&gt;that LET reminds some users of procedural programming in BASIC, and 
&lt;br&gt;allows them to reuse that programming model. Now, while the details of 
&lt;br&gt;the execution flow are very different in SPARQL than in BASIC, it seems 
&lt;br&gt;that this apparent familiarity has pedagogical advantages.
&lt;br&gt;&lt;br&gt;==
&lt;br&gt;&lt;br&gt;For the record, TopQuadrant's position is we don't care what word is 
&lt;br&gt;used, whether it is LET or BIND or something else.
&lt;br&gt;&lt;br&gt;A further aside is that the latest release of TopBraid Composer includes 
&lt;br&gt;a SPARQL debugger function that exposes some aspects of the insides of 
&lt;br&gt;the SPARQL processing (I haven't used it). But I guess that using such a 
&lt;br&gt;tool would quickly disabuse you of any incorrect notions of the 
&lt;br&gt;processing model. (LET, I believe, &amp;nbsp;is one of the SPARQL extensions 
&lt;br&gt;supported by the tool).
&lt;br&gt;&lt;br&gt;Jeremy
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Concerning-LET-or-AS-tp26175807p26191847.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26191737</id>
	<title>Re: Concerning LET or AS</title>
	<published>2009-11-03T22:43:48Z</published>
	<updated>2009-11-03T22:43:48Z</updated>
	<author>
		<name>Jeremy Carroll-2</name>
	</author>
	<content type="html">I made a couple of mistakes in my previous text.
&lt;br&gt;&lt;br&gt;Please allow me to withdraw that text and try again.
&lt;br&gt;&lt;br&gt;The errors were:
&lt;br&gt;1) I missed the { } around the subselect
&lt;br&gt;2) my modification to rule 43 lost the SubSelect expansion
&lt;br&gt;3) Removed too many '(' ')' in rewrite rule
&lt;br&gt;&lt;br&gt;I made some modifications for clarity too.
&lt;br&gt;&lt;br&gt;Also as a very minor comment, rule [43] etc combined with the gramar 
&lt;br&gt;rules from SPARQL 1.0 do not seem to expand to the example query 
&lt;br&gt;immediately above.
&lt;br&gt;&lt;br&gt;I take the intent of rule 43 to be:
&lt;br&gt;&lt;br&gt;GroupGraphPattern &amp;nbsp;::= &amp;nbsp;'{' ( SubSelect | GroupGraphPatternSub )+ '}'
&lt;br&gt;&lt;br&gt;(Without the +, the rule matches either a single subselect or a SPARQL 
&lt;br&gt;1.0 body,
&lt;br&gt;but not a combination of both.)
&lt;br&gt;&lt;br&gt;Here is modified text:
&lt;br&gt;&lt;br&gt;===============================
&lt;br&gt;&lt;br&gt;'LET' is specified as a macro-expansion, in terms of subselect queries.
&lt;br&gt;In the FPWD of Query 1.1 we modify rule 43 for GroupGraphPattern as follows:
&lt;br&gt;&lt;br&gt;[43*] GroupGraphPattern ::= '{' GroupGraphPatternLetSub '}'
&lt;br&gt;&lt;br&gt;[A] GroupGraphPatternLetSub ::= ( GroupGraphPatternLetSub LetExpr '.'? 
&lt;br&gt;)? GroupGraphPatternNoLetSub
&lt;br&gt;&lt;br&gt;[B] LetExpr ::= 'LET' '(' &amp;nbsp;Var ':=' Expression &amp;nbsp;( ',' &amp;nbsp;Var ':=' 
&lt;br&gt;Expression )* ')'
&lt;br&gt;&lt;br&gt;[C] GroupGraphPatternNoLetSub ::= ( SubSelect | GroupGraphPatternSub )+
&lt;br&gt;&lt;br&gt;Rules [A] and [B] are interpreted by rewriting queries involving LET
&lt;br&gt;into queries not involving LET.
&lt;br&gt;We will use phi(x) to be the rewritten query of x.
&lt;br&gt;For clarity of exposition we will expand the two alternative readings of 
&lt;br&gt;[A] as
&lt;br&gt;[A.1] GroupGraphPatternLetSub ::= GroupGraphPatternNoLetSub
&lt;br&gt;[A.2] GroupGraphPatternLetSub ::= &amp;nbsp;GroupGraphPatternLetSub LetExpr '.'? 
&lt;br&gt;GroupGraphPatternNoLetSub
&lt;br&gt;Expressions matching rule [A.1] are not rewritten.
&lt;br&gt;&lt;br&gt;If x matches rule B, then:
&lt;br&gt;&lt;br&gt;phi(x) = 'SELECT' &amp;nbsp;* '(' Expression 'AS' Var ')' ( '(' Expression 'AS' 
&lt;br&gt;Var ')' )*
&lt;br&gt;&lt;br&gt;(with the variables matching respectively).
&lt;br&gt;&lt;br&gt;If x matches rule A.2 &amp;nbsp;with y matching GroupGraphPatternLetSub on the 
&lt;br&gt;R.H.S.,
&lt;br&gt;z matching LetExpr, and w matching &amp;nbsp;GroupGraphPatternNoLetSub then
&lt;br&gt;&lt;br&gt;phi(x) =
&lt;br&gt;'{' phi(z)
&lt;br&gt;&amp;nbsp; &amp;nbsp;'WHERE' '{'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;phi(y)
&lt;br&gt;&amp;nbsp; &amp;nbsp;'}'
&lt;br&gt;'}'
&lt;br&gt;w
&lt;br&gt;&lt;br&gt;After this rewrite is applied to all instances matching rules [A] and 
&lt;br&gt;[B], the rewritten query does not involve 'LET' and its meaning is as 
&lt;br&gt;given in
&lt;br&gt;the rest of the specification.
&lt;br&gt;======================
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Concerning-LET-or-AS-tp26175807p26191737.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26188113</id>
	<title>Re: Concerning LET or AS</title>
	<published>2009-11-03T14:51:40Z</published>
	<updated>2009-11-03T14:51:40Z</updated>
	<author>
		<name>Jeremy Carroll-2</name>
	</author>
	<content type="html">off list Steve and Lee encouraged me to be clearer about what I thought 
&lt;br&gt;LET as a keyword means.
&lt;br&gt;&lt;br&gt;Here is my attempt at specifying it (based on the WG Wiki page).
&lt;br&gt;Please note that I am not responsible for TopQuadrant's SPARQL work; 
&lt;br&gt;Holger is our expert, and we tend to be dependent on Andy's implementation.
&lt;br&gt;So, I am happy with any corrections from Andy.
&lt;br&gt;&lt;br&gt;It is not important how the word LET is spelt (i.e. as far as I know, 
&lt;br&gt;TopQuadrant has no particular attachment to 'LET' rather than 'BIND' for 
&lt;br&gt;example).
&lt;br&gt;&lt;br&gt;================================
&lt;br&gt;&lt;br&gt;In the FPWD of Query 1.1 we modify rule 43 for GroupGraphPattern as follows:
&lt;br&gt;&lt;br&gt;[43*] GroupGraphPattern ::= '{' GroupGraphPatternLetSub '}'
&lt;br&gt;&lt;br&gt;[A] GroupGraphPatternLetSub ::= ( GroupGraphPatternLetSub Let '.'? )? 
&lt;br&gt;GroupGraphPatternSub
&lt;br&gt;&lt;br&gt;[B] Let ::= 'LET' '(' &amp;nbsp;Var ':=' Expression &amp;nbsp;( ',' &amp;nbsp;Var ':=' Expression 
&lt;br&gt;)* ')'
&lt;br&gt;&lt;br&gt;Rules [43*] [A] and [B] are interpreted by rewriting queries involving 
&lt;br&gt;LET into queries
&lt;br&gt;not involving LET.
&lt;br&gt;We will use phi(x) to be the written query of x.
&lt;br&gt;&lt;br&gt;If x matches rule B, then:
&lt;br&gt;&lt;br&gt;phi(x) = 'SELECT' '(' * '(' Expression 'AS' Var ')' ( '(' Expression 
&lt;br&gt;'AS' Var ')' )* ')'
&lt;br&gt;&lt;br&gt;(with the variables matching respectively).
&lt;br&gt;&lt;br&gt;If x matches rule A then
&lt;br&gt;&lt;br&gt;phi(x) =
&lt;br&gt;phi(Let)
&lt;br&gt;'WHERE' '{'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;phi(GroupGraphPatternLetSub)
&lt;br&gt;'}'
&lt;br&gt;GroupGraphPatternSub
&lt;br&gt;&lt;br&gt;The rest of the specification then applies.
&lt;br&gt;==================
&lt;br&gt;&lt;br&gt;(Note this is a fine recipe for implementing as well).
&lt;br&gt;Specifically, this prohibits forward references.
&lt;br&gt;Being a macro expansion into a declarative form, this is declarative.
&lt;br&gt;&lt;br&gt;Jeremy
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Concerning-LET-or-AS-tp26175807p26188113.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26183062</id>
	<title>Re: Concerning LET or AS</title>
	<published>2009-11-03T09:13:25Z</published>
	<updated>2009-11-03T09:13:25Z</updated>
	<author>
		<name>Jeremy Carroll-2</name>
	</author>
	<content type="html">&lt;br&gt;I thought I should share a couple of the comments I have had on this 
&lt;br&gt;topic from TopQuadrant colleagues:
&lt;br&gt;&lt;br&gt;[[
&lt;br&gt;Speaking as a person who teaches this stuff, more than our own 
&lt;br&gt;reputation is at stake. &amp;nbsp;Perhaps this is something to add to our objection.
&lt;br&gt;&lt;br&gt;Technology adoption is the goal of a standard. &amp;nbsp;SPARQL fights an uphill 
&lt;br&gt;battle for a couple of reasons: (1) It's Not SQL. &amp;nbsp;(2) Pattern-based 
&lt;br&gt;retrieval is weird (witness the fabulous popularity of PROLOG as a 
&lt;br&gt;software engineering language). &amp;nbsp;In short, many people are looking for 
&lt;br&gt;reasons not to adopt it, and to stay with familiarity.
&lt;br&gt;In short, the semantic web is faced with a huge hurdle in SPARQL. &amp;nbsp;And 
&lt;br&gt;while I applaud the &amp;quot;small standard&amp;quot; policy (which in general is a boon 
&lt;br&gt;to teaching and adoption), it is only good when it serves ease of adoption.
&lt;br&gt;&lt;br&gt;SPARQL 1.0 has some huge problems, that give SQL fans great ammunition 
&lt;br&gt;when it comes to saying &amp;quot;it's not ready&amp;quot; - negation and aggregates are 
&lt;br&gt;the biggies here, and both of them have been fixed.
&lt;br&gt;&lt;br&gt;Adding in another complex idiom (like nested subqueries) for something 
&lt;br&gt;simple (LET) will be repeating the mistake of negation. &amp;nbsp;Another reason 
&lt;br&gt;to say, &amp;quot;Wait for SPARQL 3&amp;quot;.
&lt;br&gt;I would go so far as to use the &amp;quot;small standard&amp;quot; argument the other 
&lt;br&gt;way. &amp;nbsp;Subqueries are difficult - in fact, in my course, I say, 'The 
&lt;br&gt;reason SPARQL doesn't have subquery is because it is not needed. &amp;nbsp;The 
&lt;br&gt;sorts of things that you use them for in SQL are done easily in a 
&lt;br&gt;pattern language, without resorted to a complex construct like a 
&lt;br&gt;subquery&amp;quot;. &amp;nbsp;I challenge the room to prove me wrong. &amp;nbsp;One person was able 
&lt;br&gt;to do so. &amp;nbsp;No SQL programmer can do it - subqueries are error prone and 
&lt;br&gt;confusing.
&lt;br&gt;&lt;br&gt;So - faced with a confusing, difficult, unsuccessful idea from SQL 
&lt;br&gt;(subqueries) vs a well-accepted idea from BASIC, which one fits the 
&lt;br&gt;&amp;quot;small standard&amp;quot; mantra better? &amp;nbsp;I can speak confidently as an educator 
&lt;br&gt;in this stuff. &amp;nbsp; LET wins hands-down.
&lt;br&gt;]]
&lt;br&gt;&lt;br&gt;and
&lt;br&gt;&lt;br&gt;[[
&lt;br&gt;Also look at our mailing list to see what our customers are doing. [X]'s 
&lt;br&gt;message from yesterday contains:
&lt;br&gt;&lt;br&gt;SELECT ?stringPredicate ?stringObject ?stringAttributesNodeName ?
&lt;br&gt;stringAttributeNodeName
&lt;br&gt;WHERE {
&lt;br&gt;&amp;nbsp; &amp;nbsp;CQ:GatheredData ?predicate ?object .
&lt;br&gt;&amp;nbsp; &amp;nbsp;LET (?stringPredicate := smf:cast(smf:name(?predicate),
&lt;br&gt;xsd:string)) .
&lt;br&gt;&amp;nbsp; &amp;nbsp;LET (?stringObject := smf:cast(smf:name(?object), xsd:string)) .
&lt;br&gt;&amp;nbsp; &amp;nbsp;LET (?uuid := smf:generateUUID()) .
&lt;br&gt;&amp;nbsp; &amp;nbsp;?attributes a CQ:attributes .
&lt;br&gt;&amp;nbsp; &amp;nbsp;LET (?attributesNodeName := smf:qname(?attributes)) .
&lt;br&gt;&amp;nbsp; &amp;nbsp;LET (?stringAttributesNodeName := smf:cast(smf:name(?
&lt;br&gt;attributesNodeName), xsd:string)) .
&lt;br&gt;&amp;nbsp; &amp;nbsp;LET (?stringAttributeNodeName := smf:buildString(&amp;quot;{?
&lt;br&gt;stringAttributesNodeName}-{?uuid}&amp;quot;)) .
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;Will make a nice chain of sub-SELECTs...
&lt;br&gt;&lt;br&gt;]]
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Concerning-LET-or-AS-tp26175807p26183062.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26175860</id>
	<title>Re: Concerning LET or AS</title>
	<published>2009-11-02T23:39:15Z</published>
	<updated>2009-11-02T23:39:15Z</updated>
	<author>
		<name>Jeremy Carroll-2</name>
	</author>
	<content type="html">PS
&lt;br&gt;&lt;br&gt;My example come from putting together the following thoughts ...
&lt;br&gt;A suggestion that what people don't like about LET is that it is 
&lt;br&gt;'procedural'.
&lt;br&gt;However single-assignment is declarative, and that perceiving LET as 
&lt;br&gt;procedural is a failure of understanding.
&lt;br&gt;Ordering constraints can be declarative or procedural, LET introduces 
&lt;br&gt;declarative ordering constraints.
&lt;br&gt;The ordering constraints appear because of the shape of the problem: for 
&lt;br&gt;example if you compute an end date from a start date and a duration, you 
&lt;br&gt;need to know the start date and the duration.
&lt;br&gt;Each LET declaratively but concisely introduces an ordering constraint.
&lt;br&gt;The alternative SELECT AS WHERE construct declaratively and verbosely 
&lt;br&gt;introduces an ordering constraint.
&lt;br&gt;&lt;br&gt;There is a natural ordering to do with the flow of information. This 
&lt;br&gt;isn't necessarily the order of computation, but it is an order in which 
&lt;br&gt;it is easier for the query author to think about the query. The LET 
&lt;br&gt;syntax follows this natural ordering, the AS syntax does not.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Concerning-LET-or-AS-tp26175807p26175860.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26175807</id>
	<title>Concerning LET or AS</title>
	<published>2009-11-02T23:30:23Z</published>
	<updated>2009-11-02T23:30:23Z</updated>
	<author>
		<name>Jeremy Carroll-2</name>
	</author>
	<content type="html">Thank you for your time and attention at the WG meeting today.
&lt;br&gt;&lt;br&gt;TopQuadrant would like Holger's earlier comment [1] to be treated as a 
&lt;br&gt;formal comment. (i.e. with an official WG response on this mailing list).
&lt;br&gt;&lt;br&gt;My understanding from today's meeting is that that is likely to be that 
&lt;br&gt;the WG has already considered the LET design and believes the AS design 
&lt;br&gt;to be adequate.
&lt;br&gt;(LET is merely an abbreviated form for certain AS constructs). I also do 
&lt;br&gt;not believe that TopQuadrant is bringing any new information that was 
&lt;br&gt;not considered at your f2f meeting [2].
&lt;br&gt;&lt;br&gt;We however feel strongly about this, and are likely to raise a formal 
&lt;br&gt;objection (in the sense that we believe it would be better for the WG to 
&lt;br&gt;take a few weeks longer over SPARQL 1.1 and get this right, than to 
&lt;br&gt;deliver SPARQL 1.1 on schedule without this feature).
&lt;br&gt;&lt;br&gt;Thinking through particularly Steve's comments, I tried to come up with 
&lt;br&gt;an example illustrating how the ordering of operations that is sometimes 
&lt;br&gt;required is better articulated with LET than with AS.
&lt;br&gt;This example is not as polished as I would like, since I believe it is 
&lt;br&gt;more helpful to contribute during your F2F meeting.
&lt;br&gt;&lt;br&gt;First I wish to clarify that this is not about whether or not assignment 
&lt;br&gt;should be in SPARQL 1.1. Assignment is in already, with the AS construct 
&lt;br&gt;that was discussed under item 39. This issue is purely about the syntax 
&lt;br&gt;and scoping rules for the single assignment capability.
&lt;br&gt;&lt;br&gt;Many of the sort of processing tasks that we and are customers have 
&lt;br&gt;involve mapping several legacy sources together, merging them into one 
&lt;br&gt;RDF graph, and then doing some processing.
&lt;br&gt;A frequent problem is that different legacy sources represent the same 
&lt;br&gt;data in different ways, e.g. with different case conventions, in 
&lt;br&gt;different units, or whatever. In these cases, data laundry of one sort 
&lt;br&gt;or another is necessary. One option for laundry is using functions and 
&lt;br&gt;assignment within SPARQL.
&lt;br&gt;&lt;br&gt;So for my example, I am taking information about alumni at a college and 
&lt;br&gt;trying to find the appropriate year photo for them.
&lt;br&gt;I will simplify the name problem to a name consist of a first name and a 
&lt;br&gt;last name, (no middle initial), &amp;nbsp;but people change their last name from 
&lt;br&gt;time to time.
&lt;br&gt;&lt;br&gt;The data sources that I have include:
&lt;br&gt;- a current mailing database, with full-names, e-mail addresses, and 
&lt;br&gt;addresses
&lt;br&gt;&amp;nbsp; a:fullName a:email a:address
&lt;br&gt;&amp;nbsp; _:w a:fullName &amp;quot;John Smith&amp;quot; .
&lt;br&gt;&amp;nbsp; _:w a:email &amp;lt;mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26175807&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;john.smith@...&lt;/a&gt;&amp;gt;.
&lt;br&gt;&lt;br&gt;- a database with students first names and last names and former last names
&lt;br&gt;&amp;nbsp; &amp;nbsp;to simplify processing I just use two properties
&lt;br&gt;&amp;nbsp; &amp;nbsp;b:firstName
&lt;br&gt;&amp;nbsp; &amp;nbsp;b:lastName
&lt;br&gt;&lt;br&gt;&amp;nbsp; for example:
&lt;br&gt;&amp;nbsp; &amp;nbsp;_:x &amp;nbsp;b:firstName &amp;quot;John&amp;quot; .
&lt;br&gt;&amp;nbsp; &amp;nbsp;_:x b:lastName &amp;quot;Doe&amp;quot; .
&lt;br&gt;&amp;nbsp; &amp;nbsp;_:x b:lastName &amp;quot;Smith&amp;quot;.
&lt;br&gt;&lt;br&gt;shows that the person known as John Doe and the person known as John 
&lt;br&gt;Smith are one and the same, without clarifying the chronology of the 
&lt;br&gt;name change.
&lt;br&gt;&lt;br&gt;- a database with date of matriculation, and years of study, by full 
&lt;br&gt;name at time of matriculation
&lt;br&gt;&amp;nbsp; &amp;nbsp; c:matriculationDate c:studyYears c:fullName 
&lt;br&gt;&amp;nbsp; _:y c:fullName &amp;quot;John Doe&amp;quot; .
&lt;br&gt;&amp;nbsp; _:y c:studyYears &amp;quot;P1Y&amp;quot;^^xs:yearMonthDuration .
&lt;br&gt;&amp;nbsp; _:y c:matriculationDate &amp;quot;1988-09-01&amp;quot;^^xsd:date. &amp;nbsp;
&lt;br&gt;&lt;br&gt;- and a list of graduation photo names by year.
&lt;br&gt;&amp;nbsp; &amp;nbsp; d:year &amp;nbsp;d:fileName
&lt;br&gt;&amp;nbsp; &amp;nbsp;_:z d:year &amp;quot;1988&amp;quot;^^xsd:date
&lt;br&gt;&amp;nbsp; _:z d:fileName &amp;quot;classOf88&amp;quot;
&lt;br&gt;&lt;br&gt;- I have arranged these photos as jpg files on the web at 
&lt;br&gt;&lt;a href=&quot;http://www.example.org/photos&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.example.org/photos&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://www.example.org/photos/classOf88.jpg&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.example.org/photos/classOf88.jpg&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;SELECT ?eMail ?image
&lt;br&gt;WHERE 
&lt;br&gt;{ ?a a:email ?eMail .
&lt;br&gt;&amp;nbsp; ?a e:fullName ?fullName
&lt;br&gt;&amp;nbsp; LET ( ?fullNameSpaceNormalized=normalize-space(?fullName) ) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[A] &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; LET ( ?firstName=substring-before(?fullNameSpaceNormalized,&amp;quot; &amp;quot;) &amp;nbsp; &amp;nbsp;[B]
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ?lastName=substring-after(?fullNameSpaceNormalized,&amp;quot; &amp;quot;) )
&lt;br&gt;&amp;nbsp; ?b b:firstName ?firstName .
&lt;br&gt;&amp;nbsp; ?b b:lastName ?lastName .
&lt;br&gt;&amp;nbsp; ?b b:lastName ?altLastName . &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [C]
&lt;br&gt;&amp;nbsp; LET ( ?altName=concat(?firstName, &amp;quot; &amp;quot;, ?altLastName ) ) 
&lt;br&gt;&amp;nbsp; ?c c:fullName ?a;tName .
&lt;br&gt;&amp;nbsp; ?c c:studyYears ?lengthOfCourse .
&lt;br&gt;&amp;nbsp; ?c c:matriculationDate ?matriculate .
&lt;br&gt;&amp;nbsp; LET (?endDate=|year-from-date(add-yearMonthDuration-to-date(?matriculate,?lengthOfCourse)) )
&lt;br&gt;&amp;nbsp; ?d d:year ?endDate .
&lt;br&gt;&amp;nbsp; ?d d:fileName ?imageFile .
&lt;br&gt;&amp;nbsp; LET ( ?image = xs:anyURI(concat(&amp;quot;&lt;a href=&quot;http://www.example.org/photos&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.example.org/photos&lt;/a&gt;&amp;quot;, ?imageFile, &amp;quot;.jpg&amp;quot; ) ) )|
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;Notes:
&lt;br&gt;[A] for robustness against leading/trailing space and/or double space in 
&lt;br&gt;the middle
&lt;br&gt;[B] cannot be combined with [A] because of rules discussed under issue 39
&lt;br&gt;[C] ?altLastName can be the same as ?lastName
&lt;br&gt;&lt;br&gt;I believe the WG is considering recommending that this query should be 
&lt;br&gt;written as follows.
&lt;br&gt;&lt;br&gt;SELECT ?eMail,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xs:anyURI(concat(&amp;quot;&lt;a href=&quot;http://www.example.org/photos&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.example.org/photos&lt;/a&gt;&amp;quot;, ?imageFile, 
&lt;br&gt;&amp;quot;.jpg&amp;quot; ) ) &amp;nbsp;as ?image
&lt;br&gt;WHERE {
&lt;br&gt;&amp;nbsp; SELECT ( * 
&lt;br&gt;year-from-date(add-yearMonthDuration-to-date(?matriculate,?lengthOfCourse)) &amp;nbsp;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AS ?endDate )
&lt;br&gt;&amp;nbsp; WHERE {
&lt;br&gt;&amp;nbsp; &amp;nbsp; SELECT ( * concat(?firstName, &amp;quot; &amp;quot;, ?altLastName ) AS ?altName ) 
&lt;br&gt;&amp;nbsp; &amp;nbsp; WHERE {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT (* substring-before(?fullNameSpaceNormalized,&amp;quot; &amp;quot;) 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AS ?firstName,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; substring-after(?fullNameSpaceNormalized,&amp;quot; &amp;quot;) AS ?lastName )
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT (* normalize-space(?fullName) as ?fullNameSpaceNormalized)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ?a a:email ?eMail .
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ?a e:fullName ?fullName .
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; ?b b:firstName ?firstName .
&lt;br&gt;&amp;nbsp; &amp;nbsp; ?b b:lastName ?lastName .
&lt;br&gt;&amp;nbsp; &amp;nbsp; ?b b:lastName ?altLastName .
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; ?c c:fullName ?a;tName .
&lt;br&gt;&amp;nbsp; ?c c:studyYears ?lengthOfCourse .
&lt;br&gt;&amp;nbsp; ?c c:matriculationDate ?matriculate .
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;?d d:year ?endDate .
&lt;br&gt;?d d:fileName ?imageFile .
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;(Using the equivalence from [3])
&lt;br&gt;We believe that this is inferior.
&lt;br&gt;Harder to write, harder to read, harder to understand, and that the cost 
&lt;br&gt;of complicating the language by having two ways to say the same thing is 
&lt;br&gt;well worth it.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Jeremy Carroll
&lt;br&gt;AC Rep, TopQuadrant.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[1]
&lt;br&gt;&lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Oct/0003&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Oct/0003&lt;/a&gt;&lt;br&gt;[2]
&lt;br&gt;&lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-05-06#ProjectExpressions___26___20_Assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-05-06#ProjectExpressions___26___20_Assignment&lt;/a&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;[3]
&lt;br&gt;&lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Feature:Assignment#Equivalence_with_SubSelects_and_ProjectExpressions&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Feature:Assignment#Equivalence_with_SubSelects_and_ProjectExpressions&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Concerning-LET-or-AS-tp26175807p26175807.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26134691</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-30T11:12:05Z</published>
	<updated>2009-10-30T11:12:05Z</updated>
	<author>
		<name>Holger Knublauch-2</name>
	</author>
	<content type="html">&lt;br&gt;On Oct 28, 2009, at 11:13 PM, Richard Newman wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I believe that a large portion of SPARQL users (maybe all of the non- 
&lt;br&gt;&amp;gt; experts) think procedurally when writing queries. They're not &amp;nbsp;
&lt;br&gt;&amp;gt; thinking about satisfying clauses, they're thinking about &amp;quot;fetch all &amp;nbsp;
&lt;br&gt;&amp;gt; the subjects with this object, then fetch all their names, then &amp;nbsp;
&lt;br&gt;&amp;gt; filter out the ones with...&amp;quot;.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This is why they're surprised at unexpected results, or unexpected &amp;nbsp;
&lt;br&gt;&amp;gt; performance: the algebraic interpretation of their queries is very &amp;nbsp;
&lt;br&gt;&amp;gt; different to what they think they've written.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; We're all far too close to RDF query languages to remember how non- 
&lt;br&gt;&amp;gt; implementors think.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; My wife is a UX person. In that field it's considered wise to never &amp;nbsp;
&lt;br&gt;&amp;gt; think of the user being wrong: if they've come to the incorrect &amp;nbsp;
&lt;br&gt;&amp;gt; conclusion, it's very likely because of something you've done or not &amp;nbsp;
&lt;br&gt;&amp;gt; done, and it's the software that should change, not the user. It &amp;nbsp;
&lt;br&gt;&amp;gt; would be interesting to run a user test of SPARQL; I'm sure we'd &amp;nbsp;
&lt;br&gt;&amp;gt; learn a huge amount about the assumptions and pain points of people &amp;nbsp;
&lt;br&gt;&amp;gt; actually trying to solve problems with it.
&lt;/div&gt;&lt;br&gt;I could not agree more with this. But the problems go further than &amp;nbsp;
&lt;br&gt;just perception. Even if I had fully understood all the details of the &amp;nbsp;
&lt;br&gt;SPARQL algebra, I still do not know what kind of reorderings will &amp;nbsp;
&lt;br&gt;happen inside the query engine. The engine may reorder FILTERs because &amp;nbsp;
&lt;br&gt;of some heuristics. These heuristics may be unsuitable, or they may be &amp;nbsp;
&lt;br&gt;misinformed because statistical data about the triple store is not &amp;nbsp;
&lt;br&gt;always available. In those cases, the system should just use the order &amp;nbsp;
&lt;br&gt;in which the user has specified the clauses.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I think Holger's point is that SPARQL as specified loses a lot of &amp;nbsp;
&lt;br&gt;&amp;gt; the information that the query writer has encoded in the query. (He &amp;nbsp;
&lt;br&gt;&amp;gt; surely knows that FILTERs are not order dependent: that's what he's &amp;nbsp;
&lt;br&gt;&amp;gt; lamenting.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Most people do not think in an order-independent fashion, &amp;nbsp;
&lt;br&gt;&amp;gt; particularly when other language constructs such as OPTIONAL *are* &amp;nbsp;
&lt;br&gt;&amp;gt; ordered (after a fashion).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I see users interspersing FILTERs throughout their queries all the &amp;nbsp;
&lt;br&gt;&amp;gt; time. Very often they do it because they know it's the best way to &amp;nbsp;
&lt;br&gt;&amp;gt; run the query. The query language then says &amp;quot;pull out all the &amp;nbsp;
&lt;br&gt;&amp;gt; FILTERs&amp;quot;, and the implementation then has to decide how to run &amp;nbsp;
&lt;br&gt;&amp;gt; them... and it might not have as much information as does the user. &amp;nbsp;
&lt;br&gt;&amp;gt; (For example, when the execution of a custom FILTER function is very &amp;nbsp;
&lt;br&gt;&amp;gt; expensive, and you need to trick the planner to execute it later or &amp;nbsp;
&lt;br&gt;&amp;gt; earlier.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Put another way: I've never *ever* seen a user write something like
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;SELECT * {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;FILTER (?name ...)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;?x foaf:name ?name .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;...
&lt;br&gt;&amp;gt; &amp;nbsp;}
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; even though it's meaningful SPARQL. Perhaps it shouldn't be &amp;nbsp;
&lt;br&gt;&amp;gt; meaningful.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This problem gets worse when you consider subqueries, remote &amp;nbsp;
&lt;br&gt;&amp;gt; queries, computed properties...
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Perhaps order-dependence is actually an intuitive, reasonable &amp;nbsp;
&lt;br&gt;&amp;gt; default for a language? Imperative programming language compilers &amp;nbsp;
&lt;br&gt;&amp;gt; have done a pretty good job starting with ordered statements, and &amp;nbsp;
&lt;br&gt;&amp;gt; figuring out when they can disregard that to get better parallelism. &amp;nbsp;
&lt;br&gt;&amp;gt; That's an optimization, not the default.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Devil's advocacy over :)
&lt;/div&gt;&lt;br&gt;+1
&lt;br&gt;&lt;br&gt;In order to not break backward compatibility (albeit debatable), maybe &amp;nbsp;
&lt;br&gt;a new keyword such as SELECT ... WHERE PROCEDURAL { ... } (not a nice &amp;nbsp;
&lt;br&gt;name yet, but you get the idea) could be introduced to help the engine &amp;nbsp;
&lt;br&gt;decide whether a query has been written by someone with a procedural &amp;nbsp;
&lt;br&gt;background or by someone who comes from the SQL world, and who expects &amp;nbsp;
&lt;br&gt;the engine to do the reordering for him.
&lt;br&gt;&lt;br&gt;Holger
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26134691.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26134367</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-30T10:49:25Z</published>
	<updated>2009-10-30T10:49:25Z</updated>
	<author>
		<name>Holger Knublauch-3</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;base href=&quot;x-msg://1651/&quot;&gt;&lt;/head&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;Thanks for pointing this out, Andy. Its good to hear there is already some control over the order of execution this way, and this mechanism would make the job easier for a LET macro.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;But this also dramatically highlights how unattractive the notation below would be for real world usage. Not only is it way too verbose, but it also requires a mind set that the average user does not have - at least my intuition was misleading.&amp;nbsp;Related working groups (in particular OWL) have made similar mistakes in the past, trying to design a language that is theoretically sound and clear, but unintuitive to use as it does not align with the traditional imperative/object-oriented way of thinking. I have a long list of customer stories (both for SPARQL and OWL) where people were disappointed because the language did not produce the results they expected. In particular the lack of reliable ordering of FILTER clauses often leads to very very slow queries and people believe the whole semantic web stack is not ready for prime time yet.&lt;div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Holger&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Oct 30, 2009, at 3:32 AM, Seaborne, Andy wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; &quot;&gt;&lt;div lang=&quot;EN-GB&quot; link=&quot;blue&quot; vlink=&quot;purple&quot; style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div class=&quot;Section1&quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;I think you need to write it as:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;SELECT ?newLiteral&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;WHERE {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { SELECT (smf:cast(?newValue, ?arg2) AS ?newLiteral)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;WHERE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT ((?fromValue * ?rate) AS ?newValue)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHERE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT (datatype(?arg1) AS ?fromCurrency) (xsd:double(?arg1) AS ?fromValue)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT (currencies:getRateByCurrencies(?fromCurrency, ?arg2) AS ?rate)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHERE {}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 'Courier New'; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;To put the inner calculations into the scope of the outer ones.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;Whereas&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newLiteral&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;(datatype(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromCurrency&lt;/span&gt;) (xsd:double(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromValue&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&amp;nbsp;{}&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;apple-tab-span&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(currencies:getRateByCurrencies(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromCurrency&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?rate&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&amp;nbsp;{}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?fromValue&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?rate&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newValue&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{}&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;(smf:cast(&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newValue&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newLiteral&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{}&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;evaluates each SELECT separately and joins the results together.&amp;nbsp; So for example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?fromValue&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?rate&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newValue&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{}&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;Is&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 9pt; font-family: 'Courier New'; color: rgb(31, 73, 125); &quot;&gt;------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 9pt; font-family: 'Courier New'; color: rgb(31, 73, 125); &quot;&gt;| newValue |&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 9pt; font-family: 'Courier New'; color: rgb(31, 73, 125); &quot;&gt;============&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 9pt; font-family: 'Courier New'; color: rgb(31, 73, 125); &quot;&gt;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 9pt; font-family: 'Courier New'; color: rgb(31, 73, 125); &quot;&gt;------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;And does not see ?rate from the other SELECT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Andy&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-top-style: none; border-right-style: none; border-bottom-style: none; border-width: initial; border-color: initial; border-left-style: solid; border-left-color: blue; border-left-width: 1.5pt; padding-top: 0cm; padding-right: 0cm; padding-bottom: 0cm; padding-left: 4pt; &quot;&gt;&lt;div&gt;&lt;div style=&quot;border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-top-style: solid; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding-top: 3pt; padding-right: 0cm; padding-bottom: 0cm; padding-left: 0cm; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 10pt; font-family: Tahoma, sans-serif; &quot;&gt;From:&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 10pt; font-family: Tahoma, sans-serif; &quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26134367&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;public-rdf-dawg-comments-request@...&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;[mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26134367&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;public-rdf-dawg-comments-request@...&lt;/a&gt;]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;On Behalf Of&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;Holger Knublauch&lt;br&gt;&lt;b&gt;Sent:&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;26 October 2009 23:56&lt;br&gt;&lt;b&gt;To:&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26134367&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;public-rdf-dawg-comments@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;Subject:&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Re: Missing LET (Assignment) in SPARQL 1.1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Thanks, Lee. I appreciate you taking the time to assemble all this information.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;I have made some experiments with the proposal to use sub-selects plus project expressions in a random sample of some of my typical queries. You can see three cases below. Without understanding all implications from a SPARQL engine and algebra point of view, my impression is that the mapping appears to be straight forward, but that it leads to very verbose code. And I did not even try to find the really bad cases.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;I am therefore wondering whether LET can be introduced as syntactic sugar similar to some of the new OWL 2 extensions that do not change the semantics but only provide additional mappings from syntax to semantics - this is hopefully easier to manage for the WG?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Thanks,&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Holger&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;----&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;From the currency conversion example on my blog&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;a href=&quot;http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;The original current query is&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newLiteral&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromCurrency&lt;/span&gt;&amp;nbsp;:= datatype(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?rate&lt;/span&gt;&amp;nbsp;:= currencies:getRateByCurrencies(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromCurrency&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromValue&lt;/span&gt;&amp;nbsp;:= xsd:double(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;LET&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newValue&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;:= (&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?fromValue&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?rate&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)) .&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newLiteral&lt;/span&gt;&amp;nbsp;:= smf:cast(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newValue&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Using nested queries with well-meaning formatting would create something like&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newLiteral&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;(datatype(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromCurrency&lt;/span&gt;) (xsd:double(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromValue&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&amp;nbsp;{}&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;apple-tab-span&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(currencies:getRateByCurrencies(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromCurrency&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?rate&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&amp;nbsp;{}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?fromValue&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?rate&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newValue&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{}&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;(smf:cast(&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newValue&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newLiteral&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{}&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Using a single expression would be&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;(smf:cast((xsd:double(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;) * currencies:getRateByCurrencies(datatype(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;),&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)),&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newLiteral&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;The example is a bit atypical because it exclusively uses LETs, and not even a triple match. It also uses externally pre-bound variables. But still it gives some insights.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;---&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;In the following function body, project expressions work actually ok, but keep fingers crossed that you do not have to return multiple of such computed values in the SELECT:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?value&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M1&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O1&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg3&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M2&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg3&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O2&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?value&lt;/span&gt;&amp;nbsp;:= ((((&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;&lt;/b&gt;&amp;nbsp;*&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M1&lt;/span&gt;) +&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O1&lt;/span&gt;) -&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O2&lt;/span&gt;) /&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M2&lt;/span&gt;)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;would become&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;(((((&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;&lt;/b&gt;&amp;nbsp;*&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M1&lt;/span&gt;) +&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O1&lt;/span&gt;) -&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O2&lt;/span&gt;) /&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M2&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?value&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M1&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O1&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg3&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M2&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg3&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O2&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;---&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Here is an example from the SPIN box computer game, using LET in SPARQL rules. This is a very typical use case actually:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(146, 146, 146); &quot;&gt;# Rule1: Collect and replace diamond if possible&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;CONSTRUCT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;spinbox:replaceWith spinbox:Space .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?this&lt;/span&gt;&lt;/b&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:keyDirection&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?direction&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;:= spinbox:getNeighbor(&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?this&lt;/span&gt;&lt;/b&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?direction&lt;/span&gt;)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;a boulders:Diamond .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?this&lt;/span&gt;&lt;/b&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?oldDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;LET&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newDiamondsCount&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;:= (&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?oldDiamondsCount&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;+ 1)) .&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;This would become&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(146, 146, 146); &quot;&gt;# Rule1: Collect and replace diamond if possible&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;CONSTRUCT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;spinbox:replaceWith spinbox:Space .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?this&lt;/span&gt;&lt;/b&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:keyDirection&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?direction&lt;/span&gt;&amp;nbsp;.&lt;span class=&quot;apple-tab-span&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;(spinbox:getNeighbor(&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?this&lt;/span&gt;&lt;/b&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?direction&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;a boulders:Diamond .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?this&lt;/span&gt;&lt;/b&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?oldDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;apple-tab-span&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?oldDiamondsCount&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;+ 1)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;?newDiamondsCount&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(9, 0, 150); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: black; &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; color: rgb(163, 0, 149); &quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span class=&quot;apple-tab-span&quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;span style=&quot;font-size: 8.5pt; font-family: 'Lucida Grande', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;On Oct 25, 2009, at 8:34 PM, Lee Feigenbaum wrote:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;br&gt;&lt;br&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Hi Holger,&lt;br&gt;&lt;br&gt;Thanks for the feedback. Unfortunately, assignment is not on the current Working Group's road map for standardization at this time. Here's how we got to this point:&lt;br&gt;&lt;br&gt;From roughly March through May, the WG considered around 40 potential new features[1] for the SPARQL landscape, including assignment[2]. At the time, we documented two implementations (ARQ and Open Anzo) and the support that you expressed for the feature back in March[3].&lt;br&gt;&lt;br&gt;In going through the features, the WG discussed Assignment in our March, 31 teleconference. You can see the discussion at the time at [4], the results of which was a straw poll result of 7/6/3, indicating some support and several notes of concern.&lt;br&gt;&lt;br&gt;Later in the process, we took a survey of WG member's prioritized preferences of the proposed features. Steve Harris whipped up the Condorcet results of the survey which you can see at [5]. Assignment was in the middle of the pack.&lt;br&gt;&lt;br&gt;At the group's first face-to-face meeting in May, assignment was discussed once more[6], with significant concerns expressed from Garlik and OpenLink Software, strong support from Clark &amp;amp; Parsia, and expressions ranging from indifference to mild support from other WG members (as I read the minutes &amp;amp; recollect the conversation). In the end, the group resolved to accept the list of feature proposals at [7], and Kendall's concerns about the relationship between assignment and projected expressions was addressed by Steve H at [8].&lt;br&gt;&lt;br&gt;Since then, the group has been rechartered with a specific mandate to work on the features decided during the first phase of the group's lifetime[9]. It's my hope &amp;amp; belief that if projected expressions do not end up fulfilling most users' needs, that implementors will extend their SPARQL implementations with assignment or a similar capability, and we will then revisit this in the next round of SPARQL standardization.&lt;br&gt;&lt;br&gt;hope this is helpful,&lt;br&gt;Lee&lt;br&gt;&lt;br&gt;&lt;br&gt;[1]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Category:Features&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Category:Features&lt;/a&gt;&lt;br&gt;[2]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&lt;/a&gt;&lt;br&gt;[3]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&lt;/a&gt;&lt;br&gt;[4]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&lt;/a&gt;&lt;br&gt;[5]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://plugin.org.uk/misc/votes2.svg&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plugin.org.uk/misc/votes2.svg&lt;/a&gt;&lt;br&gt;[6]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-05-06&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-05-06&lt;/a&gt;&lt;br&gt;[7]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;amp;oldid=744&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;amp;oldid=744&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br&gt;[8]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&lt;/a&gt;&lt;br&gt;[9]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.w3.org/2009/05/sparql-phase-II-charter&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/05/sparql-phase-II-charter&lt;/a&gt;&lt;br&gt;&lt;br&gt;Holger Knublauch wrote:&lt;br&gt;&lt;br&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Dear WG,&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;reading through the drafts (great to have them already!) I am confused about the future of Assignments (LET keyword in Jena) which has proven to be absolutely essential for many of our customers projects. The SPARQL 1.1 working group seems to have converged in favor of supporting Project expressions and subqueries only, but these IMHO fail to address the requirements below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Problem 1: How to create new values for CONSTRUCT queries&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Project expressions solve some problems for SELECT queries, but the major use cases of LET have been in CONSTRUCT queries. I only see subqueries as a (poor) way of creating new values for use in the CONSTRUCT clause. Creating a subquery for every LET looks like a very user unfriendly mechanism to me.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Problem 2: Verbosity&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;We often work with complex transformations such as string operations that are best split into multiple steps. Project expressions do not allow using intermediate variables, such as below and would force users to chain together very long spaghetti expressions such as SELECT (?x ex:function3(ex:function2(ex:function1(?y))). Imagine this with some more complex expressions and it quickly becomes completely unreadable. Also, consider you would want to reuse intermediate values in multiple places, to avoid duplicate processing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;*SELECT* ?x ?r&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;*WHERE* {&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;?x ex:property ?y .&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;*LET* (?helper1 := ex:function1(?y)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;*LET* (?helper2 := ex:function2(?helper1)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;*LET* (?r := ex:function3(?helper2)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;The LET keyword has solved both problems nicely and in the most general way, and would make project expressions superfluous.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;I would appreciate pointers to the discussions that led to the decision to not support Assignments at this stage.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Thanks&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;Holger&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;PS: For a parallel thread on jena-dev (with Andy's response), see&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;margin-top: 5pt; margin-bottom: 5pt; &quot;&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;a href=&quot;http://tech.groups.yahoo.com/group/jena-dev/message/41903&quot; style=&quot;color: blue; text-decoration: underline; &quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/jena-dev/message/41903&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; &quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26134367.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26132146</id>
	<title>RE: SPARQL 1.1: project expressions and type errors</title>
	<published>2009-10-30T08:33:48Z</published>
	<updated>2009-10-30T08:33:48Z</updated>
	<author>
		<name>Seaborne, Andy</name>
	</author>
	<content type="html">&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26132146&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;public-rdf-dawg-comments-request@...&lt;/a&gt; [mailto:public-rdf-dawg-
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26132146&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;comments-request@...&lt;/a&gt;] On Behalf Of Arjohn Kampman
&lt;br&gt;&amp;gt; Sent: 30 October 2009 14:17
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26132146&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;public-rdf-dawg-comments@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Subject: SPARQL 1.1: project expressions and type errors
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Dear WG,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I was wondering how a SPARQL query engine should handle project
&lt;br&gt;&amp;gt; expressions that apply an operator to an incompatible argument. For
&lt;br&gt;&amp;gt; example with the following query with ?p bound to a URI:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; select ?s, datatype(?p) as ?q
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; where { ?s ?p ?o }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I can think of two ways to handle this:
&lt;br&gt;&amp;gt; 1) Produce a solution with ?q unbound
&lt;br&gt;&amp;gt; 2) Do not produce solutions for these cases
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; What would be the best way to handle this?
&lt;/div&gt;&lt;br&gt;Yes - this is one of issue that needs to be nailed down. &amp;nbsp;We need to go for a consistent error handling approach with, say, aggregates. &amp;nbsp;Another choice - fail the whole query - would seem out of keeping. &amp;nbsp;For me, your choice (2) accords closely with errors in FILTERs.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Andy
&lt;br&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Arjohn Kampman, Senior Software Engineer
&lt;br&gt;&amp;gt; Aduna - Semantic Power
&lt;br&gt;&amp;gt; www.aduna-software.com
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/SPARQL-1.1%3A-project-expressions-and-type-errors-tp26130829p26132146.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26130829</id>
	<title>SPARQL 1.1: project expressions and type errors</title>
	<published>2009-10-30T07:16:39Z</published>
	<updated>2009-10-30T07:16:39Z</updated>
	<author>
		<name>Arjohn Kampman-2</name>
	</author>
	<content type="html">Dear WG,
&lt;br&gt;&lt;br&gt;I was wondering how a SPARQL query engine should handle project
&lt;br&gt;expressions that apply an operator to an incompatible argument. For
&lt;br&gt;example with the following query with ?p bound to a URI:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; select ?s, datatype(?p) as ?q
&lt;br&gt;&amp;nbsp; &amp;nbsp; where { ?s ?p ?o }
&lt;br&gt;&lt;br&gt;I can think of two ways to handle this:
&lt;br&gt;1) Produce a solution with ?q unbound
&lt;br&gt;2) Do not produce solutions for these cases
&lt;br&gt;&lt;br&gt;What would be the best way to handle this?
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Arjohn Kampman, Senior Software Engineer
&lt;br&gt;Aduna - Semantic Power
&lt;br&gt;www.aduna-software.com
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/SPARQL-1.1%3A-project-expressions-and-type-errors-tp26130829p26130829.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26129381</id>
	<title>RE: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-30T05:37:06Z</published>
	<updated>2009-10-30T05:37:06Z</updated>
	<author>
		<name>Seaborne, Andy</name>
	</author>
	<content type="html">&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26129381&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;public-rdf-dawg-comments-request@...&lt;/a&gt; [mailto:public-rdf-dawg-
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26129381&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;comments-request@...&lt;/a&gt;] On Behalf Of Lee Feigenbaum
&lt;br&gt;&amp;gt; Sent: 27 October 2009 13:28
&lt;br&gt;&amp;gt; To: Holger Knublauch
&lt;br&gt;&amp;gt; Cc: SPARQL Working Group Comments
&lt;br&gt;&amp;gt; Subject: Re: Missing LET (Assignment) in SPARQL 1.1
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Holger Knublauch wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; This example actually is a good example of one thing that concerns me
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; about assignment (and remember that my implementation is one that does
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; support LET expressions): I'm concerned whenever a new SPARQL
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; construct has an order-dependence. SPARQL is already order-dependent
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; in cases involving OPTIONAL, but I prefer to keep as much of SPARQL
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; order-independent as is possible. The above collection of assignments
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; reads OK because of the order they're presented in, but if you switch
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; the order around it's not at all clear to me what the proper algebraic
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; expectations would be.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Yes, LET assignments will (have to) be order dependent. And yes, this is
&lt;br&gt;&amp;gt; &amp;gt; a good thing. Sure, it may not be perfect from some theoretical point of
&lt;br&gt;&amp;gt; &amp;gt; view, but without ordering the whole approach would not work, and we
&lt;br&gt;&amp;gt; &amp;gt; would throw out the baby with the bath water. Even the solution with
&lt;br&gt;&amp;gt; &amp;gt; nested sub-selects is order dependent. Giving users the ability to
&lt;br&gt;&amp;gt; &amp;gt; specify the order in a reliable way has not been a problem with any
&lt;br&gt;&amp;gt; &amp;gt; other mainstream computer language, so why should SPARQL be different?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; SPARQL is a query language, and my understanding of previous discussions
&lt;br&gt;&amp;gt; is that there is concern that an assignment construct turns a (mostly)
&lt;br&gt;&amp;gt; declarative language into a (somewhat) imperative language, which is (at
&lt;br&gt;&amp;gt; least) a different mind set for users. Again, I'm just repeating what I
&lt;br&gt;&amp;gt; believe I've heard from WG members.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Also, for what it's worth, I don't think that LET need be ordered - the
&lt;br&gt;&amp;gt; Open Anzo implementation is not, and it's (nevertheless) very useful for us.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Also, as currently specified in our Working Drafts, subqueries are not
&lt;br&gt;&amp;gt; order dependent. Andy or Steve will correct me if I'm wrong, I'm sure. :-)
&lt;/div&gt;&lt;br&gt;&lt;br&gt;You are right elements in the same group combine with join so they are not order dependent. &amp;nbsp;But the example was wrong - the SELECTs should nested so variables are in-scope.
&lt;br&gt;&lt;br&gt;There are two dimensions of order dependency here:
&lt;br&gt;&lt;br&gt;The first:
&lt;br&gt;&lt;br&gt;...pattern ...
&lt;br&gt;LET (?z := ?y + ?x) 
&lt;br&gt;LET (?a := 2+?z )
&lt;br&gt;&lt;br&gt;which, practically, is best defined as order dependent but it happens by nesting:
&lt;br&gt;&lt;br&gt;SELECT ?z , (2+?z AS ?a)	# Projecting ?z is necessary 
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; &amp;nbsp;SELECT (?y + ?x AS ?z) 
&lt;br&gt;&amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;...pattern...
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;and we don't regard that order dependency as a problem.
&lt;br&gt;&lt;br&gt;AS is assignment and the same issues arise in SELECT expressions with AS:
&lt;br&gt;&lt;br&gt;Is this
&lt;br&gt;&amp;nbsp; SELECT (?y + ?x AS ?z) , (2+?z AS ?a)
&lt;br&gt;legal? It can be made to with a left-to-right reading.
&lt;br&gt;&lt;br&gt;&lt;br&gt;The second order dependence issue is around:
&lt;br&gt;&lt;br&gt;{ ?s ?p ?o LET (?o := &amp;lt;x&amp;gt; ) }
&lt;br&gt;{ LET (?o := &amp;lt;x&amp;gt; ) ?s ?p ?o }
&lt;br&gt;&lt;br&gt;This can be made to work (they do the same thing) - a solution is acceptable if an assignment occurs or the variable already has that value. &amp;nbsp;If it's a different value, then the solution is rejected - this is assignment as a necessary constraint. &amp;nbsp;It can be useful in transformations of the algebra for optimization. &amp;nbsp;The other design is that variable names must not have been mentioned beforehand so case 1 is illegal - it can be a static check.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Andy
&lt;br&gt;&lt;br&gt;See also
&lt;br&gt;&lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009OctDec/0270.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009OctDec/0270.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26129381.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26127876</id>
	<title>RE: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-30T03:32:41Z</published>
	<updated>2009-10-30T03:32:41Z</updated>
	<author>
		<name>Seaborne, Andy</name>
	</author>
	<content type="html">&lt;META HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html; charset=utf-8&quot;&gt;
&lt;html xmlns:v=&quot;urn:schemas-microsoft-com:vml&quot; xmlns:o=&quot;urn:schemas-microsoft-com:office:office&quot; xmlns:w=&quot;urn:schemas-microsoft-com:office:word&quot; xmlns:m=&quot;http://schemas.microsoft.com/office/2004/12/omml&quot; xmlns=&quot;http://www.w3.org/TR/REC-html40&quot;&gt;

&lt;head&gt;

&lt;meta name=Generator content=&quot;Microsoft Word 12 (filtered medium)&quot;&gt;

&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:shapedefaults v:ext=&quot;edit&quot; spidmax=&quot;1026&quot; /&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:shapelayout v:ext=&quot;edit&quot;&gt;
  &lt;o:idmap v:ext=&quot;edit&quot; data=&quot;1&quot; /&gt;
 &lt;/o:shapelayout&gt;&lt;/xml&gt;&lt;![endif]--&gt;
&lt;/head&gt;

&lt;body lang=EN-GB link=blue vlink=purple style='word-wrap: break-word;
-webkit-nbsp-mode: space;-webkit-line-break: after-white-space'&gt;

&lt;div class=Section1&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;I think you need to write it as:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;SELECT
?newLiteral&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;WHERE
{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;      {
SELECT (smf:cast(?newValue, ?arg2) AS ?newLiteral)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;     
  WHERE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;    
   {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;         
SELECT ((?fromValue * ?rate) AS ?newValue)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;    
     WHERE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;     
    {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;   
        SELECT (datatype(?arg1) AS ?fromCurrency) (xsd:double(?arg1) AS
?fromValue)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;           
WHERE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;           
{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;   
           SELECT (currencies:getRateByCurrencies(?fromCurrency, ?arg2) AS
?rate)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;          
    WHERE {}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;           
}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;       
}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;   
}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;To put the inner calculations into the scope of the outer ones.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;Whereas&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?newLiteral&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;(datatype(&lt;span style='color:#090096'&gt;?arg1&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style='color:#090096'&gt;?fromCurrency&lt;/span&gt;) (xsd:double(&lt;span style='color:
#090096'&gt;?arg1&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style='color:#090096'&gt;?fromValue&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&amp;nbsp;{}&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span class=apple-tab-span&gt;                            &lt;/span&gt;&lt;b&gt;&lt;span style='color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(currencies:getRateByCurrencies(&lt;span style='color:#090096'&gt;?fromCurrency&lt;/span&gt;,&amp;nbsp;&lt;span style='color:#090096'&gt;?arg2&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style='color:#090096'&gt;?rate&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&amp;nbsp;{}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?fromValue&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?rate&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?newValue&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;{}&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;(smf:cast(&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?newValue&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?arg2&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?newLiteral&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;{}&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;evaluates each SELECT separately and joins the results together. 
So for example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?fromValue&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?rate&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?newValue&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;{}&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;Is&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:#1F497D'&gt;------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:#1F497D'&gt;| newValue |&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:#1F497D'&gt;============&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:#1F497D'&gt;|          |&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:#1F497D'&gt;------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;And does not see ?rate from the other SELECT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;                Andy&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'&gt;

&lt;div&gt;

&lt;div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span lang=EN-US style='font-size:10.0pt;font-family:
&quot;Tahoma&quot;,&quot;sans-serif&quot;'&gt;From:&lt;/span&gt;&lt;/b&gt;&lt;span lang=EN-US style='font-size:10.0pt;
font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;'&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26127876&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;public-rdf-dawg-comments-request@...&lt;/a&gt;
[mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26127876&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;public-rdf-dawg-comments-request@...&lt;/a&gt;] &lt;b&gt;On Behalf Of &lt;/b&gt;Holger
Knublauch&lt;br&gt;
&lt;b&gt;Sent:&lt;/b&gt; 26 October 2009 23:56&lt;br&gt;
&lt;b&gt;To:&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26127876&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;public-rdf-dawg-comments@...&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Subject:&lt;/b&gt; Re: Missing LET (Assignment) in SPARQL 1.1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;Thanks, Lee. I appreciate you taking the time to assemble
all this information.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;I have made some experiments with the proposal to use
sub-selects plus project expressions in a random sample of some of my typical
queries. You can see three cases below. Without understanding all implications
from a SPARQL engine and algebra point of view, my impression is that the
mapping appears to be straight forward, but that it leads to very verbose code.
And I did not even try to find the really bad cases.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;I am therefore wondering whether LET can be introduced as
syntactic sugar similar to some of the new OWL 2 extensions that do not change
the semantics but only provide additional mappings from syntax to semantics -
this is hopefully easier to manage for the WG?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;Thanks,&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;Holger&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;----&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;p class=MsoNormal&gt;From the currency conversion example on my blog&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;a href=&quot;http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;The original current query is&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?newLiteral&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style='color:#090096'&gt;?fromCurrency&lt;/span&gt;&amp;nbsp;:= datatype(&lt;span style='color:#090096'&gt;?arg1&lt;/span&gt;)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style='color:#090096'&gt;?rate&lt;/span&gt;&amp;nbsp;:= currencies:getRateByCurrencies(&lt;span style='color:#090096'&gt;?fromCurrency&lt;/span&gt;,&amp;nbsp;&lt;span style='color:#090096'&gt;?arg2&lt;/span&gt;))
.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style='color:#090096'&gt;?fromValue&lt;/span&gt;&amp;nbsp;:= xsd:double(&lt;span style='color:#090096'&gt;?arg1&lt;/span&gt;)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;LET&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?newValue&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;:=
(&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?fromValue&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?rate&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;)) .&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style='color:#090096'&gt;?newLiteral&lt;/span&gt;&amp;nbsp;:= smf:cast(&lt;span style='color:#090096'&gt;?newValue&lt;/span&gt;,&amp;nbsp;&lt;span style='color:#090096'&gt;?arg2&lt;/span&gt;))
.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;Using nested queries with well-meaning formatting would
create something like&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?newLiteral&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;(datatype(&lt;span style='color:#090096'&gt;?arg1&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style='color:#090096'&gt;?fromCurrency&lt;/span&gt;) (xsd:double(&lt;span style='color:
#090096'&gt;?arg1&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style='color:#090096'&gt;?fromValue&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&amp;nbsp;{}&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span class=apple-tab-span&gt;                          &lt;/span&gt;&lt;b&gt;&lt;span style='color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(currencies:getRateByCurrencies(&lt;span style='color:#090096'&gt;?fromCurrency&lt;/span&gt;,&amp;nbsp;&lt;span style='color:#090096'&gt;?arg2&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style='color:#090096'&gt;?rate&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&amp;nbsp;{}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?fromValue&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?rate&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?newValue&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;{}&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;(smf:cast(&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?newValue&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?arg2&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?newLiteral&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;{}&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;Using a single expression would be&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;(smf:cast((xsd:double(&lt;span style='color:#090096'&gt;?arg1&lt;/span&gt;) * currencies:getRateByCurrencies(datatype(&lt;span style='color:#090096'&gt;?arg1&lt;/span&gt;),&amp;nbsp;&lt;span style='color:#090096'&gt;?arg2&lt;/span&gt;)),&amp;nbsp;&lt;span style='color:#090096'&gt;?arg2&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style='color:#090096'&gt;?newLiteral&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;The example is a bit atypical because it exclusively uses
LETs, and not even a triple match. It also uses externally pre-bound variables.
But still it gives some insights.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;---&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;In the following function body, project expressions work
actually ok, but keep fingers crossed that you do not have to return multiple
of such computed values in the SELECT:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?value&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?arg2&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style='color:#090096'&gt;?M1&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?arg2&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style='color:#090096'&gt;?O1&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?arg3&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style='color:#090096'&gt;?M2&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?arg3&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style='color:#090096'&gt;?O2&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style='color:#090096'&gt;?value&lt;/span&gt;&amp;nbsp;:= ((((&lt;b&gt;&lt;span style='color:#090096'&gt;?arg1&lt;/span&gt;&lt;/b&gt;&amp;nbsp;*&amp;nbsp;&lt;span style='color:#090096'&gt;?M1&lt;/span&gt;) +&amp;nbsp;&lt;span style='color:#090096'&gt;?O1&lt;/span&gt;)
-&amp;nbsp;&lt;span style='color:#090096'&gt;?O2&lt;/span&gt;) /&amp;nbsp;&lt;span style='color:#090096'&gt;?M2&lt;/span&gt;))
.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;would become&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;(((((&lt;b&gt;&lt;span style='color:#090096'&gt;?arg1&lt;/span&gt;&lt;/b&gt;&amp;nbsp;*&amp;nbsp;&lt;span style='color:#090096'&gt;?M1&lt;/span&gt;)
+&amp;nbsp;&lt;span style='color:#090096'&gt;?O1&lt;/span&gt;) -&amp;nbsp;&lt;span style='color:#090096'&gt;?O2&lt;/span&gt;)
/&amp;nbsp;&lt;span style='color:#090096'&gt;?M2&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style='color:#090096'&gt;?value&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?arg2&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style='color:#090096'&gt;?M1&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?arg2&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style='color:#090096'&gt;?O1&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?arg3&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style='color:#090096'&gt;?M2&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?arg3&lt;/span&gt;&lt;/b&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style='color:#090096'&gt;?O2&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;---&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;Here is an example from the SPIN box computer game, using
LET in SPARQL rules. This is a very typical use case actually:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#929292'&gt;# Rule1: Collect and replace diamond if possible&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;CONSTRUCT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:
&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?diamond&lt;/span&gt;&amp;nbsp;spinbox:replaceWith
spinbox:Space .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style='color:#090096'&gt;?newDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?this&lt;/span&gt;&lt;/b&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:keyDirection&amp;nbsp;&lt;span style='color:#090096'&gt;?direction&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;LET&lt;/span&gt;&lt;/b&gt;&amp;nbsp;(&lt;span style='color:#090096'&gt;?diamond&lt;/span&gt;&amp;nbsp;:= spinbox:getNeighbor(&lt;b&gt;&lt;span style='color:#090096'&gt;?this&lt;/span&gt;&lt;/b&gt;,&amp;nbsp;&lt;span style='color:#090096'&gt;?direction&lt;/span&gt;))
.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?diamond&lt;/span&gt;&amp;nbsp;a boulders:Diamond
.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?this&lt;/span&gt;&lt;/b&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style='color:#090096'&gt;?oldDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;LET&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?newDiamondsCount&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;:=
(&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?oldDiamondsCount&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:
&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;+ 1)) .&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;This would become&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#929292'&gt;# Rule1: Collect and replace diamond if possible&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;CONSTRUCT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:
&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?diamond&lt;/span&gt;&amp;nbsp;spinbox:replaceWith
spinbox:Space .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style='color:#090096'&gt;?newDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?this&lt;/span&gt;&lt;/b&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:keyDirection&amp;nbsp;&lt;span style='color:#090096'&gt;?direction&lt;/span&gt;&amp;nbsp;.&lt;span class=apple-tab-span&gt;          &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;(spinbox:getNeighbor(&lt;b&gt;&lt;span style='color:#090096'&gt;?this&lt;/span&gt;&lt;/b&gt;,&amp;nbsp;&lt;span style='color:#090096'&gt;?direction&lt;/span&gt;)&amp;nbsp;&lt;b&gt;&lt;span style='color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style='color:#090096'&gt;?diamond&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?diamond&lt;/span&gt;&amp;nbsp;a boulders:Diamond
.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;b&gt;&lt;span style='color:#090096'&gt;?this&lt;/span&gt;&lt;/b&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;span style='color:#090096'&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style='color:#090096'&gt;?oldDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=apple-tab-span&gt;                          &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;?oldDiamondsCount&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;+
1)&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#A30095'&gt;AS&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:black'&gt;&amp;nbsp;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;
color:#090096'&gt;?newDiamondsCount&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:
&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;)&lt;/span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#090096'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:black'&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;;color:#A30095'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span class=apple-tab-span&gt;&lt;span style='font-size:8.5pt;
font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:8.5pt;font-family:&quot;Lucida Grande&quot;,&quot;serif&quot;'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;div&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;On Oct 25, 2009, at 8:34 PM, Lee Feigenbaum wrote:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;p class=MsoNormal&gt;&lt;br&gt;
&lt;br&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;Hi Holger,&lt;br&gt;
&lt;br&gt;
Thanks for the feedback. Unfortunately, assignment is not on the current
Working Group's road map for standardization at this time. Here's how we got to
this point:&lt;br&gt;
&lt;br&gt;
From roughly March through May, the WG considered around 40 potential new
features[1] for the SPARQL landscape, including assignment[2]. At the time, we
documented two implementations (ARQ and Open Anzo) and the support that you
expressed for the feature back in March[3].&lt;br&gt;
&lt;br&gt;
In going through the features, the WG discussed Assignment in our March, 31
teleconference. You can see the discussion at the time at [4], the results of
which was a straw poll result of 7/6/3, indicating some support and several
notes of concern.&lt;br&gt;
&lt;br&gt;
Later in the process, we took a survey of WG member's prioritized preferences
of the proposed features. Steve Harris whipped up the Condorcet results of the
survey which you can see at [5]. Assignment was in the middle of the pack.&lt;br&gt;
&lt;br&gt;
At the group's first face-to-face meeting in May, assignment was discussed once
more[6], with significant concerns expressed from Garlik and OpenLink Software,
strong support from Clark &amp;amp; Parsia, and expressions ranging from
indifference to mild support from other WG members (as I read the minutes &amp;amp;
recollect the conversation). In the end, the group resolved to accept the list
of feature proposals at [7], and Kendall's concerns about the relationship between
assignment and projected expressions was addressed by Steve H at [8].&lt;br&gt;
&lt;br&gt;
Since then, the group has been rechartered with a specific mandate to work on
the features decided during the first phase of the group's lifetime[9]. It's my
hope &amp;amp; belief that if projected expressions do not end up fulfilling most
users' needs, that implementors will extend their SPARQL implementations with
assignment or a similar capability, and we will then revisit this in the next
round of SPARQL standardization.&lt;br&gt;
&lt;br&gt;
hope this is helpful,&lt;br&gt;
Lee&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
[1] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Category:Features&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Category:Features&lt;/a&gt;&lt;br&gt;
[2] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&lt;/a&gt;&lt;br&gt;
[3] &lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&lt;/a&gt;&lt;br&gt;
[4] &lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&lt;/a&gt;&lt;br&gt;
[5] &lt;a href=&quot;http://plugin.org.uk/misc/votes2.svg&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plugin.org.uk/misc/votes2.svg&lt;/a&gt;&lt;br&gt;
[6] &lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-05-06&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-05-06&lt;/a&gt;&lt;br&gt;
[7] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;amp;oldid=744&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;amp;oldid=744&lt;/a&gt;
&lt;br&gt;
[8] &lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&lt;/a&gt;&lt;br&gt;
[9] &lt;a href=&quot;http://www.w3.org/2009/05/sparql-phase-II-charter&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/05/sparql-phase-II-charter&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Holger Knublauch wrote:&lt;br&gt;
&lt;br&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;Dear WG,&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;reading through the drafts (great to have them already!) I
am confused about the future of Assignments (LET keyword in Jena) which has
proven to be absolutely essential for many of our customers projects. The
SPARQL 1.1 working group seems to have converged in favor of supporting Project
expressions and subqueries only, but these IMHO fail to address the
requirements below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;Problem 1: How to create new values for CONSTRUCT queries&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;Project expressions solve some problems for SELECT queries,
but the major use cases of LET have been in CONSTRUCT queries. I only see
subqueries as a (poor) way of creating new values for use in the CONSTRUCT
clause. Creating a subquery for every LET looks like a very user unfriendly
mechanism to me.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;Problem 2: Verbosity&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;We often work with complex transformations such as string
operations that are best split into multiple steps. Project expressions do not
allow using intermediate variables, such as below and would force users to
chain together very long spaghetti expressions such as SELECT (?x
ex:function3(ex:function2(ex:function1(?y))). Imagine this with some more
complex expressions and it quickly becomes completely unreadable. Also,
consider you would want to reuse intermediate values in multiple places, to
avoid duplicate processing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;*SELECT* ?x ?r&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;*WHERE* {&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;?x ex:property ?y .&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;*LET* (?helper1 := ex:function1(?y)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;*LET* (?helper2 := ex:function2(?helper1)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;*LET* (?r := ex:function3(?helper2)) .&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;The LET keyword has solved both problems nicely and in the
most general way, and would make project expressions superfluous.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;I would appreciate pointers to the discussions that led to
the decision to not support Assignments at this stage.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;Thanks&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;Holger&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;PS: For a parallel thread on jena-dev (with Andy's
response), see&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'&gt;

&lt;p class=MsoNormal&gt;&lt;a href=&quot;http://tech.groups.yahoo.com/group/jena-dev/message/41903&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/jena-dev/message/41903&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/blockquote&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;/body&gt;

&lt;/html&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26127876.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26107373</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-28T23:13:49Z</published>
	<updated>2009-10-28T23:13:49Z</updated>
	<author>
		<name>Richard Newman-8</name>
	</author>
	<content type="html">&lt;div class='shrinkable-quote'&gt;&amp;gt;&amp;gt; Yes, LET assignments will (have to) be order dependent. And yes, &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; this is a good thing. Sure, it may not be perfect from some &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; theoretical point of view, but without ordering the whole approach &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; would not work, and we would throw out the baby with the bath &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; water. Even the solution with nested sub-selects is order &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; dependent. Giving users the ability to specify the order in a &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; reliable way has not been a problem with any other mainstream &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; computer language, so why should SPARQL be different?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SPARQL is a query language, and my understanding of previous &amp;nbsp;
&lt;br&gt;&amp;gt; discussions is that there is concern that an assignment construct &amp;nbsp;
&lt;br&gt;&amp;gt; turns a (mostly) declarative language into a (somewhat) imperative &amp;nbsp;
&lt;br&gt;&amp;gt; language, which is (at least) a different mind set for users. Again, &amp;nbsp;
&lt;br&gt;&amp;gt; I'm just repeating what I believe I've heard from WG members.
&lt;/div&gt;&lt;br&gt;I believe that a large portion of SPARQL users (maybe all of the non- 
&lt;br&gt;experts) think procedurally when writing queries. They're not thinking &amp;nbsp;
&lt;br&gt;about satisfying clauses, they're thinking about &amp;quot;fetch all the &amp;nbsp;
&lt;br&gt;subjects with this object, then fetch all their names, then filter out &amp;nbsp;
&lt;br&gt;the ones with...&amp;quot;.
&lt;br&gt;&lt;br&gt;This is why they're surprised at unexpected results, or unexpected &amp;nbsp;
&lt;br&gt;performance: the algebraic interpretation of their queries is very &amp;nbsp;
&lt;br&gt;different to what they think they've written.
&lt;br&gt;&lt;br&gt;We're all far too close to RDF query languages to remember how non- 
&lt;br&gt;implementors think.
&lt;br&gt;&lt;br&gt;My wife is a UX person. In that field it's considered wise to never &amp;nbsp;
&lt;br&gt;think of the user being wrong: if they've come to the incorrect &amp;nbsp;
&lt;br&gt;conclusion, it's very likely because of something you've done or not &amp;nbsp;
&lt;br&gt;done, and it's the software that should change, not the user. It would &amp;nbsp;
&lt;br&gt;be interesting to run a user test of SPARQL; I'm sure we'd learn a &amp;nbsp;
&lt;br&gt;huge amount about the assumptions and pain points of people actually &amp;nbsp;
&lt;br&gt;trying to solve problems with it.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Also, for what it's worth, I don't think that LET need be ordered - &amp;nbsp;
&lt;br&gt;&amp;gt; the Open Anzo implementation is not, and it's (nevertheless) very &amp;nbsp;
&lt;br&gt;&amp;gt; useful for us.
&lt;br&gt;&lt;br&gt;Holger's usage seems to suggest using LET for intermediate results, &amp;nbsp;
&lt;br&gt;which at least allows efficient reuse of calculated values. That &amp;nbsp;
&lt;br&gt;requires ordering, implicit or not.
&lt;br&gt;&lt;br&gt;If the ordering is implicit, I guarantee that a customer will at some &amp;nbsp;
&lt;br&gt;point ask for a &amp;quot;warning mode&amp;quot; that tells you when a variable is used &amp;nbsp;
&lt;br&gt;before it's assigned to. You can specify behavior all you like, but &amp;nbsp;
&lt;br&gt;that doesn't change how people think.
&lt;br&gt;&lt;br&gt;The small set of Prolog users who are writing SPARQL will be pleased, &amp;nbsp;
&lt;br&gt;of course :)
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Also, as currently specified in our Working Drafts, subqueries are &amp;nbsp;
&lt;br&gt;&amp;gt; not order dependent. Andy or Steve will correct me if I'm wrong, I'm &amp;nbsp;
&lt;br&gt;&amp;gt; sure. :-)
&lt;br&gt;&lt;br&gt;If subqueries can either draw bindings from the enclosing query, or &amp;nbsp;
&lt;br&gt;return them back (surely both being required to make the feature &amp;nbsp;
&lt;br&gt;useful), then strictly controlling the order of their execution would &amp;nbsp;
&lt;br&gt;seem a smart thing to do. Imagine a remote query or subquery which &amp;nbsp;
&lt;br&gt;returns one result if ?x is bound, or a million different ?x bindings &amp;nbsp;
&lt;br&gt;if it's not... it's not always possible to figure out when that'll &amp;nbsp;
&lt;br&gt;happen.
&lt;br&gt;&lt;br&gt;&amp;quot;Sufficiently smart compiler&amp;quot; is not an adequate response. There's a &amp;nbsp;
&lt;br&gt;continuum along which software should gracefully cede control back to &amp;nbsp;
&lt;br&gt;the user.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; Same with FILTERs - often the query designer knows very well where &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; he wants the FILTERing to take place. Why should an engine be &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; required to do the re-ordering automatically and possibly mess up &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; any performance expectations? But that's a separate topic :)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; FILTERs are not order dependent in SPARQL. They are attached &amp;nbsp;
&lt;br&gt;&amp;gt; (conceptually) to either the optional pattern or the group pattern &amp;nbsp;
&lt;br&gt;&amp;gt; in which they occur.
&lt;br&gt;&lt;br&gt;Just to play devil's advocate for a moment:
&lt;br&gt;&lt;br&gt;I think Holger's point is that SPARQL as specified loses a lot of the &amp;nbsp;
&lt;br&gt;information that the query writer has encoded in the query. (He surely &amp;nbsp;
&lt;br&gt;knows that FILTERs are not order dependent: that's what he's lamenting.)
&lt;br&gt;&lt;br&gt;Most people do not think in an order-independent fashion, particularly &amp;nbsp;
&lt;br&gt;when other language constructs such as OPTIONAL *are* ordered (after a &amp;nbsp;
&lt;br&gt;fashion).
&lt;br&gt;&lt;br&gt;I see users interspersing FILTERs throughout their queries all the &amp;nbsp;
&lt;br&gt;time. Very often they do it because they know it's the best way to run &amp;nbsp;
&lt;br&gt;the query. The query language then says &amp;quot;pull out all the FILTERs&amp;quot;, &amp;nbsp;
&lt;br&gt;and the implementation then has to decide how to run them... and it &amp;nbsp;
&lt;br&gt;might not have as much information as does the user. (For example, &amp;nbsp;
&lt;br&gt;when the execution of a custom FILTER function is very expensive, and &amp;nbsp;
&lt;br&gt;you need to trick the planner to execute it later or earlier.)
&lt;br&gt;&lt;br&gt;Put another way: I've never *ever* seen a user write something like
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;SELECT * {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FILTER (?name ...)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;?x foaf:name ?name .
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;...
&lt;br&gt;&amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;even though it's meaningful SPARQL. Perhaps it shouldn't be meaningful.
&lt;br&gt;&lt;br&gt;This problem gets worse when you consider subqueries, remote queries, &amp;nbsp;
&lt;br&gt;computed properties...
&lt;br&gt;&lt;br&gt;Perhaps order-dependence is actually an intuitive, reasonable default &amp;nbsp;
&lt;br&gt;for a language? Imperative programming language compilers have done a &amp;nbsp;
&lt;br&gt;pretty good job starting with ordered statements, and figuring out &amp;nbsp;
&lt;br&gt;when they can disregard that to get better parallelism. That's an &amp;nbsp;
&lt;br&gt;optimization, not the default.
&lt;br&gt;&lt;br&gt;Devil's advocacy over :)
&lt;br&gt;&lt;br&gt;-R
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26107373.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26081495</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-27T10:08:51Z</published>
	<updated>2009-10-27T10:08:51Z</updated>
	<author>
		<name>Holger Knublauch-3</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;Hi Danny,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div&gt;&lt;font class=&quot;Apple-style-span&quot; color=&quot;#000000&quot;&gt;&lt;br&gt;&lt;/font&gt;But as Holger points out, LET could likely be order-dependent, but -&lt;br&gt;it doesn't have to be a drain. CONSTANT, no? The first assignation is&lt;br&gt;the only assignation to care about.&lt;br&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Whenever the right hand side of the LET contains variables and these variables change their binding, then the LET would need to be recomputed. So just computing them once won't work.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;However, there might be a nice compromise here that also preserves the declarative purity of SPARQL: only compute LETs on demand. In this scenario, LET would need to have an unbound variable on the left, and any algebraic operation that refers to that variable (e.g. in a BGP) would first call the function on the right to compute the value. Engines can then easily optimize the performance and avoid duplicate computations as long as the input variables have not changed yet. What would be the problems with this approach?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;Holger&lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26081495.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26077766</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-27T06:27:43Z</published>
	<updated>2009-10-27T06:27:43Z</updated>
	<author>
		<name>Lee Feigenbaum-2</name>
	</author>
	<content type="html">Holger Knublauch wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; This example actually is a good example of one thing that concerns me 
&lt;br&gt;&amp;gt;&amp;gt; about assignment (and remember that my implementation is one that does 
&lt;br&gt;&amp;gt;&amp;gt; support LET expressions): I'm concerned whenever a new SPARQL 
&lt;br&gt;&amp;gt;&amp;gt; construct has an order-dependence. SPARQL is already order-dependent 
&lt;br&gt;&amp;gt;&amp;gt; in cases involving OPTIONAL, but I prefer to keep as much of SPARQL 
&lt;br&gt;&amp;gt;&amp;gt; order-independent as is possible. The above collection of assignments 
&lt;br&gt;&amp;gt;&amp;gt; reads OK because of the order they're presented in, but if you switch 
&lt;br&gt;&amp;gt;&amp;gt; the order around it's not at all clear to me what the proper algebraic 
&lt;br&gt;&amp;gt;&amp;gt; expectations would be.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Yes, LET assignments will (have to) be order dependent. And yes, this is 
&lt;br&gt;&amp;gt; a good thing. Sure, it may not be perfect from some theoretical point of 
&lt;br&gt;&amp;gt; view, but without ordering the whole approach would not work, and we 
&lt;br&gt;&amp;gt; would throw out the baby with the bath water. Even the solution with 
&lt;br&gt;&amp;gt; nested sub-selects is order dependent. Giving users the ability to 
&lt;br&gt;&amp;gt; specify the order in a reliable way has not been a problem with any 
&lt;br&gt;&amp;gt; other mainstream computer language, so why should SPARQL be different?
&lt;/div&gt;&lt;br&gt;SPARQL is a query language, and my understanding of previous discussions 
&lt;br&gt;is that there is concern that an assignment construct turns a (mostly) 
&lt;br&gt;declarative language into a (somewhat) imperative language, which is (at 
&lt;br&gt;least) a different mind set for users. Again, I'm just repeating what I 
&lt;br&gt;believe I've heard from WG members.
&lt;br&gt;&lt;br&gt;Also, for what it's worth, I don't think that LET need be ordered - the 
&lt;br&gt;Open Anzo implementation is not, and it's (nevertheless) very useful for us.
&lt;br&gt;&lt;br&gt;Also, as currently specified in our Working Drafts, subqueries are not 
&lt;br&gt;order dependent. Andy or Steve will correct me if I'm wrong, I'm sure. :-)
&lt;br&gt;&lt;br&gt;&amp;gt; Same with FILTERs - often the query designer knows very well where he 
&lt;br&gt;&amp;gt; wants the FILTERing to take place. Why should an engine be required to 
&lt;br&gt;&amp;gt; do the re-ordering automatically and possibly mess up any performance 
&lt;br&gt;&amp;gt; expectations? But that's a separate topic :)
&lt;br&gt;&lt;br&gt;FILTERs are not order dependent in SPARQL. They are attached 
&lt;br&gt;(conceptually) to either the optional pattern or the group pattern in 
&lt;br&gt;which they occur.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; You can project multiple expressions from a single subquery, so I'm 
&lt;br&gt;&amp;gt;&amp;gt; not sure that's a concern?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The problem is readability. Imagine a couple of expressions in the same 
&lt;br&gt;&amp;gt; SELECT row...
&lt;br&gt;&lt;br&gt;I don't see any problem here...
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Again, why not put both calculations in a single subquery? I don't 
&lt;br&gt;&amp;gt;&amp;gt; know what &amp;quot;*?this*&amp;quot; is, but I'd expect this query to be much easier to 
&lt;br&gt;&amp;gt;&amp;gt; read as:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; CONSTRUCT {
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;?diamond spinbox:replaceWith spinbox:Space .
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;?world boulders:diamondsCollected ?newDiamondsCount .
&lt;br&gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;SELECT ?world (?oldDiamondCount + 1 AS ?newDiamongCount) 
&lt;br&gt;&amp;gt;&amp;gt; (spinbox:getNeighbor(?this, ?direction) AS ?diamond) {
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;?world spinbox:field ?this .
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;?world spinbox:keyDirection ?direction .
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;?diamond a boulders:Diamond .
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;?world spinbox:field ?this .
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;?world boulders:diamondsCollected ?oldDiamondsCount .
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Because I am using the variable ?diamond in the WHERE clause, 
&lt;/div&gt;&lt;br&gt;Ah, yes, I had not seen that.
&lt;br&gt;&lt;br&gt;Lee
&lt;br&gt;&lt;br&gt;and not
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; just in the CONSTRUCT. ?diamond will have to be bound in the ?diamond a 
&lt;br&gt;&amp;gt; boulders:Diamond match, otherwise the whole query does not make sense. 
&lt;br&gt;&amp;gt; Compare the original version below
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; # Rule1: Collect and replace diamond if possible
&lt;br&gt;&amp;gt; *CONSTRUCT* {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?diamond spinbox:replaceWith spinbox:Space .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world boulders:diamondsCollected ?newDiamondsCount .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world spinbox:field *?this* .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world spinbox:keyDirection ?direction .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *LET* (?diamond := spinbox:getNeighbor(*?this*, ?direction)) .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?diamond a boulders:Diamond .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world spinbox:field *?this* .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world boulders:diamondsCollected ?oldDiamondsCount .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *LET* (?newDiamondsCount := (?oldDiamondsCount + 1)) .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Holger
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26077766.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26071961</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-26T21:18:01Z</published>
	<updated>2009-10-26T21:18:01Z</updated>
	<author>
		<name>Danny Ayers</name>
	</author>
	<content type="html">Perhaps (on a sunny day) I might have something to add to the
&lt;br&gt;discussion, but please forgive me, I missed the point in which
&lt;br&gt;order-dependence arrived. I've not been keeping up and frankly I can't
&lt;br&gt;see how you can sensibly do it to OPTIONALs.
&lt;br&gt;&lt;br&gt;But as Holger points out, LET could likely be order-dependent, but -
&lt;br&gt;it doesn't have to be a drain. CONSTANT, no? The first assignation is
&lt;br&gt;the only assignation to care about.
&lt;br&gt;&lt;br&gt;Scoping of such things shouldn't be a big issue - we have brackets...
&lt;br&gt;&lt;br&gt;2009/10/27 Holger Knublauch &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26071961&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;yahoo@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&lt;br&gt;&amp;gt; Same with FILTERs - often the query designer knows very well where he wants
&lt;br&gt;&amp;gt; the FILTERing to take place. Why should an engine be required to do the
&lt;br&gt;&amp;gt; re-ordering automatically and possibly mess up any performance expectations?
&lt;br&gt;&amp;gt; But that's a separate topic :)
&lt;br&gt;&lt;br&gt;Absolutely. A FILTER is a filter, how it's implemented is irrelevant.
&lt;br&gt;&lt;br&gt;&amp;gt; You can project multiple expressions from a single subquery, so I'm not sure
&lt;br&gt;&amp;gt; that's a concern?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The problem is readability. Imagine a couple of expressions in the same
&lt;br&gt;&amp;gt; SELECT row...
&lt;br&gt;&lt;br&gt;I suspect (apologies again for not following relevant discussions)
&lt;br&gt;that's flogging a dead horse - if you need projection, use CONSTRUCT,
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Again, why not put both calculations in a single subquery? I don't know what
&lt;br&gt;&amp;gt; &amp;quot;*?this*&amp;quot; is, but I'd expect this query to be much easier to read as:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; CONSTRUCT {
&lt;br&gt;&amp;gt;    ?diamond spinbox:replaceWith spinbox:Space .
&lt;br&gt;&amp;gt;    ?world boulders:diamondsCollected ?newDiamondsCount .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt;  SELECT ?world (?oldDiamondCount + 1 AS ?newDiamongCount)
&lt;br&gt;&amp;gt; (spinbox:getNeighbor(?this, ?direction) AS ?diamond) {
&lt;br&gt;&amp;gt;    ?world spinbox:field ?this .
&lt;br&gt;&amp;gt;    ?world spinbox:keyDirection ?direction .
&lt;br&gt;&amp;gt;    ?diamond a boulders:Diamond .
&lt;br&gt;&amp;gt;    ?world spinbox:field ?this .
&lt;br&gt;&amp;gt;    ?world boulders:diamondsCollected ?oldDiamondsCount .
&lt;br&gt;&amp;gt;  }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Because I am using the variable ?diamond in the WHERE clause, and not just
&lt;br&gt;&amp;gt; in the CONSTRUCT. ?diamond will have to be bound in the ?diamond a
&lt;br&gt;&amp;gt; boulders:Diamond match, otherwise the whole query does not make sense.
&lt;/div&gt;&lt;br&gt;Surely ?diamond would be there catching something even in version 1.001?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Compare the original version below
&lt;br&gt;&amp;gt; # Rule1: Collect and replace diamond if possible
&lt;br&gt;&amp;gt; CONSTRUCT {
&lt;br&gt;&amp;gt;     ?diamond spinbox:replaceWith spinbox:Space .
&lt;br&gt;&amp;gt;     ?world boulders:diamondsCollected ?newDiamondsCount .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt;     ?world spinbox:field ?this .
&lt;br&gt;&amp;gt;     ?world spinbox:keyDirection ?direction .
&lt;br&gt;&amp;gt;     LET (?diamond := spinbox:getNeighbor(?this, ?direction)) .
&lt;br&gt;&amp;gt;     ?diamond a boulders:Diamond .
&lt;br&gt;&amp;gt;     ?world spinbox:field ?this .
&lt;br&gt;&amp;gt;     ?world boulders:diamondsCollected ?oldDiamondsCount .
&lt;br&gt;&amp;gt;     LET (?newDiamondsCount := (?oldDiamondsCount + 1)) .
&lt;br&gt;&amp;gt; }
&lt;/div&gt;&lt;br&gt;&lt;br&gt;The order of things appears to make things very messy, perhaps an
&lt;br&gt;argument for avoiding it.
&lt;br&gt;Maybe LETs should only appear at the start of a clause.
&lt;br&gt;&lt;br&gt;belated Cheers,
&lt;br&gt;Danny.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;a href=&quot;http://danny.ayers.name&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://danny.ayers.name&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26071961.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26071669</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-26T20:35:24Z</published>
	<updated>2009-10-26T20:35:24Z</updated>
	<author>
		<name>Holger Knublauch-3</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div&gt;This example actually is a good example of one thing that concerns me about assignment (and remember that my implementation is one that does support LET expressions): I'm concerned whenever a new SPARQL construct has an order-dependence. SPARQL is already order-dependent in cases involving OPTIONAL, but I prefer to keep as much of SPARQL order-independent as is possible. The above collection of assignments reads OK because of the order they're presented in, but if you switch the order around it's not at all clear to me what the proper algebraic expectations would be.&lt;br&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Yes, LET assignments will (have to) be order dependent. And yes, this is a good thing. Sure, it may not be perfect from some theoretical point of view, but without ordering the whole approach would not work, and we would throw out the baby with the bath water. Even the solution with nested sub-selects is order dependent. Giving users the ability to specify the order in a reliable way has not been a problem with any other mainstream computer language, so why should SPARQL be different?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Same with FILTERs - often the query designer knows very well where he wants the FILTERing to take place. Why should an engine be required to do the re-ordering automatically and possibly mess up any performance expectations? But that's a separate topic :)&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div&gt;&lt;br&gt;You can project multiple expressions from a single subquery, so I'm not sure that's a concern?&lt;br&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The problem is readability. Imagine a couple of expressions in the same SELECT row...&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div&gt;&lt;font class=&quot;Apple-style-span&quot; color=&quot;#000000&quot;&gt;&lt;br&gt;&lt;/font&gt;Again, why not put both calculations in a single subquery? I don't know what &quot;*?this*&quot; is, but I'd expect this query to be much easier to read as:&lt;br&gt;&lt;br&gt;CONSTRUCT {&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;?diamond spinbox:replaceWith spinbox:Space .&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;?world boulders:diamondsCollected ?newDiamondsCount .&lt;br&gt;}&lt;br&gt;WHERE {&lt;br&gt; &amp;nbsp;SELECT ?world (?oldDiamondCount + 1 AS ?newDiamongCount) (spinbox:getNeighbor(?this, ?direction) AS ?diamond) {&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;?world spinbox:field ?this .&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;?world spinbox:keyDirection ?direction .&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;?diamond a boulders:Diamond .&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;?world spinbox:field ?this .&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;?world boulders:diamondsCollected ?oldDiamondsCount .&lt;br&gt; &amp;nbsp;}&lt;br&gt;}&lt;br&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Because I am using the variable ?diamond in the WHERE clause, and not just in the CONSTRUCT. ?diamond will have to be bound in the ?diamond a boulders:Diamond match, otherwise the whole query does not make sense. Compare the original version below&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(146, 146, 146); &quot;&gt;# Rule1: Collect and replace diamond if possible&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;CONSTRUCT&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;spinbox:replaceWith spinbox:Space .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?this&lt;/b&gt;&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:keyDirection&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?direction&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;LET&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;:= spinbox:getNeighbor(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?this&lt;/b&gt;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?direction&lt;/span&gt;)) .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;a boulders:Diamond .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?this&lt;/b&gt;&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?oldDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(9, 0, 150); &quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;LET&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;(&lt;/span&gt;?newDiamondsCount&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;:= (&lt;/span&gt;?oldDiamondsCount&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;+ 1)) .&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Regards,&lt;/div&gt;&lt;div&gt;Holger&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26071669.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26070763</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-26T18:31:05Z</published>
	<updated>2009-10-26T18:31:05Z</updated>
	<author>
		<name>Lee Feigenbaum-2</name>
	</author>
	<content type="html">Holger Knublauch wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Thanks, Lee. I appreciate you taking the time to assemble all this 
&lt;br&gt;&amp;gt; information.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I have made some experiments with the proposal to use sub-selects plus 
&lt;br&gt;&amp;gt; project expressions in a random sample of some of my typical queries. 
&lt;br&gt;&amp;gt; You can see three cases below. Without understanding all implications 
&lt;br&gt;&amp;gt; from a SPARQL engine and algebra point of view, my impression is that 
&lt;br&gt;&amp;gt; the mapping appears to be straight forward, but that it leads to very 
&lt;br&gt;&amp;gt; verbose code. And I did not even try to find the really bad cases.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I am therefore wondering whether LET can be introduced as syntactic 
&lt;br&gt;&amp;gt; sugar similar to some of the new OWL 2 extensions that do not change the 
&lt;br&gt;&amp;gt; semantics but only provide additional mappings from syntax to semantics 
&lt;br&gt;&amp;gt; - this is hopefully easier to manage for the WG?
&lt;/div&gt;&lt;br&gt;Hi Holger,
&lt;br&gt;&lt;br&gt;In short, the group is free under its charter to consider this as a 
&lt;br&gt;purely syntactic sugar extension, but given the process we've been 
&lt;br&gt;through to this point, I don't expect it to happen.
&lt;br&gt;&lt;br&gt;That said, I have some comments / questions below in the interests of 
&lt;br&gt;discussion :-)
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; Holger
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ----
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp;From the currency conversion example on my blog
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The original current query is
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; *SELECT* ?newLiteral
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *LET* (?fromCurrency := datatype(?arg1)) .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *LET* (?rate := currencies:getRateByCurrencies(?fromCurrency, ?arg2)) .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *LET* (?fromValue := xsd:double(?arg1)) .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *LET* (?newValue := (?fromValue * ?rate)) .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *LET* (?newLiteral := smf:cast(?newValue, ?arg2)) .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Using nested queries with well-meaning formatting would create something 
&lt;br&gt;&amp;gt; like
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; *SELECT* ?newLiteral
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; *SELECT* (datatype(?arg1) *AS* ?fromCurrency) 
&lt;br&gt;&amp;gt; (xsd:double(?arg1) *AS* ?fromValue) *WHERE* {} 
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; *SELECT* (currencies:getRateByCurrencies(?fromCurrency, ?arg2) *AS* ?rate) *WHERE* {}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; *SELECT* ((?fromValue * ?rate) *AS* ?newValue) *WHERE* {}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; *SELECT* (smf:cast(?newValue, ?arg2) *AS* ?newLiteral) *WHERE* {}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; }
&lt;/div&gt;&lt;br&gt;This example actually is a good example of one thing that concerns me 
&lt;br&gt;about assignment (and remember that my implementation is one that does 
&lt;br&gt;support LET expressions): I'm concerned whenever a new SPARQL construct 
&lt;br&gt;has an order-dependence. SPARQL is already order-dependent in cases 
&lt;br&gt;involving OPTIONAL, but I prefer to keep as much of SPARQL 
&lt;br&gt;order-independent as is possible. The above collection of assignments 
&lt;br&gt;reads OK because of the order they're presented in, but if you switch 
&lt;br&gt;the order around it's not at all clear to me what the proper algebraic 
&lt;br&gt;expectations would be.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Using a single expression would be
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; *SELECT* (smf:cast((xsd:double(?arg1) * 
&lt;br&gt;&amp;gt; currencies:getRateByCurrencies(datatype(?arg1), ?arg2)), ?arg2) *AS* ?newLiteral)
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The example is a bit atypical because it exclusively uses LETs, and not 
&lt;br&gt;&amp;gt; even a triple match. It also uses externally pre-bound variables. But 
&lt;br&gt;&amp;gt; still it gives some insights.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ---
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In the following function body, project expressions work actually ok, 
&lt;br&gt;&amp;gt; but keep fingers crossed that you do not have to return multiple of such 
&lt;br&gt;&amp;gt; computed values in the SELECT:
&lt;/div&gt;&lt;br&gt;You can project multiple expressions from a single subquery, so I'm not 
&lt;br&gt;sure that's a concern?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; *SELECT* ?value
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *?arg2* qud:conversionMultiplier ?M1 .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *?arg2* qud:conversionOffset ?O1 .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *?arg3* qud:conversionMultiplier ?M2 .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *?arg3* qud:conversionOffset ?O2 .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *LET* (?value := ((((*?arg1* * ?M1) + ?O1) - ?O2) / ?M2)) .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; would become
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; *SELECT* (((((*?arg1* * ?M1) + ?O1) - ?O2) / ?M2) *AS* ?value)
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *?arg2* qud:conversionMultiplier ?M1 .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *?arg2* qud:conversionOffset ?O1 .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *?arg3* qud:conversionMultiplier ?M2 .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *?arg3* qud:conversionOffset ?O2 .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ---
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Here is an example from the SPIN box computer game, using LET in SPARQL 
&lt;br&gt;&amp;gt; rules. This is a very typical use case actually:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; # Rule1: Collect and replace diamond if possible
&lt;br&gt;&amp;gt; *CONSTRUCT* {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?diamond spinbox:replaceWith spinbox:Space .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world boulders:diamondsCollected ?newDiamondsCount .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world spinbox:field *?this* .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world spinbox:keyDirection ?direction .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *LET* (?diamond := spinbox:getNeighbor(*?this*, ?direction)) .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?diamond a boulders:Diamond .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world spinbox:field *?this* .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world boulders:diamondsCollected ?oldDiamondsCount .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; *LET* (?newDiamondsCount := (?oldDiamondsCount + 1)) .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This would become
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; # Rule1: Collect and replace diamond if possible
&lt;br&gt;&amp;gt; *CONSTRUCT* {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?diamond spinbox:replaceWith spinbox:Space .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world boulders:diamondsCollected ?newDiamondsCount .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world spinbox:field *?this* .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world spinbox:keyDirection ?direction .
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; *SELECT* (spinbox:getNeighbor(*?this*, ?direction) *AS* ?diamond)
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?diamond a boulders:Diamond .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world spinbox:field *?this* .
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ?world boulders:diamondsCollected ?oldDiamondsCount .
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;*SELECT* ((?oldDiamondsCount + 1) *AS* ?newDiamondsCount)
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;Again, why not put both calculations in a single subquery? I don't know 
&lt;br&gt;what &amp;quot;*?this*&amp;quot; is, but I'd expect this query to be much easier to read as:
&lt;br&gt;&lt;br&gt;CONSTRUCT {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;?diamond spinbox:replaceWith spinbox:Space .
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;?world boulders:diamondsCollected ?newDiamondsCount .
&lt;br&gt;}
&lt;br&gt;WHERE {
&lt;br&gt;&amp;nbsp; &amp;nbsp;SELECT ?world (?oldDiamondCount + 1 AS ?newDiamongCount) 
&lt;br&gt;(spinbox:getNeighbor(?this, ?direction) AS ?diamond) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;?world spinbox:field ?this .
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;?world spinbox:keyDirection ?direction .
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;?diamond a boulders:Diamond .
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;?world spinbox:field ?this .
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;?world boulders:diamondsCollected ?oldDiamondsCount .
&lt;br&gt;&amp;nbsp; &amp;nbsp;}
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;Lee
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Oct 25, 2009, at 8:34 PM, Lee Feigenbaum wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Hi Holger,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thanks for the feedback. Unfortunately, assignment is not on the 
&lt;br&gt;&amp;gt;&amp;gt; current Working Group's road map for standardization at this time. 
&lt;br&gt;&amp;gt;&amp;gt; Here's how we got to this point:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; From roughly March through May, the WG considered around 40 potential 
&lt;br&gt;&amp;gt;&amp;gt; new features[1] for the SPARQL landscape, including assignment[2]. At 
&lt;br&gt;&amp;gt;&amp;gt; the time, we documented two implementations (ARQ and Open Anzo) and 
&lt;br&gt;&amp;gt;&amp;gt; the support that you expressed for the feature back in March[3].
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; In going through the features, the WG discussed Assignment in our 
&lt;br&gt;&amp;gt;&amp;gt; March, 31 teleconference. You can see the discussion at the time at 
&lt;br&gt;&amp;gt;&amp;gt; [4], the results of which was a straw poll result of 7/6/3, indicating 
&lt;br&gt;&amp;gt;&amp;gt; some support and several notes of concern.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Later in the process, we took a survey of WG member's prioritized 
&lt;br&gt;&amp;gt;&amp;gt; preferences of the proposed features. Steve Harris whipped up the 
&lt;br&gt;&amp;gt;&amp;gt; Condorcet results of the survey which you can see at [5]. Assignment 
&lt;br&gt;&amp;gt;&amp;gt; was in the middle of the pack.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; At the group's first face-to-face meeting in May, assignment was 
&lt;br&gt;&amp;gt;&amp;gt; discussed once more[6], with significant concerns expressed from 
&lt;br&gt;&amp;gt;&amp;gt; Garlik and OpenLink Software, strong support from Clark &amp; Parsia, and 
&lt;br&gt;&amp;gt;&amp;gt; expressions ranging from indifference to mild support from other WG 
&lt;br&gt;&amp;gt;&amp;gt; members (as I read the minutes &amp; recollect the conversation). In the 
&lt;br&gt;&amp;gt;&amp;gt; end, the group resolved to accept the list of feature proposals at 
&lt;br&gt;&amp;gt;&amp;gt; [7], and Kendall's concerns about the relationship between assignment 
&lt;br&gt;&amp;gt;&amp;gt; and projected expressions was addressed by Steve H at [8].
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Since then, the group has been rechartered with a specific mandate to 
&lt;br&gt;&amp;gt;&amp;gt; work on the features decided during the first phase of the group's 
&lt;br&gt;&amp;gt;&amp;gt; lifetime[9]. It's my hope &amp; belief that if projected expressions do 
&lt;br&gt;&amp;gt;&amp;gt; not end up fulfilling most users' needs, that implementors will extend 
&lt;br&gt;&amp;gt;&amp;gt; their SPARQL implementations with assignment or a similar capability, 
&lt;br&gt;&amp;gt;&amp;gt; and we will then revisit this in the next round of SPARQL standardization.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; hope this is helpful,
&lt;br&gt;&amp;gt;&amp;gt; Lee
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; [1] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Category:Features&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Category:Features&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; [2] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; [3] 
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; [4] &lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; [5] &lt;a href=&quot;http://plugin.org.uk/misc/votes2.svg&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plugin.org.uk/misc/votes2.svg&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; [6] &lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-05-06&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-05-06&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; [7] 
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;oldid=744&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;oldid=744&lt;/a&gt;&amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;oldid=744&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;oldid=744&lt;/a&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; [8] 
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; [9] &lt;a href=&quot;http://www.w3.org/2009/05/sparql-phase-II-charter&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/05/sparql-phase-II-charter&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Holger Knublauch wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Dear WG,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; reading through the drafts (great to have them already!) I am 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; confused about the future of Assignments (LET keyword in Jena) which 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; has proven to be absolutely essential for many of our customers 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; projects. The SPARQL 1.1 working group seems to have converged in 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; favor of supporting Project expressions and subqueries only, but 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; these IMHO fail to address the requirements below.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Problem 1: How to create new values for CONSTRUCT queries
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Project expressions solve some problems for SELECT queries, but the 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; major use cases of LET have been in CONSTRUCT queries. I only see 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; subqueries as a (poor) way of creating new values for use in the 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; CONSTRUCT clause. Creating a subquery for every LET looks like a very 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; user unfriendly mechanism to me.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Problem 2: Verbosity
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; We often work with complex transformations such as string operations 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; that are best split into multiple steps. Project expressions do not 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; allow using intermediate variables, such as below and would force 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; users to chain together very long spaghetti expressions such as 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; SELECT (?x ex:function3(ex:function2(ex:function1(?y))). Imagine this 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; with some more complex expressions and it quickly becomes completely 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; unreadable. Also, consider you would want to reuse intermediate 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; values in multiple places, to avoid duplicate processing.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; *SELECT* ?x ?r
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ?x ex:property ?y .
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; *LET* (?helper1 := ex:function1(?y)) .
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; *LET* (?helper2 := ex:function2(?helper1)) .
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; *LET* (?r := ex:function3(?helper2)) .
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; The LET keyword has solved both problems nicely and in the most 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; general way, and would make project expressions superfluous.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I would appreciate pointers to the discussions that led to the 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; decision to not support Assignments at this stage.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Thanks
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Holger
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; PS: For a parallel thread on jena-dev (with Andy's response), see
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://tech.groups.yahoo.com/group/jena-dev/message/41903&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/jena-dev/message/41903&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26070763.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26070309</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-26T17:35:41Z</published>
	<updated>2009-10-26T17:35:41Z</updated>
	<author>
		<name>Paul Gearon</name>
	</author>
	<content type="html">Hi Holger,
&lt;br&gt;&lt;br&gt;While I agree with Lee's assessment, I also think that you're right in
&lt;br&gt;that simple variable assignment is important.
&lt;br&gt;&lt;br&gt;I'd like to point out that almost every implementation is already
&lt;br&gt;doing this, and I believe that they're using identical (or nearly
&lt;br&gt;identical) syntax. The fact that so many parse with ARQ is a good
&lt;br&gt;start. I also know that some non-ARQ versions (like mine) have just
&lt;br&gt;duplicated the ARQ syntax.
&lt;br&gt;&lt;br&gt;So while I don't think it will make the standard (and am disappointed
&lt;br&gt;that it won't) it may be possible to get a note published about it to
&lt;br&gt;recommend best practice. I believe that the only impediment to this is
&lt;br&gt;that it requires someone with the time to write it up.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Paul Gearon
&lt;br&gt;&lt;br&gt;On Mon, Oct 26, 2009 at 7:56 PM, Holger Knublauch &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26070309&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;yahoo@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Thanks, Lee. I appreciate you taking the time to assemble all this
&lt;br&gt;&amp;gt; information.
&lt;br&gt;&amp;gt; I have made some experiments with the proposal to use sub-selects plus
&lt;br&gt;&amp;gt; project expressions in a random sample of some of my typical queries. You
&lt;br&gt;&amp;gt; can see three cases below. Without understanding all implications from a
&lt;br&gt;&amp;gt; SPARQL engine and algebra point of view, my impression is that the mapping
&lt;br&gt;&amp;gt; appears to be straight forward, but that it leads to very verbose code. And
&lt;br&gt;&amp;gt; I did not even try to find the really bad cases.
&lt;br&gt;&amp;gt; I am therefore wondering whether LET can be introduced as syntactic sugar
&lt;br&gt;&amp;gt; similar to some of the new OWL 2 extensions that do not change the semantics
&lt;br&gt;&amp;gt; but only provide additional mappings from syntax to semantics - this is
&lt;br&gt;&amp;gt; hopefully easier to manage for the WG?
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; Holger
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ----
&lt;br&gt;&amp;gt; From the currency conversion example on my blog
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The original current query is
&lt;br&gt;&amp;gt; SELECT ?newLiteral
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt;     LET (?fromCurrency := datatype(?arg1)) .
&lt;br&gt;&amp;gt;     LET (?rate := currencies:getRateByCurrencies(?fromCurrency, ?arg2)) .
&lt;br&gt;&amp;gt;     LET (?fromValue := xsd:double(?arg1)) .
&lt;br&gt;&amp;gt;     LET (?newValue := (?fromValue * ?rate)) .
&lt;br&gt;&amp;gt;     LET (?newLiteral := smf:cast(?newValue, ?arg2)) .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; Using nested queries with well-meaning formatting would create something
&lt;br&gt;&amp;gt; like
&lt;br&gt;&amp;gt; SELECT ?newLiteral
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; SELECT (datatype(?arg1) AS ?fromCurrency)
&lt;br&gt;&amp;gt; (xsd:double(?arg1) AS ?fromValue) WHERE {}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SELECT (currencies:getRateByCurrencies(?fromCurrency, ?arg2) AS ?rate) WHERE {}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; SELECT ((?fromValue * ?rate) AS ?newValue) WHERE {}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; SELECT (smf:cast(?newValue, ?arg2) AS ?newLiteral) WHERE {}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; Using a single expression would be
&lt;br&gt;&amp;gt; SELECT (smf:cast((xsd:double(?arg1) *
&lt;br&gt;&amp;gt; currencies:getRateByCurrencies(datatype(?arg1), ?arg2)), ?arg2) AS ?newLiteral)
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; The example is a bit atypical because it exclusively uses LETs, and not even
&lt;br&gt;&amp;gt; a triple match. It also uses externally pre-bound variables. But still it
&lt;br&gt;&amp;gt; gives some insights.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ---
&lt;br&gt;&amp;gt; In the following function body, project expressions work actually ok, but
&lt;br&gt;&amp;gt; keep fingers crossed that you do not have to return multiple of such
&lt;br&gt;&amp;gt; computed values in the SELECT:
&lt;br&gt;&amp;gt; SELECT ?value
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt;     ?arg2 qud:conversionMultiplier ?M1 .
&lt;br&gt;&amp;gt;     ?arg2 qud:conversionOffset ?O1 .
&lt;br&gt;&amp;gt;     ?arg3 qud:conversionMultiplier ?M2 .
&lt;br&gt;&amp;gt;     ?arg3 qud:conversionOffset ?O2 .
&lt;br&gt;&amp;gt;     LET (?value := ((((?arg1 * ?M1) + ?O1) - ?O2) / ?M2)) .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; would become
&lt;br&gt;&amp;gt; SELECT (((((?arg1 * ?M1) + ?O1) - ?O2) / ?M2) AS ?value)
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt;     ?arg2 qud:conversionMultiplier ?M1 .
&lt;br&gt;&amp;gt;     ?arg2 qud:conversionOffset ?O1 .
&lt;br&gt;&amp;gt;     ?arg3 qud:conversionMultiplier ?M2 .
&lt;br&gt;&amp;gt;     ?arg3 qud:conversionOffset ?O2 .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; ---
&lt;br&gt;&amp;gt; Here is an example from the SPIN box computer game, using LET in SPARQL
&lt;br&gt;&amp;gt; rules. This is a very typical use case actually:
&lt;br&gt;&amp;gt; # Rule1: Collect and replace diamond if possible
&lt;br&gt;&amp;gt; CONSTRUCT {
&lt;br&gt;&amp;gt;     ?diamond spinbox:replaceWith spinbox:Space .
&lt;br&gt;&amp;gt;     ?world boulders:diamondsCollected ?newDiamondsCount .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt;     ?world spinbox:field ?this .
&lt;br&gt;&amp;gt;     ?world spinbox:keyDirection ?direction .
&lt;br&gt;&amp;gt;     LET (?diamond := spinbox:getNeighbor(?this, ?direction)) .
&lt;br&gt;&amp;gt;     ?diamond a boulders:Diamond .
&lt;br&gt;&amp;gt;     ?world spinbox:field ?this .
&lt;br&gt;&amp;gt;     ?world boulders:diamondsCollected ?oldDiamondsCount .
&lt;br&gt;&amp;gt;     LET (?newDiamondsCount := (?oldDiamondsCount + 1)) .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; This would become
&lt;br&gt;&amp;gt; # Rule1: Collect and replace diamond if possible
&lt;br&gt;&amp;gt; CONSTRUCT {
&lt;br&gt;&amp;gt;     ?diamond spinbox:replaceWith spinbox:Space .
&lt;br&gt;&amp;gt;     ?world boulders:diamondsCollected ?newDiamondsCount .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt;     ?world spinbox:field ?this .
&lt;br&gt;&amp;gt;     ?world spinbox:keyDirection ?direction .
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; SELECT (spinbox:getNeighbor(?this, ?direction) AS ?diamond)
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;     ?diamond a boulders:Diamond .
&lt;br&gt;&amp;gt;     ?world spinbox:field ?this .
&lt;br&gt;&amp;gt;     ?world boulders:diamondsCollected ?oldDiamondsCount .
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt;      SELECT ((?oldDiamondsCount + 1) AS ?newDiamondsCount)
&lt;br&gt;&amp;gt; WHERE {
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Oct 25, 2009, at 8:34 PM, Lee Feigenbaum wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi Holger,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks for the feedback. Unfortunately, assignment is not on the current
&lt;br&gt;&amp;gt; Working Group's road map for standardization at this time. Here's how we got
&lt;br&gt;&amp;gt; to this point:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; From roughly March through May, the WG considered around 40 potential new
&lt;br&gt;&amp;gt; features[1] for the SPARQL landscape, including assignment[2]. At the time,
&lt;br&gt;&amp;gt; we documented two implementations (ARQ and Open Anzo) and the support that
&lt;br&gt;&amp;gt; you expressed for the feature back in March[3].
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In going through the features, the WG discussed Assignment in our March, 31
&lt;br&gt;&amp;gt; teleconference. You can see the discussion at the time at [4], the results
&lt;br&gt;&amp;gt; of which was a straw poll result of 7/6/3, indicating some support and
&lt;br&gt;&amp;gt; several notes of concern.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Later in the process, we took a survey of WG member's prioritized
&lt;br&gt;&amp;gt; preferences of the proposed features. Steve Harris whipped up the Condorcet
&lt;br&gt;&amp;gt; results of the survey which you can see at [5]. Assignment was in the middle
&lt;br&gt;&amp;gt; of the pack.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; At the group's first face-to-face meeting in May, assignment was discussed
&lt;br&gt;&amp;gt; once more[6], with significant concerns expressed from Garlik and OpenLink
&lt;br&gt;&amp;gt; Software, strong support from Clark &amp; Parsia, and expressions ranging from
&lt;br&gt;&amp;gt; indifference to mild support from other WG members (as I read the minutes &amp;
&lt;br&gt;&amp;gt; recollect the conversation). In the end, the group resolved to accept the
&lt;br&gt;&amp;gt; list of feature proposals at [7], and Kendall's concerns about the
&lt;br&gt;&amp;gt; relationship between assignment and projected expressions was addressed by
&lt;br&gt;&amp;gt; Steve H at [8].
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Since then, the group has been rechartered with a specific mandate to work
&lt;br&gt;&amp;gt; on the features decided during the first phase of the group's lifetime[9].
&lt;br&gt;&amp;gt; It's my hope &amp; belief that if projected expressions do not end up fulfilling
&lt;br&gt;&amp;gt; most users' needs, that implementors will extend their SPARQL
&lt;br&gt;&amp;gt; implementations with assignment or a similar capability, and we will then
&lt;br&gt;&amp;gt; revisit this in the next round of SPARQL standardization.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; hope this is helpful,
&lt;br&gt;&amp;gt; Lee
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [1] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Category:Features&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Category:Features&lt;/a&gt;&lt;br&gt;&amp;gt; [2] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&lt;/a&gt;&lt;br&gt;&amp;gt; [3]
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&lt;/a&gt;&lt;br&gt;&amp;gt; [4] &lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&lt;/a&gt;&lt;br&gt;&amp;gt; [5] &lt;a href=&quot;http://plugin.org.uk/misc/votes2.svg&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plugin.org.uk/misc/votes2.svg&lt;/a&gt;&lt;br&gt;&amp;gt; [6] &lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-05-06&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-05-06&lt;/a&gt;&lt;br&gt;&amp;gt; [7]
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;oldid=744&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;oldid=744&lt;/a&gt;&lt;br&gt;&amp;gt; [8] &lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&lt;/a&gt;&lt;br&gt;&amp;gt; [9] &lt;a href=&quot;http://www.w3.org/2009/05/sparql-phase-II-charter&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/05/sparql-phase-II-charter&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Holger Knublauch wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Dear WG,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; reading through the drafts (great to have them already!) I am confused about
&lt;br&gt;&amp;gt; the future of Assignments (LET keyword in Jena) which has proven to be
&lt;br&gt;&amp;gt; absolutely essential for many of our customers projects. The SPARQL 1.1
&lt;br&gt;&amp;gt; working group seems to have converged in favor of supporting Project
&lt;br&gt;&amp;gt; expressions and subqueries only, but these IMHO fail to address the
&lt;br&gt;&amp;gt; requirements below.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Problem 1: How to create new values for CONSTRUCT queries
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Project expressions solve some problems for SELECT queries, but the major
&lt;br&gt;&amp;gt; use cases of LET have been in CONSTRUCT queries. I only see subqueries as a
&lt;br&gt;&amp;gt; (poor) way of creating new values for use in the CONSTRUCT clause. Creating
&lt;br&gt;&amp;gt; a subquery for every LET looks like a very user unfriendly mechanism to me.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Problem 2: Verbosity
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; We often work with complex transformations such as string operations that
&lt;br&gt;&amp;gt; are best split into multiple steps. Project expressions do not allow using
&lt;br&gt;&amp;gt; intermediate variables, such as below and would force users to chain
&lt;br&gt;&amp;gt; together very long spaghetti expressions such as SELECT (?x
&lt;br&gt;&amp;gt; ex:function3(ex:function2(ex:function1(?y))). Imagine this with some more
&lt;br&gt;&amp;gt; complex expressions and it quickly becomes completely unreadable. Also,
&lt;br&gt;&amp;gt; consider you would want to reuse intermediate values in multiple places, to
&lt;br&gt;&amp;gt; avoid duplicate processing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; *SELECT* ?x ?r
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ?x ex:property ?y .
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; *LET* (?helper1 := ex:function1(?y)) .
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; *LET* (?helper2 := ex:function2(?helper1)) .
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; *LET* (?r := ex:function3(?helper2)) .
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The LET keyword has solved both problems nicely and in the most general way,
&lt;br&gt;&amp;gt; and would make project expressions superfluous.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I would appreciate pointers to the discussions that led to the decision to
&lt;br&gt;&amp;gt; not support Assignments at this stage.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Holger
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PS: For a parallel thread on jena-dev (with Andy's response), see
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://tech.groups.yahoo.com/group/jena-dev/message/41903&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/jena-dev/message/41903&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26070309.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26069950</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-26T16:56:08Z</published>
	<updated>2009-10-26T16:56:08Z</updated>
	<author>
		<name>Holger Knublauch-3</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;Thanks, Lee. I appreciate you taking the time to assemble all this information.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I have made some experiments with the proposal to use sub-selects plus project expressions in a random sample of some of my typical queries. You can see three cases below. Without understanding all implications from a SPARQL engine and algebra point of view, my impression is that the mapping appears to be straight forward, but that it leads to very verbose code. And I did not even try to find the really bad cases.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I am therefore wondering whether LET can be introduced as syntactic sugar similar to some of the new OWL 2 extensions that do not change the semantics but only provide additional mappings from syntax to semantics - this is hopefully easier to manage for the WG?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks,&lt;/div&gt;&lt;div&gt;Holger&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;----&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;From the currency conversion example on my blog&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html&lt;/a&gt;&lt;br&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The original current query is&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(9, 0, 150); &quot;&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;&lt;/span&gt;?newLiteral&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;LET&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromCurrency&lt;/span&gt;&amp;nbsp;:= datatype(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;)) .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;LET&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?rate&lt;/span&gt;&amp;nbsp;:= currencies:getRateByCurrencies(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromCurrency&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)) .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;LET&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromValue&lt;/span&gt;&amp;nbsp;:= xsd:double(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;)) .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(9, 0, 150); &quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;LET&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;(&lt;/span&gt;?newValue&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;:= (&lt;/span&gt;?fromValue&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;?rate&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;)) .&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;LET&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newLiteral&lt;/span&gt;&amp;nbsp;:= smf:cast(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newValue&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)) .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Using nested queries with well-meaning formatting would create something like&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(9, 0, 150); &quot;&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;&lt;/span&gt;?newLiteral&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;		&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(datatype(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;AS&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromCurrency&lt;/span&gt;) (xsd:double(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;AS&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromValue&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;/span&gt;&amp;nbsp;{}&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;		&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(currencies:getRateByCurrencies(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?fromCurrency&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;AS&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?rate&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;/span&gt;&amp;nbsp;{}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(9, 0, 150); &quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;		&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;((&lt;/span&gt;?fromValue&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;?rate&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;AS&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;&lt;/span&gt;?newValue&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(9, 0, 150); &quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;		&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;(smf:cast(&lt;/span&gt;?newValue&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;,&amp;nbsp;&lt;/span&gt;?arg2&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;AS&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;&lt;/span&gt;?newLiteral&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Using a single expression would be&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(smf:cast((xsd:double(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;) * currencies:getRateByCurrencies(datatype(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg1&lt;/span&gt;),&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)),&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?arg2&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;AS&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newLiteral&lt;/span&gt;)&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The example is a bit atypical because it exclusively uses LETs, and not even a triple match. It also uses externally pre-bound variables. But still it gives some insights.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;---&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;In the following function body, project expressions work actually ok, but keep fingers crossed that you do not have to return multiple of such computed values in the SELECT:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?value&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?arg2&lt;/b&gt;&lt;/span&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M1&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?arg2&lt;/b&gt;&lt;/span&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O1&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?arg3&lt;/b&gt;&lt;/span&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M2&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?arg3&lt;/b&gt;&lt;/span&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O2&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;LET&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?value&lt;/span&gt;&amp;nbsp;:= ((((&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?arg1&lt;/b&gt;&lt;/span&gt;&amp;nbsp;*&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M1&lt;/span&gt;) +&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O1&lt;/span&gt;) -&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O2&lt;/span&gt;) /&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M2&lt;/span&gt;)) .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;would become&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(((((&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?arg1&lt;/b&gt;&lt;/span&gt;&amp;nbsp;*&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M1&lt;/span&gt;) +&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O1&lt;/span&gt;) -&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O2&lt;/span&gt;) /&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M2&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;AS&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?value&lt;/span&gt;)&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?arg2&lt;/b&gt;&lt;/span&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M1&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?arg2&lt;/b&gt;&lt;/span&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O1&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?arg3&lt;/b&gt;&lt;/span&gt;&amp;nbsp;qud:conversionMultiplier&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?M2&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?arg3&lt;/b&gt;&lt;/span&gt;&amp;nbsp;qud:conversionOffset&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?O2&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;---&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Here is an example from the SPIN box computer game, using LET in SPARQL rules. This is a very typical use case actually:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(146, 146, 146); &quot;&gt;# Rule1: Collect and replace diamond if possible&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;CONSTRUCT&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;spinbox:replaceWith spinbox:Space .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?this&lt;/b&gt;&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:keyDirection&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?direction&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;LET&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;:= spinbox:getNeighbor(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?this&lt;/b&gt;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?direction&lt;/span&gt;)) .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;a boulders:Diamond .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?this&lt;/b&gt;&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?oldDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(9, 0, 150); &quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;LET&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;(&lt;/span&gt;?newDiamondsCount&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;:= (&lt;/span&gt;?oldDiamondsCount&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;+ 1)) .&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;This would become&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(146, 146, 146); &quot;&gt;# Rule1: Collect and replace diamond if possible&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;CONSTRUCT&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;spinbox:replaceWith spinbox:Space .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?newDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?this&lt;/b&gt;&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:keyDirection&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?direction&lt;/span&gt;&amp;nbsp;.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;		&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&amp;nbsp;(spinbox:getNeighbor(&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?this&lt;/b&gt;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?direction&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;AS&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;)&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;		&lt;/span&gt;&lt;/span&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;		&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?diamond&lt;/span&gt;&amp;nbsp;a boulders:Diamond .&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;spinbox:field&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;&lt;b&gt;?this&lt;/b&gt;&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?world&lt;/span&gt;&amp;nbsp;boulders:diamondsCollected&amp;nbsp;&lt;span style=&quot;color: rgb(9, 0, 150); &quot;&gt;?oldDiamondsCount&lt;/span&gt;&amp;nbsp;.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(9, 0, 150); &quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;		&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;((&lt;/span&gt;?oldDiamondsCount&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;+ 1)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 0, 149); &quot;&gt;&lt;b&gt;AS&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;&lt;/span&gt;?newDiamondsCount&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; color: rgb(163, 0, 149); &quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;		&lt;/span&gt;&lt;/span&gt;&lt;b&gt;WHERE&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0); &quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;		&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; &quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Oct 25, 2009, at 8:34 PM, Lee Feigenbaum wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div&gt;Hi Holger,&lt;br&gt;&lt;br&gt;Thanks for the feedback. Unfortunately, assignment is not on the current Working Group's road map for standardization at this time. Here's how we got to this point:&lt;br&gt;&lt;br&gt;From roughly March through May, the WG considered around 40 potential new features[1] for the SPARQL landscape, including assignment[2]. At the time, we documented two implementations (ARQ and Open Anzo) and the support that you expressed for the feature back in March[3].&lt;br&gt;&lt;br&gt;In going through the features, the WG discussed Assignment in our March, 31 teleconference. You can see the discussion at the time at [4], the results of which was a straw poll result of 7/6/3, indicating some support and several notes of concern.&lt;br&gt;&lt;br&gt;Later in the process, we took a survey of WG member's prioritized preferences of the proposed features. Steve Harris whipped up the Condorcet results of the survey which you can see at [5]. Assignment was in the middle of the pack.&lt;br&gt;&lt;br&gt;At the group's first face-to-face meeting in May, assignment was discussed once more[6], with significant concerns expressed from Garlik and OpenLink Software, strong support from Clark &amp;amp; Parsia, and expressions ranging from indifference to mild support from other WG members (as I read the minutes &amp;amp; recollect the conversation). In the end, the group resolved to accept the list of feature proposals at [7], and Kendall's concerns about the relationship between assignment and projected expressions was addressed by Steve H at [8].&lt;br&gt;&lt;br&gt;Since then, the group has been rechartered with a specific mandate to work on the features decided during the first phase of the group's lifetime[9]. It's my hope &amp;amp; belief that if projected expressions do not end up fulfilling most users' needs, that implementors will extend their SPARQL implementations with assignment or a similar capability, and we will then revisit this in the next round of SPARQL standardization.&lt;br&gt;&lt;br&gt;hope this is helpful,&lt;br&gt;Lee&lt;br&gt;&lt;br&gt;&lt;br&gt;[1] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Category:Features&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Category:Features&lt;/a&gt;&lt;br&gt;[2] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&lt;/a&gt;&lt;br&gt;[3] &lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&lt;/a&gt;&lt;br&gt;[4] &lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&lt;/a&gt;&lt;br&gt;[5] &lt;a href=&quot;http://plugin.org.uk/misc/votes2.svg&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plugin.org.uk/misc/votes2.svg&lt;/a&gt;&lt;br&gt;[6] &lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-05-06&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-05-06&lt;/a&gt;&lt;br&gt;[7] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;amp;oldid=744&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;amp;oldid=744&lt;/a&gt; &lt;br&gt;[8] &lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&lt;/a&gt;&lt;br&gt;[9] &lt;a href=&quot;http://www.w3.org/2009/05/sparql-phase-II-charter&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/05/sparql-phase-II-charter&lt;/a&gt;&lt;br&gt;&lt;br&gt;Holger Knublauch wrote:&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;Dear WG,&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;reading through the drafts (great to have them already!) I am confused about the future of Assignments (LET keyword in Jena) which has proven to be absolutely essential for many of our customers projects. The SPARQL 1.1 working group seems to have converged in favor of supporting Project expressions and subqueries only, but these IMHO fail to address the requirements below.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;Problem 1: How to create new values for CONSTRUCT queries&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;Project expressions solve some problems for SELECT queries, but the major use cases of LET have been in CONSTRUCT queries. I only see subqueries as a (poor) way of creating new values for use in the CONSTRUCT clause. Creating a subquery for every LET looks like a very user unfriendly mechanism to me.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;Problem 2: Verbosity&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;We often work with complex transformations such as string operations that are best split into multiple steps. Project expressions do not allow using intermediate variables, such as below and would force users to chain together very long spaghetti expressions such as SELECT (?x ex:function3(ex:function2(ex:function1(?y))). Imagine this with some more complex expressions and it quickly becomes completely unreadable. Also, consider you would want to reuse intermediate values in multiple places, to avoid duplicate processing.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;*SELECT* ?x ?r&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;*WHERE* {&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;?x ex:property ?y .&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;*LET* (?helper1 := ex:function1(?y)) .&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;*LET* (?helper2 := ex:function2(?helper1)) .&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;*LET* (?r := ex:function3(?helper2)) .&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;}&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;The LET keyword has solved both problems nicely and in the most general way, and would make project expressions superfluous.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;I would appreciate pointers to the discussions that led to the decision to not support Assignments at this stage.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;Thanks&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;Holger&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;PS: For a parallel thread on jena-dev (with Andy's response), see&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;a href=&quot;http://tech.groups.yahoo.com/group/jena-dev/message/41903&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/jena-dev/message/41903&lt;/a&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26069950.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26054282</id>
	<title>Re: Missing LET (Assignment) in SPARQL 1.1</title>
	<published>2009-10-25T20:34:00Z</published>
	<updated>2009-10-25T20:34:00Z</updated>
	<author>
		<name>Lee Feigenbaum-2</name>
	</author>
	<content type="html">Hi Holger,
&lt;br&gt;&lt;br&gt;Thanks for the feedback. Unfortunately, assignment is not on the current 
&lt;br&gt;Working Group's road map for standardization at this time. Here's how we 
&lt;br&gt;got to this point:
&lt;br&gt;&lt;br&gt;&amp;nbsp;From roughly March through May, the WG considered around 40 potential 
&lt;br&gt;new features[1] for the SPARQL landscape, including assignment[2]. At 
&lt;br&gt;the time, we documented two implementations (ARQ and Open Anzo) and the 
&lt;br&gt;support that you expressed for the feature back in March[3].
&lt;br&gt;&lt;br&gt;In going through the features, the WG discussed Assignment in our March, 
&lt;br&gt;31 teleconference. You can see the discussion at the time at [4], the 
&lt;br&gt;results of which was a straw poll result of 7/6/3, indicating some 
&lt;br&gt;support and several notes of concern.
&lt;br&gt;&lt;br&gt;Later in the process, we took a survey of WG member's prioritized 
&lt;br&gt;preferences of the proposed features. Steve Harris whipped up the 
&lt;br&gt;Condorcet results of the survey which you can see at [5]. Assignment was 
&lt;br&gt;in the middle of the pack.
&lt;br&gt;&lt;br&gt;At the group's first face-to-face meeting in May, assignment was 
&lt;br&gt;discussed once more[6], with significant concerns expressed from Garlik 
&lt;br&gt;and OpenLink Software, strong support from Clark &amp; Parsia, and 
&lt;br&gt;expressions ranging from indifference to mild support from other WG 
&lt;br&gt;members (as I read the minutes &amp; recollect the conversation). In the 
&lt;br&gt;end, the group resolved to accept the list of feature proposals at [7], 
&lt;br&gt;and Kendall's concerns about the relationship between assignment and 
&lt;br&gt;projected expressions was addressed by Steve H at [8].
&lt;br&gt;&lt;br&gt;Since then, the group has been rechartered with a specific mandate to 
&lt;br&gt;work on the features decided during the first phase of the group's 
&lt;br&gt;lifetime[9]. It's my hope &amp; belief that if projected expressions do not 
&lt;br&gt;end up fulfilling most users' needs, that implementors will extend their 
&lt;br&gt;SPARQL implementations with assignment or a similar capability, and we 
&lt;br&gt;will then revisit this in the next round of SPARQL standardization.
&lt;br&gt;&lt;br&gt;hope this is helpful,
&lt;br&gt;Lee
&lt;br&gt;&lt;br&gt;&lt;br&gt;[1] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Category:Features&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Category:Features&lt;/a&gt;&lt;br&gt;[2] &lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/Feature:Assignment&lt;/a&gt;&lt;br&gt;[3] 
&lt;br&gt;&lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2009Mar/0009.html&lt;/a&gt;&lt;br&gt;[4] &lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-03-31#assignment&lt;/a&gt;&lt;br&gt;[5] &lt;a href=&quot;http://plugin.org.uk/misc/votes2.svg&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plugin.org.uk/misc/votes2.svg&lt;/a&gt;&lt;br&gt;[6] &lt;a href=&quot;http://www.w3.org/2009/sparql/meeting/2009-05-06&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/meeting/2009-05-06&lt;/a&gt;&lt;br&gt;[7] 
&lt;br&gt;&lt;a href=&quot;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;oldid=744&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/sparql/wiki/index.php?title=FeatureProposal&amp;oldid=744&lt;/a&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;[8] &lt;a href=&quot;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.w3.org/Archives/Public/public-rdf-dawg/2009AprJun/0231.html&lt;/a&gt;&lt;br&gt;[9] &lt;a href=&quot;http://www.w3.org/2009/05/sparql-phase-II-charter&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.w3.org/2009/05/sparql-phase-II-charter&lt;/a&gt;&lt;br&gt;&lt;br&gt;Holger Knublauch wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Dear WG,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; reading through the drafts (great to have them already!) I am confused 
&lt;br&gt;&amp;gt; about the future of Assignments (LET keyword in Jena) which has proven 
&lt;br&gt;&amp;gt; to be absolutely essential for many of our customers projects. The 
&lt;br&gt;&amp;gt; SPARQL 1.1 working group seems to have converged in favor of supporting 
&lt;br&gt;&amp;gt; Project expressions and subqueries only, but these IMHO fail to address 
&lt;br&gt;&amp;gt; the requirements below.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Problem 1: How to create new values for CONSTRUCT queries
&lt;br&gt;&amp;gt; Project expressions solve some problems for SELECT queries, but the 
&lt;br&gt;&amp;gt; major use cases of LET have been in CONSTRUCT queries. I only see 
&lt;br&gt;&amp;gt; subqueries as a (poor) way of creating new values for use in the 
&lt;br&gt;&amp;gt; CONSTRUCT clause. Creating a subquery for every LET looks like a very 
&lt;br&gt;&amp;gt; user unfriendly mechanism to me.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Problem 2: Verbosity
&lt;br&gt;&amp;gt; We often work with complex transformations such as string operations 
&lt;br&gt;&amp;gt; that are best split into multiple steps. Project expressions do not 
&lt;br&gt;&amp;gt; allow using intermediate variables, such as below and would force users 
&lt;br&gt;&amp;gt; to chain together very long spaghetti expressions such as SELECT (?x 
&lt;br&gt;&amp;gt; ex:function3(ex:function2(ex:function1(?y))). Imagine this with some 
&lt;br&gt;&amp;gt; more complex expressions and it quickly becomes completely unreadable. 
&lt;br&gt;&amp;gt; Also, consider you would want to reuse intermediate values in multiple 
&lt;br&gt;&amp;gt; places, to avoid duplicate processing.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; *SELECT* ?x ?r
&lt;br&gt;&amp;gt; *WHERE* {
&lt;br&gt;&amp;gt; ?x ex:property ?y .
&lt;br&gt;&amp;gt; *LET* (?helper1 := ex:function1(?y)) .
&lt;br&gt;&amp;gt; *LET* (?helper2 := ex:function2(?helper1)) .
&lt;br&gt;&amp;gt; *LET* (?r := ex:function3(?helper2)) .
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The LET keyword has solved both problems nicely and in the most general 
&lt;br&gt;&amp;gt; way, and would make project expressions superfluous.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I would appreciate pointers to the discussions that led to the decision 
&lt;br&gt;&amp;gt; to not support Assignments at this stage.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks
&lt;br&gt;&amp;gt; Holger
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; PS: For a parallel thread on jena-dev (with Andy's response), see
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://tech.groups.yahoo.com/group/jena-dev/message/41903&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/jena-dev/message/41903&lt;/a&gt;&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-LET-%28Assignment%29-in-SPARQL-1.1-tp26051035p26054282.html" />
</entry>

</feed>
