Pular para o conteúdo principal

RDF e Reificação

Reification is mechanism for adding properties to RDF graph edges, thus making them directly translatable to property graphs. Reification: break down any structured data into triples, without loss of information. N-ary relations

Reificação em RDF para suportar atributos nas arestas como por exemplo dados de proveniência. Uso de nós brancos. Reificação: incluir outras propriedades para a tripla

rdf:Statement
rdf:subject
rdf:predicate
rdf:object

Reificação também se aplica a LPG para relações n-árias assim como em RDF. Reduzir relacionamentos n-ários a n relacionamentos binários (coleção, reificação).

The RDF* and SPARQL* Approach to Annotate Statements in RDF: Although this is possible, up to now there has not been one standard, agreed upon way to do this. RDF* is a proposal on how to do this, introduced in 2014, which is getting traction in the RDF world.

Relação ternária
============

Professor X ministra a disciplina Y para a turma Z

1 X - é um -> Professor
2 Y - é um -> Disciplina
3 Z - é uma -> Turma
4 X - ministra -> Y
5 Y - é ministrada para -> Z

Id    node1        label                        node2
1     X                é um                        Professor
2     Y                é um                        Disciplina
3     Z                é uma                        Turma
4     X                ministra                    Y
5     Y                é ministrada para        Z

1 X - é um -> Professor
2 Z - é uma -> Turma
3 Y - é um -> Disciplina
4 X - ministra -> Y - para -> Z

Id    node1        label                node2
1     X            é um                Professor
2     Z            é uma                Turma
3     Y            é um                Disciplina
4     X            ministra            Y
5    4            para                Z

Id    node1        label                node2
1     X            é um                Professor
2     Z            é uma                Turma
3     Y            é um                Disciplina
4     ST            é um                RDF Statement
5     ST            sujeito            X
6    ST            objeto            Y
7    ST            predicado         ministra
8    ST            para                Z

Standard Reification

Welles  name       "Orson Welles" .
 Welles  mentioned  Kubrick .
 Kubrick  name    "Stanley Kubrick" .
 Kubrick  influencedBy  Welles .
s significance 0.8 .
s rdf:type rdf:Statement .
s rdf:subject Kubrick .
s rdf:predicate influencedBy .
s rdf:object Welles .

Single-Triple Named Graphs

g1 { Kubrick influencedBy Welles }
g1 significance 0.8 .

Singleton Properties

Kubrick influencedBy Welles .
Kubrick p1 Welles .
p1 singletonPropertyOf influencedBy .
p1 significance 0.8 .

Fonte: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4350149/

KGTK

kgtk unreify-rdf-statements -i graph-reification.tsv -o graph-unreification-statement.tsv -v

Opening the input file: graph-reification.tsv
KgtkReader: File_path.suffix: .tsv
KgtkReader: reading file graph-reification.tsv
header: node1   label   node2   id
input format: kgtk
KgtkReader: Special columns: node1=0 label=1 node2=2 id=3
KgtkReader: Reading an edge file.
Opening the output file: graph-unreification-statement.tsv
File_path.suffix: .tsv
KgtkWriter: writing file graph-unreification-statement.tsv
header: node1   label   node2   id
Reading and grouping the input records.
Processing the input records.
Processed 15 records in 5 groups.
Unreified 1 groups.
Wrote 12 output records

Entrada

node1    label    node2    id
Welles    name    "Orson Welles"    E1
Welles    mentioned    Kubrick    E2
Kubrick    name    "Stanley Kubrick"    E3
Kubrick    influencedBy    Welles    E4
s    significance    0.8    E5
s    rdf:type    rdf:Statement    E6
s    rdf:subject    Kubrick    E7
s    rdf:predicate    influencedBy    E8
s    rdf:object    Welles    E9

Kubrick    influencedBy    Welles    G1
G1    significance    0.8    E10
Kubrick    influencedBy    Welles    E11
Kubrick    p1    Welles    E12
p1    singletonPropertyOf    influencedBy    E13
p1    significance    0.8    E14

Saída

node1    label    node2    id
G1    significance    0.8    E10
Kubrick    name    "Stanley Kubrick"    E3
Kubrick    influencedBy    Welles    E4
Kubrick    influencedBy    Welles    G1
Kubrick    influencedBy    Welles    E11
Kubrick    p1    Welles    E12
Welles    name    "Orson Welles"    E1
Welles    mentioned    Kubrick    E2
p1    singletonPropertyOf    influencedBy    E13
p1    significance    0.8    E14
Kubrick    influencedBy    Welles    s
s    significance    0.8    s-1

Não consegui usar o unreify values pq não entendi bem que tipo de reificação é essa

unreify-values -i graph-reification.tsv -o graph-unreification-values.tsv ....

Reificação da Wikidata para representação em RDF
=====================================

Na International Semantic Web Conference (ISWC) de 2015 um artigo comparativo com 4 abordagens de reificação dos dados da Wikidata

  • standard reification (sr) whereby an RDF resource is used to denote the triple itself, denoting its subject, predicate and object as attributes and allowing additional meta-information to be added.
  • n-ary relations (nr) whereby an intermediate resource is used to denote the relationship, allowing it to be annotated with meta-information.
  • singleton properties (sp) whereby a predicate unique to the statement is created, which can be linked to the high-level predicate indicating the relationship, and onto which can be added additional meta-information.
  • Named Graphs (ng) whereby triples (or sets thereof) can be identified in a fourth field using, e.g., an IRI, onto which meta-information is added

e em cinco Graph Databases: 4store, BlazeGraph, GraphDB, Jena TDB, Virtuoso.

Hernández, D., A. Hogan and M. Krötzsch. “Reifying RDF: What Works Well With Wikidata?” SSWS@ISWC (2015).


Comentários

Postagens mais visitadas deste blog

Connected Papers: Uma abordagem alternativa para revisão da literatura

Durante um projeto de pesquisa podemos encontrar um artigo que nos identificamos em termos de problema de pesquisa e também de solução. Então surge a vontade de saber como essa área de pesquisa se desenvolveu até chegar a esse ponto ou quais desdobramentos ocorreram a partir dessa solução proposta para identificar o estado da arte nesse tema. Podemos seguir duas abordagens:  realizar uma revisão sistemática usando palavras chaves que melhor caracterizam o tema em bibliotecas digitais de referência para encontrar artigos relacionados ou realizar snowballing ancorado nesse artigo que identificamos previamente, explorando os artigos citados (backward) ou os artigos que o citam (forward)  Mas a ferramenta Connected Papers propõe uma abordagem alternativa para essa busca. O problema inicial é dado um artigo de interesse, precisamos encontrar outros artigos relacionados de "certa forma". Find different methods and approaches to the same subject Track down the state of the art rese...

Knowledge Graphs as a source of trust for LLM-powered enterprise question answering - Leitura de Artigo

J. Sequeda, D. Allemang and B. Jacob, Knowledge Graphs as a source of trust for LLM-powered enterprise question answering, Web Semantics: Science, Services and Agents on the World Wide Web (2025), doi: https://doi.org/10.1016/j.websem.2024.100858. 1. Introduction These question answering systems that enable to chat with your structured data hold tremendous potential for transforming the way self service and data-driven decision making is executed within enterprises. Self service and data-driven decision making in organizations today is largly made through Business Intelligence (BI) and analytics reporting. Data teams gather the original data, integrate the data, build a SQL data warehouse (i.e. star schemas), and create BI dashboards and reports that are then used by business users and analysts to answer specific questions (i.e. metrics, KPIs) and make decisions. The bottleneck of this approach is that business users are only able to answer questions given the views of existing dashboa...

Knowledge Graph Toolkit (KGTK)

https://kgtk.readthedocs.io/en/latest/ KGTK represents KGs using TSV files with 4 columns labeled id, node1, label and node2. The id column is a symbol representing an identifier of an edge, corresponding to the orange circles in the diagram above. node1 represents the source of the edge, node2 represents the destination of the edge, and label represents the relation between node1 and node2. >> Quad do RDF, definir cada tripla como um grafo   KGTK defines knowledge graphs (or more generally any attributed graph or hypergraph ) as a set of nodes and a set of edges between those nodes. KGTK represents everything of meaning via an edge. Edges themselves can be attributed by having edges asserted about them, thus, KGTK can in fact represent arbitrary hypergraphs. KGTK intentionally does not distinguish attributes or qualifiers on nodes and edges from full-fledged edges, tools operating on KGTK graphs can instead interpret edges differently if they so desire. In KGTK, e...