Skip to content
/ kif Public

A Wikidata-based framework for integrating knowledge sources

License

Notifications You must be signed in to change notification settings

IBM/kif

Repository files navigation

KIF — Knowledge Integration Framework

KIF is a knowledge integration framework from IBM Research.

KIF is based on Wikidata and it's licensed under the Apache-2.0 license.

First time here? Check out the quickstart guide.

Highlights

  • KIF can be seen as a Python interface to query Wikidata (RDF).

  • KIF queries are written in the KIF pattern language, which is based on Wikidata's data model.

  • KIF can be used to query knowledge sources other than Wikidata, provided proper SPARQL mappings are given.

  • KIF comes with built-in mappings for DBpedia and PubChem RDF. Other mappings can be added programmatically.

Hello world!

Prints an arbitrary statement from Wikidata:

from kif_lib import *
from kif_lib.compiler.sparql.mapping.wikidata import WikidataMapping
kb = Store('sparql2', 'https://query.wikidata.org/sparql', WikidataMapping())
print(next(kb.filter()))

Prints an arbitrary Wikidata-like statement from DBpedia:

from kif_lib import *
from kif_lib.compiler.sparql.mapping.dbpedia import DBpediaMapping
kb = Store('sparql2', 'https://dbpedia.org/sparql', DBpediaMapping())
print(next(kb.filter()))

Installation

$ pip install kif-lib

Documentation

See documentation and examples.

Citation

Guilherme Lima, João M. B. Rodrigues, Marcelo Machado, Elton Soares, Sandro R. Fiorini, Raphael Thiago, Leonardo G. Azevedo, Viviane T. da Silva, Renato Cerqueira. "KIF: A Wikidata-Based Framework for Integrating Heterogeneous Knowledge Sources", arXiv:2403.10304, 2024.

License

Released under the Apache-2.0 license.