Skip to main content

A Python interface to the ToposKG knowledge graph generation pipeline.

Project description

toposkg-lib

A Python library for Knowledge Graph customization and expansion.

Overview

toposkg-lib is a Python library developed as part of the Topos framework. It provides easy access to powerful functionality for customizing and extending ToposKG but is also compatible with arbitrary source files.

Highlights

  • Powerful features. Customize and expand ToposKG using powerful tools for geospatial interlinking, toponym translation and entity linking.
  • Ease of use. toposkg-lib is designed around a simple builder pattern, simplifying the process of generating your Knowledge Graph.
  • Natural Language Interface. toposkg-lib can be used with a textual interface, powered by LLM function calling.
  • Active development. toposkg-lib will keep getting updates as we work on our projects.

Getting Started

pip

We recommend using toposkg-lib through pip.

pip install toposkg

If you want to include the translation functionality.

pip install toposkg[tl]

If you want to include the function calling functionality.

pip install toposkg[fc]

You must also install this custom version of RDF-lib before using toposkg-lib.

pip install git+https://github.com/SKefalidis/rdflib-speed@main

Simple example

from toposkg.toposkg_lib_core import KnowledgeGraphBlueprintBuilder, KnowledgeGraphSourcesManager

# Create a KnowledgeGraphSourcesManager object to load the available data sources and their metadata
sources_manager = KnowledgeGraphSourcesManager(['PATH_TO_YOUR_SOURCES'])

# See the available data sources
sources_manager.print_available_data_sources()

# Create a KnowledgeGraphBlueprintBuilder object to build the knowledge graph blueprint
builder = KnowledgeGraphBlueprintBuilder()

builder.set_name("ToposKG.nt")
builder.set_output_dir("/home/example/")

builder.add_source_path("PATH_TO_KG_SOURCE_1") # relative or absolute path
builder.add_source_path("PATH_TO_KG_SOURCE_2")

# Use the blueprint to construct the knowledge graph
blueprint = builder.build()
blueprint.construct()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toposkg-0.1.3.tar.gz (65.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toposkg-0.1.3-py3-none-any.whl (65.5 MB view details)

Uploaded Python 3

File details

Details for the file toposkg-0.1.3.tar.gz.

File metadata

  • Download URL: toposkg-0.1.3.tar.gz
  • Upload date:
  • Size: 65.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for toposkg-0.1.3.tar.gz
Algorithm Hash digest
SHA256 80f250cbb8a791a3aaeb23e068d09fa18dd263e6dbe94cfff22f46ca352eecd2
MD5 afeb29b74b5e1f1009cc2f3afc7ec7d3
BLAKE2b-256 d37fc4db5562febff43e47735f6cc974c02b3dc9a009c94cfeaf044f4917537d

See more details on using hashes here.

File details

Details for the file toposkg-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: toposkg-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 65.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for toposkg-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 90eeb5f144e2069c412d38c607f058870d6ea22ecb16894eb95c6a06b4770e02
MD5 bac581c18fe6bb15eab9679e498e10cd
BLAKE2b-256 20cf5f1b26267b82d0eb5fffb5d6d9cdcd3479c5009d05a924cfb20190d900f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page