Module: RDF
- Defined in:
- lib/rdf/threadsafe.rb,
lib/rdf/threadsafe/util/cache.rb
Defined Under Namespace
Modules: Util
Class Method Summary collapse
- .[](property) ⇒ #to_s, URI
-
.Graph(*args, &block) ⇒ RDF::Graph
Alias for ‘RDF::Graph.new`.
-
.Literal(*args, &block) ⇒ RDF::Literal
Alias for ‘RDF::Literal.new`.
- .method_missing(property, *args, &block) ⇒ URI
-
.Node(*args, &block) ⇒ RDF::Node
Alias for ‘RDF::Node.new`.
-
.Resource(*args, &block) ⇒ RDF::Resource
Alias for ‘RDF::Resource.new`.
-
.Statement(*args, &block) ⇒ RDF::Statement
Alias for ‘RDF::Statement.new`.
- .to_rdf ⇒ URI
- .to_uri ⇒ URI
- .type ⇒ URI
-
.URI(*args, &block) ⇒ RDF::URI
Alias for ‘RDF::URI.new`.
-
.Vocabulary(uri) ⇒ Class
Alias for ‘RDF::Vocabulary.create`.
Class Method Details
.[](property) ⇒ #to_s, URI
84 85 86 |
# File 'lib/rdf/threadsafe.rb', line 84 def self.[](property) RDF::URI.intern([to_uri.to_s, property.to_s].join) end |
.Graph(*args, &block) ⇒ RDF::Graph
Alias for ‘RDF::Graph.new`.
54 55 56 |
# File 'lib/rdf/threadsafe.rb', line 54 def self.Graph(*args, &block) Graph.new(*args, &block) end |
.Literal(*args, &block) ⇒ RDF::Literal
Alias for ‘RDF::Literal.new`.
43 44 45 46 47 48 |
# File 'lib/rdf/threadsafe.rb', line 43 def self.Literal(*args, &block) case literal = args.first when RDF::Literal then literal else Literal.new(*args, &block) end end |
.method_missing(property, *args, &block) ⇒ URI
92 93 94 95 96 97 98 |
# File 'lib/rdf/threadsafe.rb', line 92 def self.method_missing(property, *args, &block) if args.empty? self[property] else super end end |
.Node(*args, &block) ⇒ RDF::Node
Alias for ‘RDF::Node.new`.
15 16 17 |
# File 'lib/rdf/threadsafe.rb', line 15 def self.Node(*args, &block) Node.new(*args, &block) end |
.Resource(*args, &block) ⇒ RDF::Resource
Alias for ‘RDF::Resource.new`.
7 8 9 |
# File 'lib/rdf/threadsafe.rb', line 7 def self.Resource(*args, &block) Resource.new(*args, &block) end |
.Statement(*args, &block) ⇒ RDF::Statement
Alias for ‘RDF::Statement.new`.
62 63 64 |
# File 'lib/rdf/threadsafe.rb', line 62 def self.Statement(*args, &block) Statement.new(*args, &block) end |
.to_uri ⇒ URI
108 109 110 |
# File 'lib/rdf/threadsafe.rb', line 108 def self.to_uri RDF::URI.intern("http://www.w3.org/1999/02/22-rdf-syntax-ns#") end |
.URI(uri) ⇒ RDF::URI .URI(options = {}) ⇒ RDF::URI
Alias for ‘RDF::URI.new`.
29 30 31 32 33 34 35 36 37 |
# File 'lib/rdf/threadsafe.rb', line 29 def self.URI(*args, &block) case uri = args.first when RDF::URI then uri else case when uri.respond_to?(:to_uri) then uri.to_uri else URI.new(*args, &block) end end end |
.Vocabulary(uri) ⇒ Class
Alias for ‘RDF::Vocabulary.create`.
71 72 73 |
# File 'lib/rdf/threadsafe.rb', line 71 def self.Vocabulary(uri) Vocabulary.create(uri) end |