triple_store.rb revision 08464a6b0d787688a7a3d60e22c7dc9a62e30b71
require 'rdf'
# A triple store of relational statements (Subject, Predicate, Object)
#
# Author: Daniel Couto Vale <danielvale@uni-bremen.de>
#
# A map (predicate x object) -> subject
# A map (subject x object) -> predicate
# A map (subject x predicate) -> object
# Constructs a statement store from an rdf file
#
# path_name - the path name of the rdf file to load
#
statements = []
end
end
# Constructor
#
# statements - a list of statements
#
statements.each do |statement|
# Read statement components
# Map subject
# Map predicate
# Map object
end
end
# Returns a list with all subjects for a given object-predicate pair
#
# * *Args* :
# * - +predicate+ -> a predicate
# * - +object+ -> an object
# * *Returns* :
# * - the list of subjects
end
# Returns a list with all predicates for a given subject-object pair
#
# * *Args* :
# * - +subject+ -> a subject
# * - +object+ -> an object
# * *Returns* :
# * - the list of predicates
end
# Returns a list with all objects for a given subject-predicate pair
#
# * *Args* :
# * - +subject+ -> a subject
# * - +predicate+ -> a predicate
# * *Returns* :
# * - the list of objects
end
# Lists the entities identified by two keys
#
# * *Args* :
# * - +map+ -> a hash of hashes of arrays
# * - +key1+ -> a key to a hash of arrays
# * - +key2+ -> a key to an array
# * *Returns* :
# * - the indicated array of entities if it exists
# * - an empty array otherwise
else
end
end
# Maps an entity to two keys
#
# * *Args* :
# * - +map+ -> a hash of hashes of arrays
# * - +key1+ -> a key to a hash of arrays
# * - +key2+ -> a key to an array
# * - +entity+ -> an entity to be added to the array
end
end
end
end