D2RQ's Fastpath query implementation is able to translate a basic graph pattern (a set of triples that may contain variables) into a single SQL expression.