-1

The situation

While reading the Bible (as context) I'd like to point out certain dependencies e.g. of people and locations. Due to swift expandability I'm choosing Python to handle this versatile data. Currently I'm creating many feature vectors independent from each other, containing various information as the database.

In the end I'd like to type in a keyword to search in this whole database, which shall return everything that is in touch with it. Something simple as

results = database(key)

What I'm looking for

  • Unfortunately I'm not a Pro about different database handling possibilities and I hope you can help me finding an appropriate option.
  • Are there possibilities that can be used out of the box or do I need to create all logic by myself?
user3085931
  • 1,757
  • 4
  • 29
  • 55

1 Answers1

2

This is a little vague so I'll try to handle the People and Location bit of it to help you get started.

One possibility is to build a SQLite database. (The sqlite3 library + documentation is relatively friendly). Also here's a nice tutorial on getting started with SQLite.

To start, you can create two entity tables:

  • People: contains details about every person in bible.
  • Locations: contains details about every location in bible.

You can then create two relationship tables that reference people and locations (as Foreign Keys). For example, one of these relationship tables might be

  • People_Visited_Locations: contains information about where each person visited in their lifetime. The schema might looks something like this:
| person (Foreign Key)| location (Foreign Key) | year |

Remember that Foreign Key refers to an entry in another table. In our case, person is an existing unique ID from your entity table People, location is an existing unique ID from your entity table Locations, and year could be the year that person went to that location.

Then to fetch every place that some person, say Adam in the bible visited, you can create a Select statement that returns all entries in People_Visited_Locations with Adam as person.

I think key (pun intended) takeaway is how Relationship tables can help you map relationships between entities.

Hope this helps get you started :)

cisco
  • 802
  • 9
  • 12