PREFIX sioc: <http://rdfs.org/sioc/ns#> PREFIX sioct: <http://rdfs.org/sioc/types#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT DISTINCT ?icq, ?yid, ?post WHERE { ?forum a sioct:ImageGallery . ?forum sioc:container_of ?post. optional { ?post foaf:maker ?maker }. optional { ?maker foaf:icqChatID ?icq } . optional { ?maker foaf:yahooChatID ?yid } . }