Pular para o conteúdo principal

WD support for trust - feed back Pitts

 Thanks so much for sharing this, Daniel.  I found the discussion of how more rigorous use of qualifiers could aid trust very interesting. I also thought the Israel/Palestine and Crimea examples of disputed cases were illustrative and clarifying, as was the table displaying the frequency of disputed subjects (interesting it was so common for the creation of fictional characters). 

In broad strokes, we are using wikidata to collect information about ethnic  groups (and to a lesser extent, political parties and armed groups) in Sub-Saharan Africa.  As we were familiarizing ourselves on the way group data is stored on wikidata, we noticed some challenges with the different entries for Irish Republican Army with respect to start date and end date (and in theory, members of IRA splinter groups which are still active or have been active since 2005 might reasonably challenge any of these end dates).  The q nodes which are relevant for this include:  Q504628, Q175284, Q3015384, Q3084968.  None of these start date/end date qualifiers are necessarily wrong, but they do fail to help the researcher understand the continuity between these identities and a user without background information might find one of these pages and arrive at an incomplete time frame.  This becomes tricky if one hopes to use WD for an area in which one lacks contextual understanding!

"Disputed" qualifiers for ethnic groups may be of particular interest as ethnic group origin (or interrelationship between groups) can often become contested, especially in the context of territorial claims or irredentism-- but many ethnic groups may lack community members with the resources or inclination to initiate WD disputes. 

Here is a sample of some of the Qnodes of interest to us, a list of ethnic groups in Nigeria:  'Q190168', 'Q244157', 'Q572665', 'Q528981', 'Q7079875', 'Q1235705', 'Q239577', 'Q33454', 'Q1287326'..  We basically arrive at our Qnodes of interest by identifying proper nouns which appear in US State Department human rights reports and finding the corresponding Qnode.   For instance, I arrived at the Qnodes listed in this paragraph through the following python script.  The list of search terms comes from the State dept human rights reports. 

import requests
import json

search_terms = ["Yoruba people", "Igbo people", "Kanuri people", "Ijaw people", "Ogbe tribe", "Tiv people", "Ibibio people", "Fulani", "Edo people"]
group_ids = []

for search_term in search_terms:
    response = requests.get("https://www.wikidata.org/w/api.php", params={
        "action": "wbsearchentities",
        "format": "json",
        "language": "en",
        "type": "item",
        "limit": "1",
        "search": search_term
    })
    data = response.json()
   
    if len(data["search"]) > 0:
        group_id = data["search"][0]["id"]
        group_ids.append(group_id)
    else:
        print(f"No results found for search term: {search_term}")

The fields on those pages which are of interest include:  alsoKnownAs, instanceOf, nativeLanguage, country, locatedIn, religionOrWorldview, hasParts. 
  
I haven't arrived at a way to identify the useful Pnodes for our project yet, but if you have any suggestions, I am all ears. 

===========================================================================

Sobre os QNodes do Ira

No QNode Irish Republican Army (Q175284) temos a indicação de uma violação de constraint UNIQUE em relação ao QNode Irish Republican Army (Q3084968). Neste último também temos a violação em relação a constraint INVERSE ao relação ao QNode Category:Irish Republican Army (Q8554003).




Entre os QNodes Irish Republican Army (Q3015384) e Irish Republican Army (Q3084968) existe uma relação INVERSA representadas pelos PNodes replaced by (P1366) e replaces (P1365). Estes PNodes possuem a constraint INVERSE definida e a relação traz a semântica de ordem cronológica (contexto temporal).



O QNode Provisional Irish Republican Army (Q504628) possui um statement com a data de fundação (inception (P571) ) mas não com a dissolução. 


Enquanto o QNode Irish Republican Army (Q3084968) possui tanto a data de fundação quanto a de dissolução (dissolved, abolished or demolished date (P576))



Já o QNode Irish Republican Army (Q3015384) possui a data de fundação e a data de fim (utilizando outro PNode - end time (P582)

O QNode Provisional Irish Republican Army (Q504628) é o único que o contexto temporal está associado aos qualificadores data de início e data de fim para diferenciar os valores múltiplos para os statements Instance of (P31)

Selecionei com o kgtk os nós (sujeito e objeto) que envolvem estes QNodes

kgtk filter -i /app/kgtk/data/wikidata/claims.tsv.gz -p ' ; ; Q504628, Q175284, Q3015384, Q3084968 ' -o /app/kgtk/data/IRA-object.tsv

kgtk filter -i /app/kgtk/data/wikidata/claims.tsv.gz -p ' Q504628, Q175284, Q3015384, Q3084968 ; ; ' -o /app/kgtk/data/IRA-subject.tsv

E também os QNodes dos grupos étcnicos

kgtk filter -i /app/kgtk/data/wikidata/claims.tsv.gz -p ' ; ; Q190168, Q244157, Q572665, Q528981, Q7079875, Q1235705, Q239577, Q33454, Q1287326 ' -o /app/kgtk/data/Nigeria-object.tsv

kgtk filter -i /app/kgtk/data/wikidata/claims.tsv.gz -p ' Q190168, Q244157, Q572665, Q528981, Q7079875, Q1235705, Q239577, Q33454, Q1287326 ; ; ' -o /app/kgtk/data/Nigeria-subject.tsv

Depois para ambos os datasets eu adicionei os labels do node1, node2 e do PNode e ao final gerei o html de visualização com o kgtk. Mas o resultado da visualização não ficou bom. 

kgtk cat -i /app/kgtk/data/Nigeria-object.tsv /app/kgtk/data/Nigeria-subject.tsv \
     -o /app/kgtk/data/Nigeria-all.tsv
kgtk join --left-join \
     --left-file /app/kgtk/data/Nigeria-all.tsv \
     --right-file /app/kgtk/data/wikidata/labels.en.tsv.gz \
     -o /app/kgtk/data/Nigeria-label-node1.tsv
kgtk join --left-join \
     --left-file /app/kgtk/data/Nigeria-label-node1.tsv \
     --right-file /app/kgtk/data/wikidata/labels.en.tsv.gz \
     --left-file-join-columns node2 --right-file-join-columns node1 \
     -o /app/kgtk/data/Nigeria-label-node1-node2.tsv
kgtk join --left-join \
     --left-file /app/kgtk/data/Nigeria-label-node1-node2.tsv \
     --right-file /app/kgtk/data/wikidata/labels.en.tsv.gz \
     --left-file-join-columns label --right-file-join-columns node1 \
     -o /app/kgtk/data/Nigeria-all-labels.tsv        
kgtk lift -i /app/kgtk/data/Nigeria-all-labels.tsv -o /app/kgtk/data/Nigeria-final.tsv
               
kgtk visualize-graph -i /app/kgtk/data/Nigeria-final.tsv --show-edge-label --show-text above -o /app/kgtk/data/Nigeria.html

kgtk cat -i /app/kgtk/data/IRA-object.tsv /app/kgtk/data/IRA-subject.tsv \
     -o /app/kgtk/data/IRA-all.tsv
kgtk join --left-join \
     --left-file /app/kgtk/data/IRA-all.tsv \
     --right-file /app/kgtk/data/wikidata/labels.en.tsv.gz \
     -o /app/kgtk/data/IRA-label-node1.tsv
kgtk join --left-join \
     --left-file /app/kgtk/data/IRA-label-node1.tsv \
     --right-file /app/kgtk/data/wikidata/labels.en.tsv.gz \
     --left-file-join-columns node2 --right-file-join-columns node1 \
     -o /app/kgtk/data/IRA-label-node1-node2.tsv
kgtk join --left-join \
     --left-file /app/kgtk/data/IRA-label-node1-node2.tsv \
     --right-file /app/kgtk/data/wikidata/labels.en.tsv.gz \
     --left-file-join-columns label --right-file-join-columns node1 \
     -o /app/kgtk/data/IRA-all-labels.tsv        
kgtk lift -i /app/kgtk/data/IRA-all-labels.tsv --show-text above -o /app/kgtk/data/IRA-final.tsv

kgtk visualize-graph -i /app/kgtk/data/IRA-final.tsv --show-edge-label --show-text above -o /app/kgtk/data/IRA.html

Carreguei o dataset do IRA no Neo4J, a visualização é interessante mas não consigo exportar como html ou uma imagem interativa. 

Não agreguei os qualificadores pq nestas opções de visualização não iram ser carregados.

Comentários

Postagens mais visitadas deste blog

Aula 12: WordNet | Introdução à Linguagem de Programação Python *** com NLTK

 Fonte -> https://youtu.be/0OCq31jQ9E4 A WordNet do Brasil -> http://www.nilc.icmc.usp.br/wordnetbr/ NLTK  synsets = dada uma palavra acha todos os significados, pode informar a língua e a classe gramatical da palavra (substantivo, verbo, advérbio) from nltk.corpus import wordnet as wn wordnet.synset(xxxxxx).definition() = descrição do significado É possível extrair hipernimia, hiponimia, antonimos e os lemas (diferentes palavras/expressões com o mesmo significado) formando uma REDE LEXICAL. Com isso é possível calcular a distância entre 2 synset dentro do grafo.  Veja trecho de código abaixo: texto = 'útil' print('NOUN:', wordnet.synsets(texto, lang='por', pos=wordnet.NOUN)) texto = 'útil' print('ADJ:', wordnet.synsets(texto, lang='por', pos=wordnet.ADJ)) print(wordnet.synset('handy.s.01').definition()) texto = 'computador' for synset in wn.synsets(texto, lang='por', pos=wn.NOUN):     print('DEF:',s

truth makers AND truth bearers - Palestra Giancarlo no SBBD

Dando uma googada https://iep.utm.edu/truth/ There are two commonly accepted constraints on truth and falsehood:     Every proposition is true or false.         [Law of the Excluded Middle.]     No proposition is both true and false.         [Law of Non-contradiction.] What is the difference between a truth-maker and a truth bearer? Truth-bearers are either true or false; truth-makers are not since, not being representations, they cannot be said to be true, nor can they be said to be false . That's a second difference. Truth-bearers are 'bipolar,' either true or false; truth-makers are 'unipolar': all of them obtain. What are considered truth bearers?   A variety of truth bearers are considered – statements, beliefs, claims, assumptions, hypotheses, propositions, sentences, and utterances . When I speak of a fact . . . I mean the kind of thing that makes a proposition true or false. (Russell, 1972, p. 36.) “Truthmaker theories” hold that in order for any truthbe

DGL-KE : Deep Graph Library (DGL)

Fonte: https://towardsdatascience.com/introduction-to-knowledge-graph-embedding-with-dgl-ke-77ace6fb60ef Amazon recently launched DGL-KE, a software package that simplifies this process with simple command-line scripts. With DGL-KE , users can generate embeddings for very large graphs 2–5x faster than competing techniques. DGL-KE provides users the flexibility to select models used to generate embeddings and optimize performance by configuring hardware, data sampling parameters, and the loss function. To use this package effectively, however, it is important to understand how embeddings work and the optimizations available to compute them. This two-part blog series is designed to provide this information and get you ready to start taking advantage of DGL-KE . Finally, another class of graphs that is especially important for knowledge graphs are multigraphs . These are graphs that can have multiple (directed) edges between the same pair of nodes and can also contain loops. The