class Graffiti::RdfPropertyMap

Map of an internal RDF property into relational storage

Attributes

field[R]

name of the field into which the property is mapped

if property range is not a literal, the field is a reference to the resource table

property[R]

expanded uriref of the mapped property

subproperty_of[RW]

expanded uriref of the property which this property is a subproperty of

if set, this property maps into the same table and field as its superproperty, and is qualified by an additional field named <field>_subproperty which refers to a uriref resource holding uriref of this subproperty

superproperty[W]
table[R]

name of the table into which the property is mapped (property domain is an internal resource class mapped into this table)

transitive_closure[RW]

name of transitive closure table for a transitive property

the format of a transitive closure table is:

- 'resource' field refers to the subject resource id
- '<field>' property field and '<field>_subproperty' qualifier field (in
  case of subproperty) have the same name as in the main table
- 'distance' field holds the distance from subject to object in the RDF
  graph

the transitive closure table is automatically updated by a trigger on every update of the main table

Public Class Methods

new(property, table, field) click to toggle source
# File lib/graffiti/rdf_property_map.rb, line 36
def initialize(property, table, field)
  # fixme: support ambiguous mappings
  @property = property
  @table = table
  @field = field
end
qualifier_field(field, type = 'subproperty') click to toggle source

special qualifier field

# File lib/graffiti/rdf_property_map.rb, line 32
def RdfPropertyMap.qualifier_field(field, type = 'subproperty')
  field + '_' + type
end
qualifier_property(property, type = 'subproperty') click to toggle source

special qualifier map

' ' is added to the property name to make sure it can't clash with any valid property uriref

# File lib/graffiti/rdf_property_map.rb, line 26
def RdfPropertyMap.qualifier_property(property, type = 'subproperty')
  property + ' ' + type
end

Public Instance Methods

superproperty?() click to toggle source

set to true if this property has subproperties

# File lib/graffiti/rdf_property_map.rb, line 72
def superproperty?
  @superproperty or false
end