rdf 1.1.17.1 → 1.99.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15cede153e5e1329f30828a740b421e93e6a42c8
4
- data.tar.gz: 8b818ec2b57e912e9df285bdef80cd485b2b9438
3
+ metadata.gz: 5459870c2250fc3eb1ce868c6707b2fd20664ee4
4
+ data.tar.gz: be34a5df00dff4f60336ad287e50cf2d480bf5a0
5
5
  SHA512:
6
- metadata.gz: fe69708809e8dcccb9f5e43176b561fa66d54bf810be1d2471ed7c385cd3c82b6ddf0c029b09e85c1b72da6c7537c90a68efb37d6764cbb11484b0f8435d85bf
7
- data.tar.gz: a0198a7412e0b565666ca318a520f6e343a7e9b01af55b8df34d6ff7b081dc3ae8c481b0c3dc39b09d8e349e23ee3de948bd6295d1263934ddf5eb0e644f402d
6
+ metadata.gz: ed6a295b07e4fce0204a18ba1fe9d544f1a49af2baae95c5dea6da944db6d2eeae0176b479f279ebfac0874b1bcbda27b52438c0dc2d147aabfe12549f9ef920
7
+ data.tar.gz: d20fcf6cd98b1928afbc149223b49f6dee9c35f6aa38e325808fdd69f2b1b546f22675ad7cec880871c8cd4a19157db691659bcd80b0847d3b51868dfb54cbd6
data/README CHANGED
@@ -92,7 +92,7 @@ operations on RDF files using available readers and writers.
92
92
  ### Writing RDF data using the [N-Triples][] format
93
93
 
94
94
  require 'rdf/ntriples'
95
- graph = RDF::Graph.new << [:hello, RDF::DC.title, "Hello, world!"]
95
+ graph = RDF::Graph.new << [:hello, RDF::RDFS.label, "Hello, world!"]
96
96
  graph.dump(:ntriples)
97
97
 
98
98
  or
@@ -114,13 +114,13 @@ or
114
114
 
115
115
  ### Reading RDF data in other formats
116
116
  {RDF::Reader.open} and {RDF::Repository.load} use a number of mechanisms to determine the appropriate reader
117
- to use when loading a file. The specific format to use can be forced using, e.g. `:format => :ntriples`
117
+ to use when loading a file. The specific format to use can be forced using, e.g. `format: :ntriples`
118
118
  option where the specific format symbol is determined by the available readers. Both also use
119
119
  MimeType or file extension, where available.
120
120
 
121
121
  require 'rdf/nquads'
122
122
 
123
- graph = RDF::Graph.load("http://ruby-rdf.github.com/rdf/etc/doap.nq", :format => :nquads)
123
+ graph = RDF::Graph.load("http://ruby-rdf.github.com/rdf/etc/doap.nq", format: :nquads)
124
124
 
125
125
  A specific sub-type of Reader can also be invoked directly:
126
126
 
@@ -144,9 +144,9 @@ appropriate writer to use.
144
144
 
145
145
  require 'linkeddata'
146
146
 
147
- RDF::Writer.open("hello.nq", :format => :nquads) do |writer|
147
+ RDF::Writer.open("hello.nq", format: :nquads) do |writer|
148
148
  writer << RDF::Repository.new do |repo|
149
- repo << RDF::Statement.new(:hello, RDF::DC.title, "Hello, world!", :context => RDF::URI("context"))
149
+ repo << RDF::Statement.new(:hello, RDF::RDFS.label, "Hello, world!", context: RDF::URI("context"))
150
150
  end
151
151
  end
152
152
 
@@ -154,14 +154,14 @@ A specific sub-type of Writer can also be invoked directly:
154
154
 
155
155
  require 'rdf/nquads'
156
156
 
157
- repo = RDF::Repository.new << RDF::Statement.new(:hello, RDF::DC.title, "Hello, world!", :context => RDF::URI("context"))
157
+ repo = RDF::Repository.new << RDF::Statement.new(:hello, RDF::RDFS.label, "Hello, world!", context: RDF::URI("context"))
158
158
  File.open("hello.nq", "w") {|f| f << repo.dump(:nquads)}
159
159
 
160
160
  ## Reader/Writer convenience methods
161
161
  {RDF::Enumerable} implements `to_{format}` for each available instance of {RDF::Reader}.
162
162
  For example, if `rdf/turtle` is loaded, this allows the following:
163
163
 
164
- graph = RDF::Graph.new << [:hello, RDF::DC.title, "Hello, world!"]
164
+ graph = RDF::Graph.new << [:hello, RDF::RDFS.label, "Hello, world!"]
165
165
  graph.to_ttl
166
166
 
167
167
  Similarly, {RDF::Mutable} implements `from_{format}` for each available instance
@@ -172,7 +172,7 @@ of {RDF::Writer}. For example:
172
172
 
173
173
  Note that no prefixes are loaded automatically, however they can be provided as arguments:
174
174
 
175
- graph.from_ttl("[ a rdf:Resource]", :prefixes => {:rdf => RDF.to_uri})
175
+ graph.from_ttl("[ a rdf:Resource]", prefixes: {rdf: RDF.to_uri})
176
176
 
177
177
  ### Querying RDF data using basic graph patterns (BGPs)
178
178
 
@@ -180,7 +180,7 @@ Note that no prefixes are loaded automatically, however they can be provided as
180
180
 
181
181
  graph = RDF::Graph.load("http://ruby-rdf.github.com/rdf/etc/doap.nt")
182
182
  query = RDF::Query.new({
183
- :person => {
183
+ person: {
184
184
  RDF.type => FOAF.Person,
185
185
  FOAF.name => :name,
186
186
  FOAF.mbox => :email,
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.17.1
1
+ 1.99.0
data/lib/rdf/cli.rb CHANGED
@@ -62,8 +62,8 @@ module RDF
62
62
  writer_class = RDF::Writer.for(opts[:output_format]) || RDF::NTriples::Writer
63
63
  out = opts[:output] || $stdout
64
64
  out.set_encoding(Encoding::UTF_8) if out.respond_to?(:set_encoding) && RUBY_PLATFORM == "java"
65
- opts = opts.merge(:prefixes => {})
66
- writer_opts = opts.merge(:standard_prefixes => true)
65
+ opts = opts.merge(prefixes: {})
66
+ writer_opts = opts.merge(standard_prefixes: true)
67
67
  self.parse(argv, opts) do |reader|
68
68
  writer_class.new(out, writer_opts) do |writer|
69
69
  writer << reader
@@ -91,14 +91,14 @@ module RDF
91
91
  def self.options(&block)
92
92
  options = OptionParser.new
93
93
  opts = options.options = {
94
- :base_uri => nil,
95
- :canonicalize => false,
96
- :debug => false,
97
- :evaluate => nil,
98
- :format => nil,
99
- :output => $stdout,
100
- :output_format => :ntriples,
101
- :validate => false,
94
+ base_uri: nil,
95
+ canonicalize: false,
96
+ debug: false,
97
+ evaluate: nil,
98
+ format: nil,
99
+ output: $stdout,
100
+ output_format: :ntriples,
101
+ validate: false,
102
102
  }
103
103
 
104
104
  # Command-specific options
data/lib/rdf/format.rb CHANGED
@@ -11,19 +11,19 @@ module RDF
11
11
  # @example Getting a serialization format class
12
12
  # RDF::Format.for(:ntriples) #=> RDF::NTriples::Format
13
13
  # RDF::Format.for("etc/doap.nt")
14
- # RDF::Format.for(:file_name => "etc/doap.nt")
15
- # RDF::Format.for(:file_extension => "nt")
16
- # RDF::Format.for(:content_type => "application/n-triples")
14
+ # RDF::Format.for(file_name: "etc/doap.nt")
15
+ # RDF::Format.for(file_extension: "nt")
16
+ # RDF::Format.for(content_type: "application/n-triples")
17
17
  #
18
18
  # @example Obtaining serialization format MIME types
19
19
  # RDF::Format.content_types #=> {"application/n-triples" => [RDF::NTriples::Format]}
20
20
  #
21
21
  # @example Obtaining serialization format file extension mappings
22
- # RDF::Format.file_extensions #=> {:nt => [RDF::NTriples::Format]}
22
+ # RDF::Format.file_extensions #=> {nt: [RDF::NTriples::Format]}
23
23
  #
24
24
  # @example Defining a new RDF serialization format class
25
25
  # class RDF::NTriples::Format < RDF::Format
26
- # content_type 'application/n-triples', :extension => :nt
26
+ # content_type 'application/n-triples', extension: :nt
27
27
  # content_encoding 'utf-8'
28
28
  #
29
29
  # reader RDF::NTriples::Reader
@@ -95,7 +95,7 @@ module RDF
95
95
  format = case options
96
96
  when String
97
97
  # Find a format based on the file name
98
- self.for(:file_name => options) { yield if block_given? }
98
+ self.for(file_name: options) { yield if block_given? }
99
99
 
100
100
  when Hash
101
101
  case
@@ -112,7 +112,7 @@ module RDF
112
112
  content_types[mime_type] unless mime_type == 'text/plain' && (options[:sample] || block_given?)
113
113
  # Find a format based on the file name:
114
114
  when file_name = options[:file_name]
115
- self.for(:file_extension => File.extname(file_name.to_s)[1..-1]) { yield if block_given? }
115
+ self.for(file_extension: File.extname(file_name.to_s)[1..-1]) { yield if block_given? }
116
116
  # Find a format based on the file extension:
117
117
  when file_ext = options[:file_extension]
118
118
  file_extensions[file_ext.to_sym]
@@ -201,7 +201,7 @@ module RDF
201
201
  # @example
202
202
  #
203
203
  # content_types = RDF::Format.reader_types
204
- # format = RDF::Format.for(:content_type => content_types.first)
204
+ # format = RDF::Format.for(content_type: content_types.first)
205
205
  #
206
206
  # @return [Array<String>]
207
207
  def self.reader_types
@@ -227,7 +227,7 @@ module RDF
227
227
  # @example
228
228
  #
229
229
  # content_types = RDF::Format.writer_types
230
- # format = RDF::Format.for(:content_type => content_types.first)
230
+ # format = RDF::Format.for(content_type: content_types.first)
231
231
  #
232
232
  # @return [Array<String>]
233
233
  def self.writer_types
@@ -14,13 +14,13 @@ module RDF
14
14
  # @example Checking whether a specific statement exists
15
15
  # enumerable.has_statement?(RDF::Statement(subject, predicate, object))
16
16
  # enumerable.has_triple?([subject, predicate, object])
17
- # enumerable.has_quad?([subject, predicate, object, context])
17
+ # enumerable.has_quad?([subject, predicate, object, graph_name])
18
18
  #
19
19
  # @example Checking whether a specific value exists
20
20
  # enumerable.has_subject?(RDF::URI("http://rubygems.org/gems/rdf"))
21
- # enumerable.has_predicate?(RDF::DC.creator)
22
- # enumerable.has_object?(RDF::Literal("A Ruby library for working with Resource Description Framework (RDF) data.", :language => :en))
23
- # enumerable.has_context?(RDF::URI("http://ar.to/#self"))
21
+ # enumerable.has_predicate?(RDF::RDFS.label)
22
+ # enumerable.has_object?(RDF::Literal("A Ruby library for working with Resource Description Framework (RDF) data.", language: :en))
23
+ # enumerable.has_graph?(RDF::URI("http://ar.to/#self"))
24
24
  #
25
25
  # @example Enumerating all statements
26
26
  # enumerable.each_statement do |statement|
@@ -33,26 +33,25 @@ module RDF
33
33
  # end
34
34
  #
35
35
  # @example Enumerating all statements in the form of quads
36
- # enumerable.each_quad do |subject, predicate, object, context|
37
- # puts [subject, predicate, object, context].inspect
36
+ # enumerable.each_quad do |subject, predicate, object, graph_name|
37
+ # puts [subject, predicate, object, graph_name].inspect
38
38
  # end
39
39
  #
40
40
  # @example Enumerating all terms
41
41
  # enumerable.each_subject { |term| puts term.inspect }
42
42
  # enumerable.each_predicate { |term| puts term.inspect }
43
43
  # enumerable.each_object { |term| puts term.inspect }
44
- # enumerable.each_context { |term| puts term.inspect }
45
44
  #
46
45
  # @example Obtaining all statements
47
46
  # enumerable.statements #=> [RDF::Statement(subject1, predicate1, object1), ...]
48
47
  # enumerable.triples #=> [[subject1, predicate1, object1], ...]
49
- # enumerable.quads #=> [[subject1, predicate1, object1, context1], ...]
48
+ # enumerable.quads #=> [[subject1, predicate1, object1, graph_name1], ...]
50
49
  #
51
50
  # @example Obtaining all unique values
52
- # enumerable.subjects #=> [subject1, subject2, subject3, ...]
53
- # enumerable.predicates #=> [predicate1, predicate2, predicate3, ...]
54
- # enumerable.objects #=> [object1, object2, object3, ...]
55
- # enumerable.contexts #=> [context1, context2, context3, ...]
51
+ # enumerable.subjects(unique: true) #=> [subject1, subject2, subject3, ...]
52
+ # enumerable.predicates(unique: true) #=> [predicate1, predicate2, predicate3, ...]
53
+ # enumerable.objects(unique: true) #=> [object1, object2, object3, ...]
54
+ # enumerable.graph_names(unique: true) #=> [graph_name1, graph_name2, graph_name3, ...]
56
55
  #
57
56
  # @see RDF::Graph
58
57
  # @see RDF::Repository
@@ -66,7 +65,8 @@ module RDF
66
65
  # Returns `true` if this repository supports the given `feature`.
67
66
  #
68
67
  # Supported features include:
69
- # * `:context` supports statements with a context, allowing multiple contexts
68
+ # * `:graph_name` supports statements with a graph_name, allowing multiple named graphs
69
+ # * `:context` supports statements with a context, allowing multiple contexts (DEPRECATED, use graph_name. `context` will be removed in RDF.rb 2.0)
70
70
  # * `:inference` supports RDFS inferrence of queryable contents.
71
71
  # * `:validity` allows a concrete Enumerable implementation to indicate that it does or does not support valididty checking. By default implementations are assumed to support validity checking.
72
72
  # * `:skolemize` supports [Skolemization](https://www.w3.org/wiki/BnodeSkolemization) of an `Enumerable`. Implementations supporting this feature must implement a `#skolemize` method, taking a base URI used for minting URIs for BNodes as stable identifiers and a `#deskolemize` method, also taking a base URI used for turning URIs having that prefix back into the same BNodes which were originally skolemized.
@@ -267,19 +267,18 @@ module RDF
267
267
  # The order in which quads are yielded is undefined.
268
268
  #
269
269
  # @overload each_quad
270
- # @yield [subject, predicate, object, context]
270
+ # @yield [subject, predicate, object, graph_name]
271
271
  # each quad
272
272
  # @yieldparam [RDF::Resource] subject
273
273
  # @yieldparam [RDF::URI] predicate
274
274
  # @yieldparam [RDF::Term] object
275
- # @yieldparam [RDF::Resource] context
275
+ # @yieldparam [RDF::Resource] graph_name
276
276
  # @yieldreturn [void] ignored
277
277
  # @return [void]
278
278
  #
279
279
  # @overload each_quad
280
- # @return [Enumerator]
280
+ # @return [Enumerator<Array(RDF::Resource, RDF::URI, RDF::Term, RDF::Resource)>]
281
281
  #
282
- # @return [void]
283
282
  # @see #enum_quad
284
283
  def each_quad
285
284
  if block_given?
@@ -342,9 +341,7 @@ module RDF
342
341
  # @return [void]
343
342
  #
344
343
  # @overload each_subject
345
- # @return [Enumerator]
346
- #
347
- # @return [void]
344
+ # @return [Enumerator<RDF::Resource>]
348
345
  # @see #enum_subject
349
346
  def each_subject
350
347
  if block_given?
@@ -363,7 +360,7 @@ module RDF
363
360
  ##
364
361
  # Returns an enumerator for {RDF::Enumerable#each_subject}.
365
362
  #
366
- # @return [Enumerator]
363
+ # @return [Enumerator<RDF::Resource>]
367
364
  # @see #each_subject
368
365
  def enum_subject
369
366
  enum_for(:each_subject)
@@ -375,7 +372,7 @@ module RDF
375
372
  #
376
373
  # @param [Hash{Symbol => Boolean}] options
377
374
  # @option options [Boolean] :unique (true)
378
- # @return [Enumerator<RDF::URI>]
375
+ # @return [Array<RDF::URI>]
379
376
  # @see #each_predicate
380
377
  # @see #enum_predicate
381
378
  def predicates(options = {})
@@ -410,9 +407,7 @@ module RDF
410
407
  # @return [void]
411
408
  #
412
409
  # @overload each_predicate
413
- # @return [Enumerator]
414
- #
415
- # @return [void]
410
+ # @return [Enumerator<RDF::URI>]
416
411
  # @see #enum_predicate
417
412
  def each_predicate
418
413
  if block_given?
@@ -431,7 +426,7 @@ module RDF
431
426
  ##
432
427
  # Returns an enumerator for {RDF::Enumerable#each_predicate}.
433
428
  #
434
- # @return [Enumerator]
429
+ # @return [Enumerator<RDF::URI>]
435
430
  # @see #each_predicate
436
431
  def enum_predicate
437
432
  enum_for(:each_predicate)
@@ -478,9 +473,8 @@ module RDF
478
473
  # @return [void]
479
474
  #
480
475
  # @overload each_object
481
- # @return [Enumerator]
476
+ # @return [Enumerator<RDF::Term>]
482
477
  #
483
- # @return [void]
484
478
  # @see #enum_object
485
479
  def each_object # FIXME: deduplication
486
480
  if block_given?
@@ -499,7 +493,7 @@ module RDF
499
493
  ##
500
494
  # Returns an enumerator for {RDF::Enumerable#each_object}.
501
495
  #
502
- # @return [Enumerator]
496
+ # @return [Enumerator<RDF::Term>]
503
497
  # @see #each_object
504
498
  def enum_object
505
499
  enum_for(:each_object)
@@ -514,7 +508,9 @@ module RDF
514
508
  # @return [Enumerator<RDF::Resource>]
515
509
  # @see #each_context
516
510
  # @see #enum_context
511
+ # @deprecated use {#graph_names} instead.
517
512
  def contexts(options = {})
513
+ warn "[DEPRECATION] Enumerable#contexts is being replaced with Enumerable#graph_names in RDF.rb 2.0. Called from #{Gem.location_of_caller.join(':')}"
518
514
  if options[:unique] == false
519
515
  enum_statement.map(&:context).compact.to_enum # TODO: optimize
520
516
  else
@@ -522,14 +518,33 @@ module RDF
522
518
  end
523
519
  end
524
520
 
521
+ ##
522
+ # Returns all unique RDF graph names, other than the default graph.
523
+ #
524
+ # @param [Hash{Symbol => Boolean}] options
525
+ # @option options [Boolean] :unique (true)
526
+ # @return [Array<RDF::Resource>]
527
+ # @see #each_graph
528
+ # @see #enum_graph
529
+ # @since 2.0
530
+ def graph_names(options = {})
531
+ if options[:unique] == false
532
+ enum_statement.map(&:graph_name).compact # TODO: optimize
533
+ else
534
+ enum_graph.map(&:graph_name).compact
535
+ end
536
+ end
537
+
525
538
  ##
526
539
  # Returns `true` if `self` contains the given RDF context.
527
540
  #
528
541
  # @param [RDF::Resource, false] value
529
542
  # Use value `false` to query for the default context
530
543
  # @return [Boolean]
544
+ # @deprecated Use {#has_graph?} instead.
531
545
  def has_context?(value)
532
- enum_context.include?(value)
546
+ warn "[DEPRECATION] Enumerable#has_context? is being replaced with Enumerable#has_graph? in RDF.rb 2.0. Called from #{Gem.location_of_caller.join(':')}"
547
+ has_graph?(value)
533
548
  end
534
549
 
535
550
  ##
@@ -549,9 +564,10 @@ module RDF
549
564
  # @overload each_context
550
565
  # @return [Enumerator]
551
566
  #
552
- # @return [void]
553
567
  # @see #enum_context
568
+ # @deprecated Use {#each_graph} instead.
554
569
  def each_context
570
+ warn "[DEPRECATION] Enumerable#each_context is being replaced with Enumerable#each_graph in RDF.rb 2.0. Called from #{Gem.location_of_caller.join(':')}"
555
571
  if block_given?
556
572
  values = {}
557
573
  each_statement do |statement|
@@ -570,11 +586,23 @@ module RDF
570
586
  #
571
587
  # @return [Enumerator]
572
588
  # @see #each_context
589
+ # @deprecated Use {#enum_graph} instead.
573
590
  def enum_context
591
+ warn "[DEPRECATION] Enumerable#enum_context is being replaced with Enumerable#enum_graph in RDF.rb 2.0. Called from #{Gem.location_of_caller.join(':')}"
574
592
  enum_for(:each_context)
575
593
  end
576
594
  alias_method :enum_contexts, :enum_context
577
595
 
596
+ ##
597
+ # Returns `true` if `self` contains the given RDF graph_name.
598
+ #
599
+ # @param [RDF::Resource, false] graph_name
600
+ # Use value `false` to query for the default graph_name
601
+ # @return [Boolean]
602
+ def has_graph?(graph_name)
603
+ enum_statement.any? {|s| s.graph_name == graph_name}
604
+ end
605
+
578
606
  ##
579
607
  # Iterates the given block for each RDF graph in `self`.
580
608
  #
@@ -590,16 +618,16 @@ module RDF
590
618
  # @return [void]
591
619
  #
592
620
  # @overload each_graph
593
- # @return [Enumerator]
621
+ # @return [Enumerator<RDF::Graph>]
594
622
  #
595
- # @return [void]
596
623
  # @see #enum_graph
597
624
  # @since 0.1.9
598
625
  def each_graph
599
626
  if block_given?
600
- yield RDF::Graph.new(nil, :data => self)
601
- each_context do |context|
602
- yield RDF::Graph.new(context, :data => self)
627
+ yield RDF::Graph.new(nil, data: self)
628
+ # FIXME: brute force, repositories should override behavior
629
+ enum_statement.map(&:graph_name).uniq.compact do |graph_name|
630
+ yield RDF::Graph.new(graph_name, data: self)
603
631
  end
604
632
  end
605
633
  enum_graph
@@ -608,7 +636,7 @@ module RDF
608
636
  ##
609
637
  # Returns an enumerator for {RDF::Enumerable#each_graph}.
610
638
  #
611
- # @return [Enumerator]
639
+ # @return [Enumerator<RDF::Graph>]
612
640
  # @see #each_graph
613
641
  # @since 0.1.9
614
642
  def enum_graph
@@ -691,7 +719,7 @@ module RDF
691
719
  def method_missing(meth, *args)
692
720
  writer = RDF::Writer.for(meth.to_s[3..-1].to_sym) if meth.to_s[0,3] == "to_"
693
721
  if writer
694
- writer.buffer(:standard_prefixes => true) {|w| w << self}
722
+ writer.buffer(standard_prefixes: true) {|w| w << self}
695
723
  else
696
724
  super
697
725
  end
@@ -35,16 +35,22 @@ module RDF
35
35
  # @param [Hash{Symbol => Object}] options
36
36
  # Options from {RDF::Reader.open}
37
37
  # @option options [RDF::Resource] :context
38
- # Set set context of each loaded statement
38
+ # Set set context of each loaded statement. This option is deprecated in RDF.rb 2.0.
39
+ # @option options [RDF::Resource] :graph_name
40
+ # Set set graph name of each loaded statement
39
41
  # @return [void]
40
42
  def load(filename, options = {})
43
+ if options.has_key?(:context)
44
+ warn "[DEPRECATION] the :contexts option to Mutable#load is deprecated in RDF.rb 2.0, use :graph_name instead. Called from #{Gem.location_of_caller.join(':')}"
45
+ options[:graph_name] ||= options.delete(:context)
46
+ end
41
47
  raise TypeError.new("#{self} is immutable") if immutable?
42
48
 
43
- Reader.open(filename, {:base_uri => filename}.merge(options)) do |reader|
44
- if options[:context]
49
+ Reader.open(filename, {base_uri: filename}.merge(options)) do |reader|
50
+ if options[:graph_name]
45
51
  statements = []
46
52
  reader.each_statement do |statement|
47
- statement.context = options[:context]
53
+ statement.graph_name = options[:graph_name]
48
54
  statements << statement
49
55
  end
50
56
  insert_statements(statements)
@@ -147,7 +153,7 @@ module RDF
147
153
  def clear
148
154
  raise TypeError.new("#{self} is immutable") if immutable?
149
155
 
150
- if respond_to?(:clear_statements)
156
+ if respond_to?(:clear_statements, true)
151
157
  clear_statements
152
158
  else
153
159
  delete_statements(self)
@@ -19,8 +19,8 @@ module RDF
19
19
  # actual lower-level query pattern matching implementation.
20
20
  #
21
21
  # @example Querying for statements having a given predicate
22
- # queryable.query([nil, RDF::DOAP.developer, nil])
23
- # queryable.query(:predicate => RDF::DOAP.developer) do |statement|
22
+ # queryable.query([nil, RDF::Vocab::DOAP.developer, nil])
23
+ # queryable.query(predicate: RDF::Vocab::DOAP.developer) do |statement|
24
24
  # puts statement.inspect
25
25
  # end
26
26
  #