Here's an interesting bug.  On the DBpedia endpoint, this query:

select ?a ?b ?c where {
  values (?a ?b ?c) {
    (1 "2" <3>)
    ("4" <5> 6)
    (<7> 8 "9")
  }
}

returns these results (CSV here, for clarity):

"a","b","c"
1,,
"4",,
"7",,

There are no values bound for variables ?b and ?c.  That said, in the
body of the query, the bindings established by the `values` are in
effect, and certain other parts of the query make bindings appear for
some of the variables. E.g.,

select ?a ?b ?c where {
  values (?a ?b ?c) {
    (1 "2" <3>)
    ("4" <5> 6)
    (<7> 8 "9")
  }
  filter(isIRI(?b))   # but ?b will be rendered as a string in the CSV
}

"a","b","c"
"4","5",6

We can't extend that approach to get all the expected results, though:

select ?a ?b ?c where {
  values (?a ?b ?c) {
    (1 "2" <3>)
    ("4" <5> 6)
    (<7> 8 "9")
  }
  filter(isIRI(?b))
}

"a","b","c"
"7",,

There's clearly something strange going on here.  I ran into this
while answering a StackOverflow question [1], when a user reported
that a solution using `values` didn't work on DBpedia [2] and
illustrated it with a small example, viz.:

select * where { values (?lang ?rank) { ("ru" 1) ("en" 2) } }

//JT

[1] http://stackoverflow.com/q/21531063/1281433
[2] 
http://stackoverflow.com/questions/21531063/sparql-multi-lang-data-compression-to-one-row/21531367?noredirect=1#comment32548395_21531367

-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to