Skip to content

Commit

Permalink
Finish 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Dec 26, 2020
2 parents 2f98a5d + 3c802f0 commit ceb41d3
Show file tree
Hide file tree
Showing 22 changed files with 267 additions and 198 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,43 @@
# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop.

name: CI
on:
push:
branches: [ '**' ]
pull_request:
branches: [ develop ]
workflow_dispatch:

jobs:
tests:
name: Ruby ${{ matrix.ruby }} ${{ matrix.gemfile }}
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
runs-on: ubuntu-latest
env:
CI: true
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
strategy:
fail-fast: false
matrix:
ruby:
- 2.4
- 2.5
- 2.6
- 2.7
#- ruby-head # Until net-http-persistent updated
- jruby
gemfile:
- Gemfile
- Gemfile-pure
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Run tests
run: bundle exec rspec spec

2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -11,10 +11,12 @@ rvm:
- 2.5
- 2.6
- 2.7
- ruby-head
- jruby
cache: bundler
sudo: false
matrix:
allow_failures:
- rvm: ruby-head
- rvm: jruby
dist: trusty
14 changes: 8 additions & 6 deletions CONTRIBUTING.md
Expand Up @@ -6,7 +6,7 @@ Community contributions are essential for keeping Ruby RDF great. We want to kee

This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage development and release activity. All submissions _must_ be on a feature branch based on the _develop_ branch to ease staging and integration.

* create or respond to an issue on the [Github Repository](http://github.com/ruby-rdf/sparql-client/issues)
* create or respond to an issue on the [Github Repository](https://github.com/ruby-rdf/sparql-client/issues)
* Fork and clone the repo:
`git clone git@github.com:your-username/sparql-client.git`
* Install bundle:
Expand All @@ -28,9 +28,11 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage devel
enough, be assured we will eventually add you in there.
* Do note that in order for us to merge any non-trivial changes (as a rule
of thumb, additions larger than about 15 lines of code), we need an
explicit [public domain dedication][PDD] on record from you.
explicit [public domain dedication][PDD] on record from you,
which you will be asked to agree to on the first commit to a repo within the organization.
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.

[YARD]: http://yardoc.org/
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
[pr]: https://github.com/ruby-rdf/sparql-client/compare/
[YARD]: https://yardoc.org/
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
[PDD]: https://unlicense.org/#unlicensing-contributions
[pr]: https://github.com/ruby-rdf/rdf/compare/
94 changes: 48 additions & 46 deletions README.md
Expand Up @@ -2,11 +2,12 @@

This is a [Ruby][] implementation of a [SPARQL][] client for [RDF.rb][].

* <http://ruby-rdf.github.com/sparql-client/>
* <https://ruby-rdf.github.com/sparql-client/>

[![Gem Version](https://badge.fury.io/rb/sparql-client.png)](http://badge.fury.io/rb/sparql-client)
[![Build Status](https://travis-ci.org/ruby-rdf/sparql-client.png?branch=master)](http://travis-ci.org/ruby-rdf/sparql-client)
[![Gem Version](https://badge.fury.io/rb/sparql-client.png)](https://badge.fury.io/rb/sparql-client)
[![Build Status](https://github.com/ruby-rdf/sparql-client/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/sparql-client/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/sparql-client/badge.svg?branch=master&service=github)](https://coveralls.io/github/ruby-rdf/sparql-client?branch=master)
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)

## Features

Expand All @@ -18,7 +19,7 @@ This is a [Ruby][] implementation of a [SPARQL][] client for [RDF.rb][].
* Supports tuple result sets in both XML, JSON, CSV and TSV formats, with JSON being
the preferred default for content-negotiation purposes.
* Supports graph results in any RDF serialization format understood by RDF.rb.
* Returns results using the [RDF.rb object model][RDF.rb model].
* Returns results using the RDF.rb object model.
* Supports accessing endpoints as read/write [`RDF::Repository`][RDF::Repository]
instances {SPARQL::Client::Repository}.

Expand Down Expand Up @@ -123,15 +124,15 @@ sparql.delete_data(data)

## Dependencies

* [Ruby](http://ruby-lang.org/) (>= 2.4)
* [RDF.rb](http://rubygems.org/gems/rdf) (~> 3.1)
* [Net::HTTP::Persistent](http://rubygems.org/gems/net-http-persistent) (~> 3.1)
* Soft dependency on [SPARQL](http://rubygems.org/gems/sparql) (~> 3.1)
* Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.10)
* [Ruby](https://ruby-lang.org/) (>= 2.4)
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.1)
* [Net::HTTP::Persistent](https://rubygems.org/gems/net-http-persistent) (~> 3.1)
* Soft dependency on [SPARQL](https://rubygems.org/gems/sparql) (~> 3.1)
* Soft dependency on [Nokogiri](https://rubygems.org/gems/nokogiri) (>= 1.10)

## Installation

The recommended installation method is via [RubyGems](http://rubygems.org/).
The recommended installation method is via [RubyGems](https://rubygems.org/).
To install the latest official release of the `SPARQL::Client` gem, do:

% [sudo] gem install sparql-client
Expand All @@ -145,31 +146,31 @@ To get a local working copy of the development repository, do:
Alternatively, download the latest development version as a tarball as
follows:

% wget http://github.com/ruby-rdf/sparql-client/tarball/master
% wget https://github.com/ruby-rdf/sparql-client/tarball/master

## Mailing List

* <http://lists.w3.org/Archives/Public/public-rdf-ruby/>
* <https://lists.w3.org/Archives/Public/public-rdf-ruby/>

## Authors

* [Arto Bendiken](http://github.com/bendiken) - <http://ar.to/>
* [Ben Lavender](http://github.com/bhuga) - <http://bhuga.net/>
* [Gregg Kellogg](http://github.com/gkellogg) - <http://greggkellogg.net/>
* [Arto Bendiken](https://github.com/artob) - <https://ar.to/>
* [Ben Lavender](https://github.com/bhuga) - <https://bhuga.net/>
* [Gregg Kellogg](https://github.com/gkellogg) - <https://greggkellogg.net/>

## Contributors

* [Christoph Badura](http://github.com/bad) - <http://github.com/bad>
* [James Hetherington](http://github.com/jamespjh) - <http://twitter.com/jamespjh>
* [Gabriel Horner](http://github.com/cldwalker) - <http://tagaholic.me/>
* [Nicholas Humfrey](http://github.com/njh) - <http://www.aelius.com/njh/>
* [Fumihiro Kato](http://github.com/fumi) - <http://fumi.me/>
* [David Nielsen](http://github.com/drankard) - <http://github.com/drankard>
* [Thamaraiselvan Poomalai](http://github.com/selvan) - <http://softonaut.blogspot.com/>
* [Michael Sokol](http://github.com/mikaa123) - <http://sokolmichael.com/>
* [Yves Raimond](http://github.com/moustaki) - <http://moustaki.org/>
* [Thomas Feron](http://github.com/thoferon) - <http://github.com/thoferon>
* [Nick Gottlieb](http://github.com/ngottlieb) - <http://www.nicholasgottlieb.com>
* [Christoph Badura](https://github.com/bad) - <https://github.com/bad>
* [James Hetherington](https://github.com/jamespjh) - <https://twitter.com/jamespjh>
* [Gabriel Horner](https://github.com/cldwalker) - <https://tagaholic.me/>
* [Nicholas Humfrey](https://github.com/njh) - <https://www.aelius.com/njh/>
* [Fumihiro Kato](https://github.com/fumi) - <https://fumi.me/>
* [David Nielsen](https://github.com/drankard) - <https://github.com/drankard>
* [Thamaraiselvan Poomalai](https://github.com/selvan) - <https://softonaut.blogspot.com/>
* [Michael Sokol](https://github.com/mikaa123) - <https://sokolmichael.com/>
* [Yves Raimond](https://github.com/moustaki) - <https://moustaki.org/>
* [Thomas Feron](https://github.com/thoferon) - <https://github.com/thoferon>
* [Nick Gottlieb](https://github.com/ngottlieb) - <https://www.nicholasgottlieb.com>

## Contributing
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.
Expand All @@ -184,31 +185,32 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
list in the the `README`. Alphabetical order applies.
* Do note that in order for us to merge any non-trivial changes (as a rule
of thumb, additions larger than about 15 lines of code), we need an
explicit [public domain dedication][PDD] on record from you.
explicit [public domain dedication][PDD] on record from you,
which you will be asked to agree to on the first commit to a repo within the organization.
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.

## Resources

* <http://ruby-rdf.github.com/sparql-client/>
* <http://github.com/ruby-rdf/sparql-client>
* <http://rubygems.org/gems/sparql-client>
* <http://raa.ruby-lang.org/project/sparql-client/>
* <http://www.ohloh.net/p/rdf>
* <https://ruby-rdf.github.com/sparql-client/>
* <https://github.com/ruby-rdf/sparql-client>
* <https://rubygems.org/gems/sparql-client>
* <https://raa.ruby-lang.org/project/sparql-client/>
* <https://www.ohloh.net/p/rdf>

## License

This is free and unencumbered public domain software. For more information,
see <http://unlicense.org/> or the accompanying {file:UNLICENSE} file.

[Ruby]: http://ruby-lang.org/
[RDF]: http://www.w3.org/RDF/
[SPARQL]: http://en.wikipedia.org/wiki/SPARQL
[SPARQL JSON]: http://www.w3.org/TR/rdf-sparql-json-res/
[RDF.rb]: http://rubygems.org/gems/rdf
[RDF.rb model]: http://blog.datagraph.org/2010/03/rdf-for-ruby
[RDF::Repository]: http://rubydoc.info/github/ruby-rdf/rdf/RDF/Repository
[DSL]: http://en.wikipedia.org/wiki/Domain-specific_language
see <https://unlicense.org/> or the accompanying {file:UNLICENSE} file.

[Ruby]: https://ruby-lang.org/
[RDF]: https://www.w3.org/RDF/
[SPARQL]: https://en.wikipedia.org/wiki/SPARQL
[SPARQL JSON]: https://www.w3.org/TR/rdf-sparql-json-res/
[RDF.rb]: https://rubygems.org/gems/rdf
[RDF::Repository]: https://rubydoc.info/github/ruby-rdf/rdf/RDF/Repository
[DSL]: https://en.wikipedia.org/wiki/Domain-specific_language
"domain-specific language"
[YARD]: http://yardoc.org/
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
[PDD]: http://unlicense.org/#unlicensing-contributions
[Backports]: http://rubygems.org/gems/backports
[YARD]: https://yardoc.org/
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
[PDD]: https://unlicense.org/#unlicensing-contributions
[Backports]: https://rubygems.org/gems/backports
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -2,7 +2,7 @@
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
require 'rubygems'
begin
require 'rakefile' # @see http://github.com/bendiken/rakefile
require 'rakefile' # @see https://github.com/artob/rakefile
rescue LoadError => e
end

Expand Down
2 changes: 1 addition & 1 deletion UNLICENSE
Expand Up @@ -21,4 +21,4 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
For more information, please refer to <https://unlicense.org/>
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
3.1.0
3.1.1
57 changes: 27 additions & 30 deletions etc/doap.ttl
@@ -1,4 +1,4 @@
@base <http://rubygems.org/gems/sparql-client> .
@base <https://rubygems.org/gems/sparql-client> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dc: <http://purl.org/dc/terms/> .
Expand All @@ -7,27 +7,26 @@

<> a doap:Project ;
doap:name "SPARQL::Client" ;
doap:homepage <http://rubygems.org/gems/sparql-client> ;
doap:license <http://creativecommons.org/licenses/publicdomain/> ;
doap:homepage <https://github.com/ruby-rdf/sparql-client> ;
doap:license <https://unlicense.org/1.0/> ;
doap:shortdesc "SPARQL client for RDF.rb."@en ;
doap:description """Executes SPARQL queries and updates against a remote SPARQL 1.0 or 1.1 endpoint,
or against a local repository. Generates SPARQL queries using a simple DSL."""@en ;
doap:created "2007-11-03" ;
doap:platform "Ruby" ;
doap:category <http://dbpedia.org/resource/Resource_Description_Framework>,
<http://dbpedia.org/resource/Ruby_(programming_language)> ;
doap:implements <http://www.w3.org/TR/sparql11-query/>,
<http://www.w3.org/TR/sparql11-update/>,
<http://www.w3.org/TR/sparql11-results-json/>,
<http://www.w3.org/TR/sparql11-results-csv-tsv/>,
<http://www.w3.org/TR/rdf-sparql-XMLres/> ;
doap:download-page <http://rubygems.org/gems/sparql-client>;
doap:bug-database <http://rubygems.org/gems/sparql-client/issues> ;
doap:blog <http://ar.to/>, <http://blog.datagraph.org/>, <http://greggkellogg.net/> ;
doap:vendor <http://datagraph.org/> ;
doap:developer <http://ar.to/#self>, <http://bhuga.net/#ben>, <http://greggkellogg.net/foaf#me> ;
doap:maintainer <http://ar.to/#self>, <http://bhuga.net/#ben>, <http://greggkellogg.net/foaf#me> ;
doap:documenter <http://ar.to/#self>, <http://bhuga.net/#ben>, <http://greggkellogg.net/foaf#me> ;
doap:programming-language "Ruby" ;
doap:category <https://dbpedia.org/resource/Resource_Description_Framework>,
<https://dbpedia.org/resource/Ruby_(programming_language)> ;
doap:implements <https://www.w3.org/TR/sparql11-query/>,
<https://www.w3.org/TR/sparql11-update/>,
<https://www.w3.org/TR/sparql11-results-json/>,
<https://www.w3.org/TR/sparql11-results-csv-tsv/>,
<https://www.w3.org/TR/rdf-sparql-XMLres/> ;
doap:download-page <https://github.com/ruby-rdf/sparql-client>;
doap:bug-database <https://github.com/ruby-rdf/sparql-client/sparql-client/issues> ;
doap:blog <https://ar.to/>, <https://greggkellogg.net/> ;
doap:developer <https://ar.to/#self>, <https://bhuga.net/#ben>, <https://greggkellogg.net/foaf#me> ;
doap:maintainer <https://greggkellogg.net/foaf#me> ;
doap:documenter <https://ar.to/#self>, <https://bhuga.net/#ben>, <https://greggkellogg.net/foaf#me> ;
doap:helper [a foaf:Person ;
foaf:name "Christoph Badura" ;
foaf:mbox_sha1sum "3a9c4bbe13feec63b1c8292ebf90e8da6caa0afd"] ;
Expand Down Expand Up @@ -61,28 +60,26 @@
doap:helper [a foaf:Person ;
foaf:name "Thomas Feron" ;
foaf:mbox_sha1sum "8c6ba34fcf8705a63af3858140ba0107b9ee756a"] ;
foaf:maker <http://ar.to/#self> ;
dc:creator <http://ar.to/#self> .
foaf:maker <https://ar.to/#self> ;
dc:creator <https://ar.to/#self> .

<http://ar.to/#self> a foaf:Person ;
<http:s//ar.to/#self> a foaf:Person ;
foaf:name "Arto Bendiken" ;
foaf:mbox <mailto:arto@bendiken.net> ;
foaf:mbox_sha1sum "a033f652c84a4d73b8c26d318c2395699dd2bdfb",
"d0737cceb55eb7d740578d2db1bc0727e3ed49ce" ;
foaf:homepage <http://ar.to/> ;
foaf:made <> ;
rdfs:isDefinedBy <http://datagraph.org/bendiken/foaf> .
foaf:homepage <https://ar.to/> ;
foaf:made <> .

<http://bhuga.net/#ben> a foaf:Person ;
<https://bhuga.net/#ben> a foaf:Person ;
foaf:name "Ben Lavender" ;
foaf:mbox <mailto:blavender@gmail.com> ;
foaf:mbox_sha1sum "dbf45f4ffbd27b67aa84f02a6a31c144727d10af" ;
foaf:homepage <http://bhuga.net/> ;
rdfs:isDefinedBy <http://datagraph.org/bhuga/foaf> .
foaf:homepage <https://bhuga.net/> .

<http://greggkellogg.net/foaf#me> a foaf:Person ;
<https://greggkellogg.net/foaf#me> a foaf:Person ;
foaf:name "Gregg Kellogg" ;
foaf:mbox <mailto:gregg@greggkellogg.net> ;
foaf:mbox_sha1sum "35bc44e6d0070e5ad50ccbe0d24403c96af2b9bd" ;
foaf:homepage <http://greggkellogg.net/>;
rdfs:isDefinedBy <http://greggkellogg.net/foaf> .
foaf:homepage <https://greggkellogg.net/>;
rdfs:isDefinedBy <https://greggkellogg.net/foaf> .
8 changes: 8 additions & 0 deletions examples/issue92.rb
@@ -0,0 +1,8 @@
require 'rdf'
require 'sparql/client'
dnbt = RDF::Vocabulary.new("https://d-nb.info/standards/elementset/dnb#")
rdf_gndid = RDF::Literal.new("https://d-nb.info/gnd/1059461498")
sparql_client = SPARQL::Client.new("http://127.0.0.1:9292/")
gndo = RDF::Vocabulary.new("http://d-nb.info/gnd/standards/elementset/gnd#")
query = sparql_client.select.where([:subject, dnbt.deprecatedUri, rdf_gndid]).where([:subject, gndo.gndIdentifier, :gndid])
query.each_solution { |solution| new_gndid = solution[:gndid].to_s }
5 changes: 5 additions & 0 deletions examples/issue96.rb
@@ -0,0 +1,5 @@
require 'sparql/client'
SPARQL::Client::Query
.select
.where(%i[s p o])
.values(:s, RDF::URI('http://example.com/1'), RDF::URI('http://example.com/2'))
2 changes: 0 additions & 2 deletions examples/workergnome-literal-issue.rb
@@ -1,13 +1,11 @@
#require 'rdf/turtle'
require 'sparql/client'
require 'byebug'

sparql = SPARQL::Client.new("http://data.americanartcollaborative.org/sparql")
uri = RDF.URI("http://data.crystalbridges.org/object/2258")
label = RDF::RDFS.label

query = sparql.construct([uri, label, :o]).where([uri, label, :o])
require 'byebug'; byebug
query.each_statement do |s|
puts s.object.inspect
end
Expand Down

0 comments on commit ceb41d3

Please sign in to comment.