Triplestore in Drupal

I've been thinking about how I'm going to build a triplestore in Drupal for Silk Floss. I think this is how I'm going to it. I'll create a new Triple (triple) module. The name is availble where item isn't. This module will consist of these entities:

  • Item
    An object.
    The label for the entity should be hoisted from a name, label, or title statement.
    The entity should be revisioned and does not allow for user fields since anything can be specified in the Statements.
    • Statements
      A field that has references to a Property (by id in the database and by url on display) and value by id. This custom field could be added to any entity type .
  • Property
    A map of an id to a full url of a property. This exists to make it easier to reference to. There are no fields on this entity.
  • Value
    A single value. There should exist a bundle for each primitive field type: Text, URL, Number, Item; etc. All fields should be revisioned. Everything except for Item should be translatable.  The entity should not allow user fields, but should allow creating new types based on field types. There might also be the possability to reference other kinds of things, like perhaps referencing a View which would produce a dynamic output (i.e. a list of blog posts).


Drupal already provides a fairly robost hook system, but I'll also need to ensure that things can be set dynamicly. For instance, I think a thumbnail property, by default, should just be generated thumbnails from whatever is in the contentUrl on an ImageObject.

After all this, we'll figure out how to implement SPARQL in Drupal which will allow us to actually INSERT content into the store. I have some ideas for access control and how to handle it, but I'll continue that later.