Beispiel #1
0
def insertConcept(term, desc, ctxt):
    if ctxt != "thing":
        for hc in ctxt:
            limit = len(hc) - 1
            hc = hc[1:limit]
            aux_actions_db.update_BD(
                """INSERT INTO tb_conceito (termo,contexto)
										VALUES ('""" + term + """','""" + hc + """');""")
Beispiel #2
0
def insertRelation(term, dictRel):
    for key in dictRel:
        itens = dictRel[key]
        itens = itens.split(", ")
        for item in itens:
            limit = len(item) - 1
            item = item[1:limit]
            ids = getTermId(term)
            for id in ids:
                aux_actions_db.update_BD(
                    """INSERT INTO tb_relacao_semantica (id_conceito_principal,id_conceito_secundario,relacao)
										VALUES ('""" + str(id[0]) + """
										','""" + str(getTermId(item)[0][0]) + """','""" + str(key) +
                    """');""")
Beispiel #3
0
def insertConceptDoc(conceptId):
    docId = getDocumentId(file)[0][0]
    aux_actions_db.update_BD(
        """INSERT INTO tb_conceito_documento (id_conceito,id_documento)
								VALUES ('""" + str(conceptId) + """','""" + str(docId) + """');""")
Beispiel #4
0
def insertDocument():
    aux_actions_db.update_BD("""INSERT INTO tb_documento (nome) VALUES ('""" +
                             str(file) + """');""")
Beispiel #5
0
def addConcept(term, query):
    query_add = """INSERT INTO tb_conceito (termo,contexto) VALUES ('""" + term + """','thing');"""
    aux_actions_db.update_BD(query_add)
    termId = aux_actions_db.consulta_BD(query)
    insertConceptDoc(termId[0][0])
    return termId