We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 409854f + 8e14063 commit d78986cCopy full SHA for d78986c
2 files changed
lib/rdf/vocabulary.rb
@@ -273,7 +273,7 @@ def imported_from
273
#
274
# @return [RDF::URI]
275
def to_uri
276
- RDF::URI.intern(to_s)
+ RDF::URI.intern(@@uris[self].to_s)
277
end
278
279
# For IRI compatibility
spec/vocabulary_spec.rb
@@ -357,6 +357,14 @@
357
358
359
360
+ context 'without a uri' do
361
+ let!(:vocab) { @vocab ||= RDF::Vocabulary.from_graph(graph) }
362
+
363
+ it "gives a null relative uri" do
364
+ expect(vocab.to_uri).to eq RDF::URI.new(nil)
365
+ end
366
367
368
context "with existing Vocabulary" do
369
let!(:nt) {%{
370
<http://example/Klass> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Class> .
0 commit comments