Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 76b2a20

Browse files
committedDec 23, 2020
Explicitlly require 'delegate' and add example for #92.
1 parent 7da4005 commit 76b2a20

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
 

‎examples/issue92.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require 'rdf'
2+
require 'sparql/client'
3+
dnbt = RDF::Vocabulary.new("https://d-nb.info/standards/elementset/dnb#")
4+
rdf_gndid = RDF::Literal.new("https://d-nb.info/gnd/1059461498")
5+
sparql_client = SPARQL::Client.new("http://127.0.0.1:9292/")
6+
gndo = RDF::Vocabulary.new("http://d-nb.info/gnd/standards/elementset/gnd#")
7+
query = sparql_client.select.where([:subject, dnbt.deprecatedUri, rdf_gndid]).where([:subject, gndo.gndIdentifier, :gndid])
8+
query.each_solution { |solution| new_gndid = solution[:gndid].to_s }

‎lib/sparql/client/query.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'delegate'
2+
13
class SPARQL::Client
24
##
35
# A SPARQL query builder.

0 commit comments

Comments
 (0)
Please sign in to comment.