From: J. P. <jsp...@gm...> - 2008-11-14 00:59:46
|
Hello all, we have tried to run a query to load foaf:names of a foaf:Group class, in which each foaf:name has different lang. The name in English lang is always present, the name in Czech lang is optional. The data are here http://keg.vse.cz/demo-groups.rdf Our SPARQL select was the following one: PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?group ?nameEn ?nameCs WHERE { ?group rdf:type foaf:Group . ?group foaf:name ?nameEn . OPTIONAL { ?group foaf:name ?nameCs . FILTER (lang(?nameCs) = "cs") } FILTER (lang(?nameEn) = "en") } But using RAP engine, we got only resources, which have both names bound: Array ( [0] => Array ( [?group] => Resource Object ( [uri] => http://keg.vse.cz/resource/group/KIZI ) [?nameEn] => Literal Object ( [label] => Department of Information and Knowledge Engineering [lang] => en [dtype] => ) [?nameCs] => Literal Object ( [label] => Katedra informačního a znalostního inženýrství [lang] => cs [dtype] => ) ) ) If we used e.g. Virtuoso SPARQL query engine service, we have got both resources: http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fkeg.vse.cz%2Fdemo-groups.rdf&should-sponge=soft&query=PREFIX+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0ASELECT+%3Fgroup+%3FnameEn+%3FnameCs%0D%0AWHERE+%7B%0D%0A%09%3Fgroup+rdf%3Atype+foaf%3AGroup+.%09%0D%0A%09%3Fgroup+foaf%3Aname+%3FnameEn+.%0D%0A%09OPTIONAL+%7B+%3Fgroup+foaf%3Aname+%3FnameCs+.+FILTER+%28lang%28%3FnameCs%29+%3D+%22cs%22%29+%7D%0D%0A%09FILTER+%28lang%28%3FnameEn%29+%3D+%22en%22%29%0D%0A%7D&format=text%2Fhtml&debug=on It might be a bug in RAP's SPARQL engine. Best regards Josef Petrak |