OCL2PSQL is an open source library that parses an OCL expression and translate it into a pure SQL select statement.