CONSTRUCT { ?topic . } WHERE { ?topic a ?t . OPTIONAL { ?topic ?scheme } FILTER ( ! bound( ?scheme ) && regex ( str ( ?topic ), "http://www.openvocabulary.info/thesauri/ot/pl/(.+)", "" ) ) }