Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid CLI examples in the README #51

Open
artob opened this issue Jan 4, 2025 · 1 comment
Open

Fix invalid CLI examples in the README #51

artob opened this issue Jan 4, 2025 · 1 comment
Assignees
Labels
bug documentation Improvements or additions to documentation

Comments

@artob
Copy link
Member

artob commented Jan 4, 2025

The CLI examples in the README do not actually currently succeed, by the looks of it because we're trying use the N-Triples parser instead of the Turtle parser:

% gem install sparql
% wget https://raw.githubusercontent.com/ruby-rdf/sparql/refs/heads/develop/etc/doap.ttl
% sparql server doap.ttl
ERROR [line 1] Expected subject (found: "@prefix dc: <http://purl.org/dc/terms/> .")
/opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/util/logger.rb:94:in `log_error': Expected subject (found: "@prefix dc: <http://purl.org/dc/terms/> .") (RDF::ReaderError)
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/reader.rb:548:in `fail_subject'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/ntriples/reader.rb:230:in `block in read_triple'
	from <internal:kernel>:187:in `loop'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/ntriples/reader.rb:224:in `read_triple'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/reader.rb:529:in `read_statement'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/reader.rb:419:in `block in each_statement'
	from <internal:kernel>:187:in `loop'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/reader.rb:418:in `each_statement'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/mixin/writable.rb:129:in `insert_statements'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/mixin/mutable.rb:54:in `block in load'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/reader.rb:320:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/reader.rb:244:in `new'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/reader.rb:244:in `block in open'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/util/file.rb:340:in `open_file'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/reader.rb:221:in `open'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/mixin/mutable.rb:44:in `load'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/repository.rb:124:in `block (2 levels) in load'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/repository.rb:123:in `each'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/repository.rb:123:in `block in load'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/repository.rb:163:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/repository.rb:122:in `new'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/rdf-3.3.2/lib/rdf/repository.rb:122:in `load'
	from /opt/homebrew/lib/ruby/gems/3.3.0/gems/sparql-3.3.1/bin/sparql:150:in `<top (required)>'
	from /opt/homebrew/opt/ruby/bin/sparql:25:in `load'
	from /opt/homebrew/opt/ruby/bin/sparql:25:in `<main>'
@artob artob added bug documentation Improvements or additions to documentation labels Jan 4, 2025
@gkellogg
Copy link
Member

gkellogg commented Jan 4, 2025

Looks like Rack 3.x removed Rack::Server, which the CLI uses. That doesn't seem to address finding the wrong reader, but may be related.

There is spec/readme_spec.rb but has a PENDING mark for this particular test. Code was added to skip the server test in 2015 in 1.99.0, so it's been broken for a while, even before the gem change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants