def test_mql_stress(self): seed("playadito vs amanda... 3 focas") for _ in xrange(100): expression = random_expression() target, mql = generate_mql(expression) self._valid_mql_query(mql) self._valid_target_for_query(target, mql)
def get_code_(expression, language): if language == "sparql": return expression_to_sparql(expression) elif language == "sql": return expression_to_sql(expression) elif language == "dot": return expression_to_dot(expression) elif language == "mql": return generate_mql(expression) else: message = u"Language '{}' is not supported" raise ValueError(message.format(language))
def get_code(expression, language): """ Given an expression and a supported language, it returns the query for that expression on that language. """ if language == "sparql": return expression_to_sparql(expression) elif language == "dot": return expression_to_dot(expression) elif language == "mql": return generate_mql(expression) else: message = u"Language '{}' is not supported" raise ValueError(message.format(language))
def get_code(expression, language): """ Given an expression and a supported language, it returns the query for that expression on that language. """ if language == "sparql": return expression_to_sparql(expression, True) #add True for all information elif language == "dot": return expression_to_dot(expression) elif language == "mql": return generate_mql(expression) else: message = u"Language '{}' is not supported" raise ValueError(message.format(language))