Hello Eddy,

> 1. A simple SPARQL select query:
> I've been running similar to the next query, in hundreds of variants
> (with parameters) but I don't get a reply in Virtuoso:
> 
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> SELECT ?s ?p ?pl ?o
> where {
> <#SdnEntry_2786786> ?p ?o .
> ?p rdfs:label ?pl .
> }

?s is unbound (because it is not used at all) and not optional at the
same time, resulting in empty result set. Either remove ?s from SELECT
result set list or write something like

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?s ?p ?pl ?o
where {
?s ?p ?o .
?p rdfs:label ?pl .
. filter (?s = <#SdnEntry_2786786>)
}

> When I make the union:
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> SELECT ?s ?p ?pl ?o
> where {
> {<#SdnEntry_2786786> ?p ?o}
> UNION
> {?p rdfs:label ?pl}
> }
> I get the pairs property/value and property/label separately.
> So, I can't filter the result neither.

Yes, you have a "concatenation" of all properties of <#SdnEntry_2786786>
and all labels of all properties. These two branches of UNION are
totally independent from each other. That's probably not what you want.

Best Regards,

Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com



Reply via email to