{"action":"closed","issue":{"url":"https://api.github.com/repos/ruby-rdf/rdf/issues/211","labels_url":"https://api.github.com/repos/ruby-rdf/rdf/issues/211/labels{/name}","comments_url":"https://api.github.com/repos/ruby-rdf/rdf/issues/211/comments","events_url":"https://api.github.com/repos/ruby-rdf/rdf/issues/211/events","html_url":"https://github.com/ruby-rdf/rdf/issues/211","id":107761286,"number":211,"title":"RDF::Reader validity and error handling is inconsistent","user":{"login":"no-reply","id":1361776,"avatar_url":"https://avatars.githubusercontent.com/u/1361776?v=3","gravatar_id":"","url":"https://api.github.com/users/no-reply","html_url":"https://github.com/no-reply","followers_url":"https://api.github.com/users/no-reply/followers","following_url":"https://api.github.com/users/no-reply/following{/other_user}","gists_url":"https://api.github.com/users/no-reply/gists{/gist_id}","starred_url":"https://api.github.com/users/no-reply/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/no-reply/subscriptions","organizations_url":"https://api.github.com/users/no-reply/orgs","repos_url":"https://api.github.com/users/no-reply/repos","events_url":"https://api.github.com/users/no-reply/events{/privacy}","received_events_url":"https://api.github.com/users/no-reply/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"no-reply","id":1361776,"avatar_url":"https://avatars.githubusercontent.com/u/1361776?v=3","gravatar_id":"","url":"https://api.github.com/users/no-reply","html_url":"https://github.com/no-reply","followers_url":"https://api.github.com/users/no-reply/followers","following_url":"https://api.github.com/users/no-reply/following{/other_user}","gists_url":"https://api.github.com/users/no-reply/gists{/gist_id}","starred_url":"https://api.github.com/users/no-reply/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/no-reply/subscriptions","organizations_url":"https://api.github.com/users/no-reply/orgs","repos_url":"https://api.github.com/users/no-reply/repos","events_url":"https://api.github.com/users/no-reply/events{/privacy}","received_events_url":"https://api.github.com/users/no-reply/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/ruby-rdf/rdf/milestones/2","html_url":"https://github.com/ruby-rdf/rdf/milestones/2.0","labels_url":"https://api.github.com/repos/ruby-rdf/rdf/milestones/2/labels","id":1108897,"number":2,"title":"2.0","description":"Features, deprecations and other changes targeted for RDF.rb 2.0","creator":{"login":"gkellogg","id":46296,"avatar_url":"https://avatars.githubusercontent.com/u/46296?v=3","gravatar_id":"","url":"https://api.github.com/users/gkellogg","html_url":"https://github.com/gkellogg","followers_url":"https://api.github.com/users/gkellogg/followers","following_url":"https://api.github.com/users/gkellogg/following{/other_user}","gists_url":"https://api.github.com/users/gkellogg/gists{/gist_id}","starred_url":"https://api.github.com/users/gkellogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkellogg/subscriptions","organizations_url":"https://api.github.com/users/gkellogg/orgs","repos_url":"https://api.github.com/users/gkellogg/repos","events_url":"https://api.github.com/users/gkellogg/events{/privacy}","received_events_url":"https://api.github.com/users/gkellogg/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":15,"state":"open","created_at":"2015-05-13T16:31:01Z","updated_at":"2015-12-15T21:58:38Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-09-22T17:26:48Z","updated_at":"2015-12-15T21:58:38Z","closed_at":"2015-12-15T21:58:38Z","body":"We have at least three different situations on failure cases for readers: \r\n  1. Output an error to stdout when parsing; return `true` when asking `valid?`\r\n  1. Raise an error, refuse to initialize.\r\n  1. Fail silently, return `true` on `valid?`.\r\n\r\nWith `validate: true`, *most* implementations raise an `RDF::ReaderError`. But:\r\n  1. Some still initialize and return `true` on `valid?`\r\n  1. Some output an error to stdout and return `true` when asking `valid?`\r\n\r\nCould we standardize a set of behavior for `valid?`, `validate: true`, and `validate: false` and add tests to `rdf-spec`?\r\n\r\n```ruby\r\n['rdf', 'rdf/turtle', 'rdf/rdfxml', 'rdf/trig', 'rdf/trix'].each { |lib| require lib }\r\n\r\nRDF::Reader.for(:ttl).new('blah').valid?\r\n# ERROR With input 'blah': Invalid token \"blah\"} (found \"blah\")\r\n# => true\r\n\r\nRDF::Reader.for(:ntriples).new('blah').valid?\r\n# RDF::ReaderError: ERROR [line 1] Expected subject (found: \"blah\")\r\n#   ...[trace]\r\n\r\nRDF::Reader.for(:nquads).new('blah').valid?\r\n# RDF::ReaderError: ERROR [line 1] Expected subject (found: \"blah\")\r\n#   ...[trace]\r\n\r\nRDF::Reader.for(:trig).new('blah').valid?\r\n# ERROR With input 'blah': Invalid token \"blah\"} (found \"blah\")\r\n# => true\r\n\r\nRDF::Reader.for(:trix).new('blah').valid?\r\n# => true\r\n\r\nRDF::Reader.for(:rdfxml).new('--!&*()blah--').valid?\r\n# RuntimeError: root must be a proxy not a NilClass\r\n#  ...[trace]\r\n```"}}