triple_store.rb revision fbba1a298e3a589aa31ff46bbe1dd7773d23f582
# A triple store
#
# 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 triple store from an rdf file
#
# path_name - the path name of the rdf file to load
#
end
# Constructor
#
# triples - a list of triples
#
triples.each do |triple|
# Read triple 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