Organize and access data with Piggydb

Tags and Relations in Piggydb

Although you can assign tags to a knowledge fragment during editing, Piggydb also makes it possible to tag already existing entries easily via drag-and-drop. In the Tag Palette, pick a tag and drag it onto the desired fragments. When you assign a tag to a fragment, Piggydb automatically hyperlinks all occurrences of the tag in all existing fragments. Clicking on the hyperlink shows all fragments containing the specific tag.

Piggydb also supports hierarchical tags, which add a new dimension to the tagging functionality suitable for more granular and effective classification of knowledge fragments. For example, you can create the language tag with the grammar, vocabulary, and notes subtags to keep tabs on language-related fragments. Each subtag in Piggydb can contain a number of its own child tags. For example, the grammar subtag can include the morphology and syntax child tags. The morphology tag can include its own child tags like nouns, verbs, adverbs, and so on. When you assign a specific subtag to a fragment, Piggydb automatically adds parent tags, too. For example, assigning the syntax tag to a fragment automatically adds the grammar and language parent tags. To define hierarchical tags, click on an existing tag to open it in column view (Figure 5). Then use the Tag fields to add parents and children to the selected tag.

Figure 5: Piggydb supports hierarchical tagging.

A knowledge fragment in Piggydb can act as a tag, too. This feature turns an individual knowledge fragment into a tag fragment that represents a concept. This concept can be used to group other, conceptually similar, fragments. To transform a fragment into a tag fragment, press the As a tag button next to the Title field in the fragment editor. This essentially turns the fragment into a subtag of every tag assigned to the tag fragment. The article The Piggydb Way: #2 Tags as First-Class Components [2] will help you better understand this feature.

Although the tag-fragments can be used to group conceptually similar fragments, the relationship feature lets you establish connections between knowledge fragments. For example, you can create a relation between a fragment explaining how to set up an Apache server and a fragment containing information on how to enable the htaccess feature. To add a relationship, drag the Relationship icon in the floating toolbar of the source fragment and drop it onto the destination fragment (Figure 6). This displays the Create a relationship dialog box, where you can specify the type of relationship (one-way or bi-directional).

Figure 6: Creating a relationship between knowledge fragments.

Special Tags

In addition to regular tags, Piggydb supports tags reserved for internal use: #bookmark, #pre, #code, #public, and #user. The #bookmark tag can be used to access frequently used knowledge fragments quickly. Knowledge fragments tagged with the #bookmark tag are listed in the Bookmark palette. The easiest way to bookmark a fragment is to use the Bookmark button in the fragment toolbar.

Piggydb provides another way to access specific knowledge fragments: the dedicated button in the fragment toolbar adds the current fragment to the home page. This puts the fragment at the top of the first column in the column view.

The #pre tag renders the content of a fragment without any formatting, while the #code tag adds syntax highlighting. The combination of the two tags can be used for fragments containing code snippets (Figure 7). You can also use the optional #lang-<language name> tag to specify explicitly the programming language of the code in the fragment.

Figure 7: Piggydb can handle code snippets.

Assigning the #public tag to a fragment makes it accessible for everyone. The public fragment's address has the following format: http://piggydb//document-view.htm?id=<n> (where piggydb is the IP address or domain name of the server running Piggydb and <n> is the ID number of the fragment). To make all public fragments accessible via the http://piggydb/public/ address, assign the #home tag to each of them.

Managing Users in Piggydb

Piggydb provides a rather unique way of managing users. By default, the application has only one user called owner, but you can add other users via special knowledge fragments with the #user tag assigned to them. To add, for example, the guest user, create a new knowledge fragment, enter guest in the Title field, and assign the #user tag to the fragment. Press Register to save the fragment, and you can then log in to Piggydb using the guest username and password. The user fragments in Piggydb can be treated as regular knowledge fragments – that is, you can assign tags to them, connect to other fragments, and so on.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More