예제 #1
0
def getModelRDB():
    if request.method == 'POST':
        validation_error = validate_sql(request)
        if validation_error is not None:
            return validation_error

        # Test if client accepts the response content-type: application/json
        if 'Accept' not in request.headers.keys():
            return error(400, "Client must accept content-type application/json")

        if 'application/json' not in request.headers['ACCEPT']:
            return error(400, "Client must accept content-type application/json in addition to {0}".format(request.headers['Accept']))

        # FIXME: returning mocked results
        mocked_response = json.load(open('examples/response_catalogue_getModelRDB.json'))
        return jsonify(mocked_response)
예제 #2
0
def generateTriples():
    if request.method == 'GET':
        model_id = request.args.get('model_id', None)
        if model_id is None:
            return error(400, "Parameter model_id must is mandatory")

        # TODO: generate Triples here

        return Response(status=200)