Class: RDF::Statement
Instance Method Summary collapse
- #executable? ⇒ Boolean
-
#optimize(**options) ⇒ RDF::Statement
A duplicate of this Statement.
-
#to_sparql(**options) ⇒ String
Returns a partial SPARQL grammar for this term.
-
#to_sxp(prefixes: nil, base_uri: nil) ⇒ String
Returns an S-Expression (SXP) representation.
-
#to_sxp_bin ⇒ Array
Transform Statement Pattern into an SXP.
Instance Method Details
#executable? ⇒ Boolean
396 |
# File 'lib/sparql/algebra/extensions.rb', line 396 def executable?; false; end |
#optimize(**options) ⇒ RDF::Statement
A duplicate of this Statement.
392 393 394 |
# File 'lib/sparql/algebra/extensions.rb', line 392 def optimize(**) self.dup end |
#to_sparql(**options) ⇒ String
Returns a partial SPARQL grammar for this term.
382 383 384 385 |
# File 'lib/sparql/algebra/extensions.rb', line 382 def to_sparql(**) str = to_triple.map {|term| term.to_sparql(**)}.join(" ") quoted? ? ('<<' + str + '>>') : str end |
#to_sxp(prefixes: nil, base_uri: nil) ⇒ String
Returns an S-Expression (SXP) representation
373 374 375 |
# File 'lib/sparql/algebra/extensions.rb', line 373 def to_sxp(prefixes: nil, base_uri: nil) to_sxp_bin.to_sxp(prefixes: prefixes, base_uri: base_uri) end |
#to_sxp_bin ⇒ Array
Transform Statement Pattern into an SXP
357 358 359 360 361 362 363 364 365 |
# File 'lib/sparql/algebra/extensions.rb', line 357 def to_sxp_bin [ (has_graph? ? :quad : (quoted? ? :qtriple : :triple)), (:inferred if inferred?), subject, predicate, object, graph_name ].compact.map(&:to_sxp_bin) end |