Tim; Unfortunately, your query is not like the example you cite because BIND is interpreted outside of the basic graph pattern.
Fortunately, in your case you can simply remove the OPTIONAL clause. BIND semantics are somewhat similar in that the assigned variable will be unbound if the expression fails. -- Scott On Nov 30, 2012, at 2:37 PM, Tim Smith <[email protected]> wrote: > Hi, > > In the following query, why is ?lab not bound inside the OPTIONAL? > > SELECT * > WHERE { > owl:Thing rdfs:label ?lab . > OPTIONAL{ > BIND (smf:trim(?lab) as ?lab2). > BIND(smf:if(BOUND(?lab), true, false) as ?bound) . } . > } > > The results of the query using TBC 3.6.1 are: > > ?lab = Thing > ?lab2 = is unbound > ?bound = false > > My query is similar to this example from the SPARQL reference page so I'm > curious as to why it doesn't work: > > http://www.w3.org/TR/sparql11-query/#optionals > > PREFIX foaf: <http://xmlns.com/foaf/0.1/> > SELECT ?name ?mbox > WHERE { ?x foaf:name ?name . > OPTIONAL { ?x foaf:mbox ?mbox } > } > > > > > -- > -- You received this message because you are subscribed to the Google > Group "TopBraid Suite Users", the topics of which include Enterprise > Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, > TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN. > To post to this group, send email to > [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/topbraid-users?hl=en > > -- -- You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/topbraid-users?hl=en
