Module: SPARQL::Client::Update

Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb

Overview

SPARQL 1.1 Update operation builders.

Defined Under Namespace

Classes: Add, Clear, Copy, Create, DeleteData, DeleteInsert, Drop, InsertData, Load, Move, Operation

Class Method Summary collapse

Class Method Details

.clear(*arguments, **options) ⇒ Object

Clear the graph

Examples:

clear.graph(RDF::URI(http://example.org/data.rdf))
clear(:graph, RDF::URI(http://example.org/data.rdf))

CLEAR DEFAULT

clear.default
clear(:default)

CLEAR NAMED

clear.named
clear(:named)

CLEAR ALL

clear.all
clear(:all)

CLEAR SILENT ALL

clear.all.silent
clear(:all, silent: true)


84
85
86
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 84

def self.clear(*arguments, **options)
  Clear.new(*arguments, **options)
end

.create(*arguments, **options) ⇒ Object

Create a graph

Examples:

create(RDF::URI(http://example.org/data.rdf))

CREATE SILENT GRAPH http://example.org/data.rdf

create(RDF::URI(http://example.org/data.rdf)).silent
create(RDF::URI(http://example.org/data.rdf), silent: true)

Parameters:



99
100
101
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 99

def self.create(*arguments, **options)
  Create.new(*arguments, **options)
end

.delete_data(*arguments, **options) ⇒ Object

Delete statements from the graph

Examples:

DELETE DATA { http://example.org/jhacker http://xmlns.com/foaf/0.1/name \"J. Random Hacker\" .}

data = RDF::Graph.new do |graph|
  graph << [RDF::URI('http://example.org/jhacker'), RDF::Vocab::FOAF.name, "J. Random Hacker"]
end
delete_data(data)

DELETE DATA { GRAPH http://example.org/ {}}

delete_data(RDF::Graph.new, graph: 'http://example.org/')
delete_data(RDF::Graph.new).graph('http://example.org/')

Parameters:



37
38
39
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 37

def self.delete_data(*arguments, **options)
  DeleteData.new(*arguments, **options)
end

.drop(*arguments, **options) ⇒ Object

Drop a graph

Examples:

drop.graph(RDF::URI(http://example.org/data.rdf))
drop(:graph, RDF::URI(http://example.org/data.rdf))

DROP DEFAULT

drop.default
drop(:default)

DROP NAMED

drop.named
drop(:named)

DROP ALL

drop.all
drop(:all)

DROP ALL SILENT

drop.all.silent
drop(:all, silent: true)


127
128
129
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 127

def self.drop(*arguments, **options)
  Drop.new(*arguments, **options)
end

.insert_data(*arguments, **options) ⇒ Object

Insert statements into the graph

Examples:

INSERT DATA { http://example.org/jhacker http://xmlns.com/foaf/0.1/name \"J. Random Hacker\" .}

data = RDF::Graph.new do |graph|
  graph << [RDF::URI('http://example.org/jhacker'), RDF::Vocab::FOAF.name, "J. Random Hacker"]
end
insert_data(data)

INSERT DATA { GRAPH http://example.org/ {}}

insert_data(RDF::Graph.new, graph: 'http://example.org/')
insert_data(RDF::Graph.new).graph('http://example.org/')

Parameters:



19
20
21
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 19

def self.insert_data(*arguments, **options)
  InsertData.new(*arguments, **options)
end

.load(*arguments, **options) ⇒ Object

Load statements into the graph

Examples:

load(RDF::URI(http://example.org/data.rdf))

load(RDF::URI(http://example.org/data.rdf)).silent
load(RDF::URI(http://example.org/data.rdf), silent: true)

load(RDF::URI(http://example.org/data.rdf)).into(RDF::URI(http://example.org/data.rdf))
load(RDF::URI(http://example.org/data.rdf), into: RDF::URI(http://example.org/data.rdf))

Parameters:



56
57
58
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 56

def self.load(*arguments, **options)
  Load.new(*arguments, **options)
end