lib/active_rdf/objectmanager/namespace.rb in activerdf-1.4 vs lib/active_rdf/objectmanager/namespace.rb in activerdf-1.5
- old
+ new
@@ -31,11 +31,11 @@
Namespace.lookup(self.to_s.downcase.to_sym, method)
end
# make some builtin methods private because lookup doesn't work otherwise
# on e.g. RDF::type and FOAF::name
- [:type, :name].each {|m| private(m) }
+ [:type, :name, :id].each {|m| private(m) }
end
# return the namespace proxy object
ns
end
@@ -81,10 +81,10 @@
when RDFS::Resource: resource.uri
else resource.to_s
end
delimiter = uri.rindex(/#|\//)
- if delimiter.nil?
+ if delimiter.nil? or delimiter == uri.size-1
uri
else
uri[delimiter+1..-1]
end
end