Skip to main content

TopicDB is a topic map-based graph (NoSQL) database

Project description

TopicDB is a topic map-based graph (NoSQL) database.

http://www.storytechnologies.com/wp-content/uploads/2016/12/topic-db-logo.png

For a more in-depth introduction to topic maps, I recommend reading the excellent introductory article on topic maps over at MSDN: An Introduction to Topic Maps. With that being said, although TopicDB is inspired by the topic maps paradigm, it is not (and never will be) an implementation of the ISO/IEC 13250 Topic Maps data model standard.

TopicDB is intended to be used by other Python applications, and currently does not provide a web interface to the API. Story Engine is a good example of TopicDB being used by another application.

Why?

I build (story) worlds. TopicDB plays a crucial role in that endeavour: Interactive Scene Browser for Stories.

Feature Support

  • Pending

Installation

TopicDB officially supports Python 3.3–3.6. To install TopicDB, simply:

$ pip install topic-db

First-Time Use

import os

from topicdb.core.commands.topic.gettopic import GetTopic
from topicdb.core.commands.topicmap.gettopicmap import GetTopicMap
from topicdb.core.commands.topicmap.settopicmap import SetTopicMap


DATABASE_PATH = os.path.join(os.path.dirname(__file__), 'test-topicmap.db')
TOPIC_MAP_IDENTIFIER = 1
TITLE = 'Topic Map'
DESCRIPTION = 'Default topic map'

print('Creating and initializing topic map')
SetTopicMap(DATABASE_PATH, TOPIC_MAP_IDENTIFIER, TITLE, DESCRIPTION).execute()

# Rest of the code is for testing purposes (e.g., to verify that the topic map has been created
# and that the 'entry' topic can be retrieved.
print("\nGetting topic map")
topic_map = GetTopicMap(DATABASE_PATH, TOPIC_MAP_IDENTIFIER).execute()

print("Map identifier: [{0}]".format(topic_map.identifier))
print("Map title: [{0}]".format(topic_map.title))
print("Map description: [{0}]".format(topic_map.description))
print("Map entry topic: [{0}]".format(topic_map.entry_topic_identifier))

print("\nGetting entry topic")
topic = GetTopic(DATABASE_PATH, TOPIC_MAP_IDENTIFIER, 'genesis').execute()

print("Topic identifier: [{0}]".format(topic.identifier))
print("Topic 'instance of': [{0}]".format(topic.instance_of))
print("Topic (base) name: [{0}]".format(topic.first_base_name.name))

Tutorial

To get a better understanding of how to use TopicDB, check out the tutorial, here: TopicDB Tutorial.

Documentation

Documentation will be available soon.

How to Contribute

  1. Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).

  2. Write a test which shows that the bug was fixed or that the feature works as expected.

  3. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS.

Release History

0.5.0 (2017-01-15)

Improvements

  • Refactored Get* command classes (i.e., instance_of, scope, and language parameters) for the purposes of consistency and flexibility.

  • Removed hard-code maximum-depth in GetTopicsHierarchy command class.

  • Renamed several command classes to more accurately reflect their purpose.

  • Refactored code to ensure better compliance with PEP 8 (Style Guide for Python Code).

Bugs

  • Fixed several command classes with regards to not closing SQLite cursor objects.

0.4.0 (2017-01-08)

Improvements

  • Renamed GetAssociations command class to GetTopicAssociations.

  • Refactored topic map-related commands and models, including changes to the topic map definition (SQL).

  • Renamed several (important) variables for the purpose of improving clarity and consistency.

0.3.0 (2016-12-30)

Improvements

  • Added functionality to delete associations (i.e., DeleteAssociation command class).

0.2.0 (2016-12-28)

Improvements

  • Provided OntologyMode (either STRICT or LENIENT).

  • Sanitized backing store (SQLite) indexes.

0.1.1 (2016-12-26)

Miscellaneous

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

topic-db-0.5.0.tar.gz (19.1 kB view hashes)

Uploaded Source

Built Distribution

topic_db-0.5.0-py3-none-any.whl (52.3 kB view hashes)

Uploaded Python 3

Supported by

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