triple_store.rb revision 08f68f06aa74dfc9ee458eccf4ac0c86e8d91eeb
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 && 0
return TripleStore.new statements
end
# Constructor
#
# statements - a list of statements
#
statements.each do |statement|
# Read statement components
# Map subject
end
end
# Map predicate
end
end
# Map object
end
end
end
end
# Returns a list with all subjects for a given object-predicate pair
#
# predicate - a predicate
# object - a range
#
return Array.new
return Array.new
else
return Array.new(@subjectMap[predicate][object])
end
end
# Returns a list with all predicates for a given subject-object pair
#
# subject - a domain
# object - a range
#
return Array.new
return Array.new
else
return Array.new(@predicateMap[subject][object])
end
end
# Returns a list with all objects for a given subject-predicate pair
#
# subject - a domain
# predicate - a relation
#
return Array.new
return Array.new
else
end
end
end