Ejemplo n.º 1
0
def update():
    subject = request.args.get('subject')

    if subject is None:
        utils.save_update_start_time()

        clusters = cluster.update_clusters()
        utils.save_clusters(clusters)
        
        
        uri2rank = pagerank.update_pagerank()
        utils.save_uri2rank(uri2rank)

        index.update_index(utils.get_uri2rank())
        
        query.memoized_query_sparql.cache_clear()
        utils.log('Cache cleared')

        utils.save_update_end_time()
        success_message = 'Successfully updated entire index'
    else:
        index.refresh_index(subject, utils.get_uri2rank())
        success_message = 'Successfully refreshed: ' + subject

    utils.log(success_message)
    return success_message
Ejemplo n.º 2
0
def sparql_search_endpoint():
    sparql_query = request.args.get('query')

    response = jsonify(search.search(sparql_query, utils.get_uri2rank(), utils.get_clusters()))

    print('Successfully searched')
    return response
Ejemplo n.º 3
0
def incremental_update():
    updates = request.get_json()

    index.incremental_update(updates, utils.get_uri2rank())

    success_message = 'Successfully incrementally updated parts'
    print(success_message)
    return success_message