Skip to content

Commit 9eaca3a

Browse files
committed
Finish 0.2.0
2 parents f86c502 + 8835087 commit 9eaca3a

File tree

9 files changed

+91
-716
lines changed

9 files changed

+91
-716
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ jobs:
2323
- 2.5
2424
- 2.6
2525
- 2.7
26-
#- ruby-head # Eventualy
26+
- 3.0
27+
- ruby-head # Eventualy
2728
- jruby
2829
steps:
2930
- name: Clone repository

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
Gemfile.lock
44
pkg/*
55
.idea/
6+
/.byebug_history

Gemfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
source "https://rubygems.org"
22

33
# Specify your gem's dependencies in rdf-virtuoso.gemspec
4-
gemspec
4+
gemspec
5+
6+
gem "rdf", github: "ruby-rdf/rdf", branch: "develop"
7+
gem "rdf-spec", github: "ruby-rdf/rdf-spec", branch: "develop"
8+
9+
group :debug do
10+
gem "byebug", platforms: :mri
11+
end

LICENSE

Lines changed: 24 additions & 674 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ The intent of this class is to act as an abstraction for clients wishing to conn
77
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
88

99
## How?
10-
RDF::Virtuoso::Repository subclasses RDF::Repository built on RDF.rb and is the main connection class built on top of APISmith to establish the read and write methods to a Virtuoso store SPARQL endpoint.
11-
RDF::Virtuoso::Query subclasses RDF::Query and adds SPARQL 1.1. update methods (insert, delete, aggregates, etc.).
10+
`RDF::Virtuoso::Repository` subclasses `RDF::Repository` built on [RDF.rb][] and is the main connection class built on top of APISmith to establish the read and write methods to a Virtuoso store SPARQL endpoint.
11+
`RDF::Virtuoso::Query` subclasses `RDF::Query` and adds SPARQL 1.1. update methods (insert, delete, aggregates, etc.).
1212

1313
For examples on use, please read:
1414
./spec/repository_spec.rb
@@ -69,3 +69,30 @@ or you can dynamically add RDF::Vocabulary objects
6969
Results will be an array of RDF::Query::Solution that can be accessed by bindings or iterated
7070

7171
count = result.first[:count].to_i
72+
73+
## Contributing
74+
75+
This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange development and release activity. All submissions _must_ be on a feature branch based on the _develop_ branch to ease staging and integration.
76+
77+
* Do your best to adhere to the existing coding conventions and idioms.
78+
* Don't use hard tabs, and don't leave trailing whitespace on any line.
79+
Before committing, run `git diff --check` to make sure of this.
80+
* Do document every method you add using [YARD][] annotations. Read the
81+
[tutorial][YARD-GS] or just look at the existing code for examples.
82+
* Don't touch the `.gemspec` or `VERSION` files. If you need to change them,
83+
do so on your private branch only.
84+
* Do note that in order for us to merge any non-trivial changes (as a rule
85+
of thumb, additions larger than about 15 lines of code), we need an
86+
explicit [public domain dedication][PDD] on record from you,
87+
which you will be asked to agree to on the first commit to a repo within the organization.
88+
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
89+
90+
## License
91+
92+
This is free and unencumbered public domain software. For more information,
93+
see <https://unlicense.org/> or the accompanying {file:LICENSE} file.
94+
95+
[PDD]: https://unlicense.org/#unlicensing-contributions
96+
[YARD]: https://yardoc.org/
97+
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
98+
[RDF.rb]: https://rubydoc.info/github/ruby-rdf/rdf

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.7
1+
0.2.0

etc/doap.ttl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<> a doap:Project ;
99
doap:name "RDF::Virtuoso" ;
1010
doap:homepage <https://github.com/ruby-rdf/rdf-vituoso> ;
11-
doap:license <https://www.gnu.org/licenses/gpl-3.0> ;
11+
doap:license <https://unlicense.org/1.0/> ;
1212
doap:shortdesc "An RDF.rb extension library for interacting with a Virtuoso rdf store."@en ;
1313
doap:description "An RDF.rb extension library for interacting with a Virtuoso rdf store.\nSupports SPARQL 1.1 UPDATE extensions and some Virtuoso specific commands."@en ;
1414
doap:created "2007-10-23" ;

lib/rdf/virtuoso/query.rb

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class Query < RDF::Query
2929
# @param [Hash{Symbol => Object}] options
3030
# @return [Query]
3131
# @see http://www.w3.org/TR/rdf-sparql-query/#ask
32-
def self.ask(options = {})
33-
self.new(:ask, options)
32+
def self.ask(**options)
33+
self.new(:ask, **options)
3434
end
3535

3636
##
@@ -40,9 +40,8 @@ def self.ask(options = {})
4040
# @param [Hash{Symbol => Object}] options
4141
# @return [Query]
4242
# @see http://www.w3.org/TR/rdf-sparql-query/#select
43-
def self.select(*variables)
44-
options = variables.last.is_a?(Hash) ? variables.pop : {}
45-
self.new(:select, options).select(*variables)
43+
def self.select(*variables, **options)
44+
self.new(:select, **options).select(*variables)
4645
end
4746

4847
##
@@ -52,9 +51,8 @@ def self.select(*variables)
5251
# @param [Hash{Symbol => Object}] options
5352
# @return [Query]
5453
# @see http://www.w3.org/TR/rdf-sparql-query/#describe
55-
def self.describe(*variables)
56-
options = variables.last.is_a?(Hash) ? variables.pop : {}
57-
self.new(:describe, options).describe(*variables)
54+
def self.describe(*variables, **options)
55+
self.new(:describe, **options).describe(*variables)
5856
end
5957

6058
##
@@ -64,9 +62,8 @@ def self.describe(*variables)
6462
# @param [Hash{Symbol => Object}] options
6563
# @return [Query]
6664
# @see http://www.w3.org/TR/rdf-sparql-query/#construct
67-
def self.construct(*patterns)
68-
options = patterns.last.is_a?(Hash) ? patterns.pop : {}
69-
self.new(:construct, options).construct(*patterns) # FIXME
65+
def self.construct(*patterns, **options)
66+
self.new(:construct, **options).construct(*patterns) # FIXME
7067
end
7168

7269
##
@@ -76,50 +73,42 @@ def self.construct(*patterns)
7673
# @param [Hash{Symbol => Object}] options
7774
# @return [Query]
7875
# @see http://www.w3.org/Submission/SPARQL-Update/
79-
def self.insert_data(*patterns)
80-
# options = variables.last.is_a?(Hash) ? variables.pop : {}
81-
options = patterns.last.is_a?(Hash) ? patterns.pop : {}
82-
self.new(:insert_data, options).insert_data(*patterns)
76+
def self.insert_data(*patterns, **options)
77+
self.new(:insert_data, **options).insert_data(*patterns)
8378
end
8479

85-
def self.insert(*patterns)
86-
options = patterns.last.is_a?(Hash) ? patterns.pop : {}
87-
self.new(:insert, options).insert(*patterns)
80+
def self.insert(*patterns, **options)
81+
self.new(:insert, **options).insert(*patterns)
8882
end
8983

90-
def self.delete_data(*patterns)
91-
options = patterns.last.is_a?(Hash) ? patterns.pop : {}
92-
self.new(:delete_data, options).delete_data(*patterns)
84+
def self.delete_data(*patterns, **options)
85+
self.new(:delete_data, **options).delete_data(*patterns)
9386
end
9487

95-
def self.delete(*patterns)
96-
options = patterns.last.is_a?(Hash) ? patterns.pop : {}
97-
self.new(:delete, options).delete(*patterns)
88+
def self.delete(*patterns, **options)
89+
self.new(:delete, **options).delete(*patterns)
9890
end
9991

100-
def self.create(*variables)
101-
options = variables.last.is_a?(Hash) ? variables.pop : {}
102-
self.new(:create, options).create(variables.first)
92+
def self.create(*variables, **options)
93+
self.new(:create, **options).create(variables.first)
10394
end
10495

105-
def self.drop(*variables)
106-
options = variables.last.is_a?(Hash) ? variables.pop : {}
107-
self.new(:drop, options).drop(variables.first)
96+
def self.drop(*variables, **options)
97+
self.new(:drop, **options).drop(variables.first)
10898
end
10999

110-
def self.clear(*variables)
111-
options = variables.last.is_a?(Hash) ? variables.pop : {}
112-
self.new(:clear, options).clear(variables.first)
100+
def self.clear(*variables, **options)
101+
self.new(:clear, **options).clear(variables.first)
113102
end
114103

115104
##
116105
# @param [Symbol, #to_s] form
117106
# @param [Hash{Symbol => Object}] options
118107
# @yield [query]
119108
# @yieldparam [Query]
120-
def initialize(form = :ask, options = {}, &block)
109+
def initialize(form = :ask, **options, &block)
121110
@form = form.respond_to?(:to_sym) ? form.to_sym : form.to_s.to_sym
122-
super([], options, &block)
111+
super([], **options, &block)
123112
end
124113

125114
##

rdf-virtuoso.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
1010
s.homepage = 'https://github.com/ruby-rdf/rdf-virtuoso'
1111
s.summary = %q{An RDF.rb extension library for interacting with a Virtuoso rdf store}
1212
s.description = %q{An RDF.rb extension library for interacting with a Virtuoso rdf store.\nSupports SPARQL 1.1 UPDATE extensions and some Virtuoso specific commands.}
13-
s.licenses = ['GPL-3.0']
13+
s.license = 'Unlicense'
1414

1515
s.files = %w(README.md LICENSE VERSION) + Dir.glob('lib/**/*.rb')
1616
s.require_paths = ['lib']

0 commit comments

Comments
 (0)