Module: SPARQL::Client::Update

Defined in:
vendor/bundler/ruby/2.5.0/bundler/gems/sparql-client-204355edf946/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) ⇒ 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/2.5.0/bundler/gems/sparql-client-204355edf946/lib/sparql/client/update.rb', line 84

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

.create(*arguments) ⇒ 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/2.5.0/bundler/gems/sparql-client-204355edf946/lib/sparql/client/update.rb', line 99

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

.delete_data(*arguments) ⇒ 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/2.5.0/bundler/gems/sparql-client-204355edf946/lib/sparql/client/update.rb', line 37

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

.drop(*arguments) ⇒ 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/2.5.0/bundler/gems/sparql-client-204355edf946/lib/sparql/client/update.rb', line 127

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

.insert_data(*arguments) ⇒ 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/2.5.0/bundler/gems/sparql-client-204355edf946/lib/sparql/client/update.rb', line 19

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

.load(*arguments) ⇒ 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/2.5.0/bundler/gems/sparql-client-204355edf946/lib/sparql/client/update.rb', line 56

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