import requests
import numpy as np
import rdflib


def get_corpus_analysis_graphs(corpus_id):
    corpusgraph_id = 'corpusgraph:' + corpus_id[7:]
    termsgraph_id = corpusgraph_id + ':extractedTerms'
    cpt_occur_graph_id = corpusgraph_id + ':conceptOccurrences'
    cooc_graph = corpusgraph_id + ':cooccurrence'
    return corpusgraph_id, termsgraph_id, cpt_occur_graph_id, cooc_graph


def get_corpus_zscores(term_uris, cooc_corpus_graph):
    """
    Get zscores for term-term cooccurrences.

    :param term_uris: list: uris of 2 terms
    :param cooc_corpus_graph: graph of corpus coocs
    :return: float [0, 1]: similarity score := zscore/max(zscore)
    """
    def similarity(term1_uri, term2_uri):
        if term1_uri == term2_uri: