The query
SELECT ?x {
  ?x a <urn:test:A> .
  OPTIONAL {  ?x a ?bar .  }
  FILTER (!bound(?x) || sameTerm(?bar, <urn:test:A>))
}

Sorry, I made a typo. Change !bound(?x) to !bound(?bar).

Thanks, I found that, its pretty nice and general. But is there a SPARQL wiki
page also?

Not that I know of... you might look on the ESW wiki.

Reply via email to