Giter Club home page Giter Club logo

heirtags_py's Introduction

heirtags

Heirtags are a better way to tag, classify and categorize entities in your system. Contemporary tagging makes use of a many-to-many relationship to allow developers to express multiple attributes on an entity. However these tags are often simple strings that can quicky become unmanageable (if you've ever stared at a tag cloud to try generate insight you'll know what I mean).

Heirtags make use of tags that are heirarchical in nature. Each tag looks something like:

/root/child group/something/else

Kind of like a file system path would look like. From this we can explore the tags far easier, as they have built-in heirachy. It's kind of like tagging your entities with file paths, and you can do anything that you can with a file path. Such as show me all the items under /root/child_group/*

Take a library of books as an example. Previously you would have worked to guess all the attributes up-front and add them accordingly. With heirtags you could have a list of books (we'll ID them with integers, 1, 2, 3 etc) and then tags to describe them. For example in our library we could have:

/core/authors/Fitzgerald
/core/authors/Wilson
/core/authors/Poe
/core/authors/Churchill
/core/year/2000
/core/year/2001
/core/year/2002
/core/type/Fiction/genre/Mystery
/core/type/Fiction/genre/Sci-fi
/core/type/Non-Fiction/genre/Biography
/core/type/Non-Fiction/genre/Historical

To find all the fiction books you can query

/core/type/Fiction/

while to get more specific and find all books by Edgar Allen Poe you could do

/core/authors/Poe

Every book (entity) could have multiple tags accordingly, and it's easy to add new tags!

Using heirtags

This is a python implementation of heirtags. It's an in-memory data structure that supports adding entities referenced by ID's to the heirachy tree, finding entities via tags and adding new tags to entities.

See main.py for an example.

TODO

  • Support deleting entities/tags
  • Testing absolute/relative look ups
  • Printing none at end of dump?

heirtags_py's People

Contributors

nickhs avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.