Created by Steven Frank firstname.lastname@example.org August 5, 2014
This is a rough and early implementation of an idea I had for producing a wiki-like site from a simply structured database of records with freeform key/value pairs.
Conceptually, it’s similar to a relational database, except each record can have any number of fields, and they do not have to be the same fields from record to record. You can even repeat fields on a single record. (Say, for a example if you have a record of a person who has been married multiple times, you could just repeat the “Spouse” property on that record.)
Like a wiki, you do not have to worry about manually creating links between records. Those will be discovered for you automatically based on properties and property values.
You can view a sample installation (without the editing features) at:
Entities and properties
Objects in the database are known as "entities". An entity could be a person, place, thing, event -- pretty much anything.
Each entity can have 0 or more "properties". Properties are simply key/value pairs.
An example entity might be "Bill Gates". This entity might have a property named "Company" containing the value "Microsoft". As your data set grows, you can follow the "Microsoft" link back to any entity which uses it as a property value to, say, generate a list of Microsoft employees.
Other than this basic schema, the data is completely freeform.
Properties have one additional field, called "extra", which can be used to add a short annotation for the key/value pair. Going back to our "Bill Gates" entity example, we might add an extra to his "Company" property containing the years he functioned as CEO of the company. Extras are displayed on the site just below the property value they belong to.
The index page will show you a list of all entities in the system.
Clicking an entity will show you all of its properties.
Where things get interesting is when you click on a property's value. You'll be shown what would be called "backlinks" in wiki parlance -- other entities who have the same value for the same property, and entities whose name matches.
- Put all the PHP files in a folder somewhere web-accessible.
- Create a database and import the contents of dossier-sample.sql into it (if you want sample data).
- Edit the 'users' table to add a username and bcrypt-hashed password of your choice (sorry, no UI for this yet).
- Edit db.php to reflect your database configuration.
- Visit in a web browser
Data formatting recommendations
For dates, use YYYY-MM-DD format.
There's tons to be done. Pretty much nothing is here except the core concept. The project is particularly in need of a good designer.
Feel free to fork and pitch in on any feature that seems interesting to you.
This code was written in a hurry and is not the world's finest PHP code. I don't guarantee its safety or performance.
September 2, 2014:
- Added simple user authentication.
- This requires a new table called 'users'. See updated sample SQL.
- Edit the 'users' table so it contains a row with your desired username and a bcrypt-hashed password (sorry, there is no UI for this at this time)
- Change between 'public', 'private', and 'read-only' modes in config.php
- Property keys are now hyperlinked. When clicked, they show all records where that property is defined, and what value it has.
- Enables the ability to add and delete properties on an entity (requires authentication)
- Enables the ability to add a new entity (requires authentication)
- Fixed some PHP warnings, such as "use of undefined constant v"
- Added a meta viewport tag for mobile devices
August 5, 2014:
- Initial release.