{"action":"opened","number":214,"pull_request":{"url":"https://api.github.com/repos/ruby-rdf/rdf/pulls/214","id":46758500,"html_url":"https://github.com/ruby-rdf/rdf/pull/214","diff_url":"https://github.com/ruby-rdf/rdf/pull/214.diff","patch_url":"https://github.com/ruby-rdf/rdf/pull/214.patch","issue_url":"https://api.github.com/repos/ruby-rdf/rdf/issues/214","number":214,"state":"open","locked":false,"title":"Alternative to splat argument insert/update/delete in `RDF::Mutable` and `RDF::Writable`","user":{"login":"jperville","id":834791,"avatar_url":"https://avatars.githubusercontent.com/u/834791?v=3","gravatar_id":"","url":"https://api.github.com/users/jperville","html_url":"https://github.com/jperville","followers_url":"https://api.github.com/users/jperville/followers","following_url":"https://api.github.com/users/jperville/following{/other_user}","gists_url":"https://api.github.com/users/jperville/gists{/gist_id}","starred_url":"https://api.github.com/users/jperville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jperville/subscriptions","organizations_url":"https://api.github.com/users/jperville/orgs","repos_url":"https://api.github.com/users/jperville/repos","events_url":"https://api.github.com/users/jperville/events{/privacy}","received_events_url":"https://api.github.com/users/jperville/received_events","type":"User","site_admin":false},"body":"This PR introduces new methods in `RDF::Writable` and `RDF::Mutable` to complement the existing `RDF::Writable#insert`, `RDF::Mutable#insert`, `RDF::Mutable#update` and `RDF::Mutable#delete` methods with a non-splat argument alternative.\r\n\r\nThe problems with splat argument syntax:\r\n - it is limited to 130000 statements or so, as seen [here](http://stackoverflow.com/questions/28703587/systemstackerror-when-pushing-more-than-130798-objects-into-an-array)\r\n - it is extremely inefficient when passing a computed Array (or other Enumerable) of statements (converting a 10000 element Array into splat argument can be 100 times slower as just passing the Array directly), as seen in JuanitoFatas/fast-ruby#76.\r\n\r\nWith the new methods `RDF::Writable#insertn`, `RDF::Mutable#insertn`, `RDF::Mutable#updaten` and `RDF::Mutable#deleten`, one can safely refactor code like [this](https://github.com/ruby-rdf/spira/blob/459d49554a064bd05be9a3442774316ea53c1b87/lib/spira/utils.rb#L24):\r\n```ruby\r\nrepository.insert *update_repository\r\nrepository.delete *(old_subject_statements + old_object_statements)\r\n```\r\n\r\nTo this:\r\n```ruby\r\nrepository.insertn update_repository\r\nrepository.deleten(old_subject_statements + old_object_statements)\r\n```","created_at":"2015-10-05T09:18:04Z","updated_at":"2015-10-05T09:18:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ruby-rdf/rdf/pulls/214/commits","review_comments_url":"https://api.github.com/repos/ruby-rdf/rdf/pulls/214/comments","review_comment_url":"https://api.github.com/repos/ruby-rdf/rdf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ruby-rdf/rdf/issues/214/comments","statuses_url":"https://api.github.com/repos/ruby-rdf/rdf/statuses/f668af1108c058fa54b4ea0d9990799bd004fee9","head":{"label":"PerfectMemory:rdf-writable-insertn","ref":"rdf-writable-insertn","sha":"f668af1108c058fa54b4ea0d9990799bd004fee9","user":{"login":"PerfectMemory","id":1081146,"avatar_url":"https://avatars.githubusercontent.com/u/1081146?v=3","gravatar_id":"","url":"https://api.github.com/users/PerfectMemory","html_url":"https://github.com/PerfectMemory","followers_url":"https://api.github.com/users/PerfectMemory/followers","following_url":"https://api.github.com/users/PerfectMemory/following{/other_user}","gists_url":"https://api.github.com/users/PerfectMemory/gists{/gist_id}","starred_url":"https://api.github.com/users/PerfectMemory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PerfectMemory/subscriptions","organizations_url":"https://api.github.com/users/PerfectMemory/orgs","repos_url":"https://api.github.com/users/PerfectMemory/repos","events_url":"https://api.github.com/users/PerfectMemory/events{/privacy}","received_events_url":"https://api.github.com/users/PerfectMemory/received_events","type":"Organization","site_admin":false},"repo":{"id":43433901,"name":"rdf","full_name":"PerfectMemory/rdf","owner":{"login":"PerfectMemory","id":1081146,"avatar_url":"https://avatars.githubusercontent.com/u/1081146?v=3","gravatar_id":"","url":"https://api.github.com/users/PerfectMemory","html_url":"https://github.com/PerfectMemory","followers_url":"https://api.github.com/users/PerfectMemory/followers","following_url":"https://api.github.com/users/PerfectMemory/following{/other_user}","gists_url":"https://api.github.com/users/PerfectMemory/gists{/gist_id}","starred_url":"https://api.github.com/users/PerfectMemory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PerfectMemory/subscriptions","organizations_url":"https://api.github.com/users/PerfectMemory/orgs","repos_url":"https://api.github.com/users/PerfectMemory/repos","events_url":"https://api.github.com/users/PerfectMemory/events{/privacy}","received_events_url":"https://api.github.com/users/PerfectMemory/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PerfectMemory/rdf","description":"RDF.rb is a pure-Ruby library for working with Resource Description Framework (RDF) data.","fork":true,"url":"https://api.github.com/repos/PerfectMemory/rdf","forks_url":"https://api.github.com/repos/PerfectMemory/rdf/forks","keys_url":"https://api.github.com/repos/PerfectMemory/rdf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PerfectMemory/rdf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PerfectMemory/rdf/teams","hooks_url":"https://api.github.com/repos/PerfectMemory/rdf/hooks","issue_events_url":"https://api.github.com/repos/PerfectMemory/rdf/issues/events{/number}","events_url":"https://api.github.com/repos/PerfectMemory/rdf/events","assignees_url":"https://api.github.com/repos/PerfectMemory/rdf/assignees{/user}","branches_url":"https://api.github.com/repos/PerfectMemory/rdf/branches{/branch}","tags_url":"https://api.github.com/repos/PerfectMemory/rdf/tags","blobs_url":"https://api.github.com/repos/PerfectMemory/rdf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PerfectMemory/rdf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PerfectMemory/rdf/git/refs{/sha}","trees_url":"https://api.github.com/repos/PerfectMemory/rdf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PerfectMemory/rdf/statuses/{sha}","languages_url":"https://api.github.com/repos/PerfectMemory/rdf/languages","stargazers_url":"https://api.github.com/repos/PerfectMemory/rdf/stargazers","contributors_url":"https://api.github.com/repos/PerfectMemory/rdf/contributors","subscribers_url":"https://api.github.com/repos/PerfectMemory/rdf/subscribers","subscription_url":"https://api.github.com/repos/PerfectMemory/rdf/subscription","commits_url":"https://api.github.com/repos/PerfectMemory/rdf/commits{/sha}","git_commits_url":"https://api.github.com/repos/PerfectMemory/rdf/git/commits{/sha}","comments_url":"https://api.github.com/repos/PerfectMemory/rdf/comments{/number}","issue_comment_url":"https://api.github.com/repos/PerfectMemory/rdf/issues/comments{/number}","contents_url":"https://api.github.com/repos/PerfectMemory/rdf/contents/{+path}","compare_url":"https://api.github.com/repos/PerfectMemory/rdf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PerfectMemory/rdf/merges","archive_url":"https://api.github.com/repos/PerfectMemory/rdf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PerfectMemory/rdf/downloads","issues_url":"https://api.github.com/repos/PerfectMemory/rdf/issues{/number}","pulls_url":"https://api.github.com/repos/PerfectMemory/rdf/pulls{/number}","milestones_url":"https://api.github.com/repos/PerfectMemory/rdf/milestones{/number}","notifications_url":"https://api.github.com/repos/PerfectMemory/rdf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PerfectMemory/rdf/labels{/name}","releases_url":"https://api.github.com/repos/PerfectMemory/rdf/releases{/id}","created_at":"2015-09-30T13:17:25Z","updated_at":"2015-09-30T13:17:26Z","pushed_at":"2015-10-05T09:12:50Z","git_url":"git://github.com/PerfectMemory/rdf.git","ssh_url":"git@github.com:PerfectMemory/rdf.git","clone_url":"https://github.com/PerfectMemory/rdf.git","svn_url":"https://github.com/PerfectMemory/rdf","homepage":"http://rubygems.org/gems/rdf","size":4282,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"ruby-rdf:develop","ref":"develop","sha":"a3c55917e2db713a130143a9703c07159fecf137","user":{"login":"ruby-rdf","id":1738042,"avatar_url":"https://avatars.githubusercontent.com/u/1738042?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby-rdf","html_url":"https://github.com/ruby-rdf","followers_url":"https://api.github.com/users/ruby-rdf/followers","following_url":"https://api.github.com/users/ruby-rdf/following{/other_user}","gists_url":"https://api.github.com/users/ruby-rdf/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-rdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-rdf/subscriptions","organizations_url":"https://api.github.com/users/ruby-rdf/orgs","repos_url":"https://api.github.com/users/ruby-rdf/repos","events_url":"https://api.github.com/users/ruby-rdf/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-rdf/received_events","type":"Organization","site_admin":false},"repo":{"id":446086,"name":"rdf","full_name":"ruby-rdf/rdf","owner":{"login":"ruby-rdf","id":1738042,"avatar_url":"https://avatars.githubusercontent.com/u/1738042?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby-rdf","html_url":"https://github.com/ruby-rdf","followers_url":"https://api.github.com/users/ruby-rdf/followers","following_url":"https://api.github.com/users/ruby-rdf/following{/other_user}","gists_url":"https://api.github.com/users/ruby-rdf/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-rdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-rdf/subscriptions","organizations_url":"https://api.github.com/users/ruby-rdf/orgs","repos_url":"https://api.github.com/users/ruby-rdf/repos","events_url":"https://api.github.com/users/ruby-rdf/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-rdf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ruby-rdf/rdf","description":"RDF.rb is a pure-Ruby library for working with Resource Description Framework (RDF) data.","fork":false,"url":"https://api.github.com/repos/ruby-rdf/rdf","forks_url":"https://api.github.com/repos/ruby-rdf/rdf/forks","keys_url":"https://api.github.com/repos/ruby-rdf/rdf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruby-rdf/rdf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruby-rdf/rdf/teams","hooks_url":"https://api.github.com/repos/ruby-rdf/rdf/hooks","issue_events_url":"https://api.github.com/repos/ruby-rdf/rdf/issues/events{/number}","events_url":"https://api.github.com/repos/ruby-rdf/rdf/events","assignees_url":"https://api.github.com/repos/ruby-rdf/rdf/assignees{/user}","branches_url":"https://api.github.com/repos/ruby-rdf/rdf/branches{/branch}","tags_url":"https://api.github.com/repos/ruby-rdf/rdf/tags","blobs_url":"https://api.github.com/repos/ruby-rdf/rdf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruby-rdf/rdf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruby-rdf/rdf/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruby-rdf/rdf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruby-rdf/rdf/statuses/{sha}","languages_url":"https://api.github.com/repos/ruby-rdf/rdf/languages","stargazers_url":"https://api.github.com/repos/ruby-rdf/rdf/stargazers","contributors_url":"https://api.github.com/repos/ruby-rdf/rdf/contributors","subscribers_url":"https://api.github.com/repos/ruby-rdf/rdf/subscribers","subscription_url":"https://api.github.com/repos/ruby-rdf/rdf/subscription","commits_url":"https://api.github.com/repos/ruby-rdf/rdf/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruby-rdf/rdf/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruby-rdf/rdf/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruby-rdf/rdf/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruby-rdf/rdf/contents/{+path}","compare_url":"https://api.github.com/repos/ruby-rdf/rdf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruby-rdf/rdf/merges","archive_url":"https://api.github.com/repos/ruby-rdf/rdf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruby-rdf/rdf/downloads","issues_url":"https://api.github.com/repos/ruby-rdf/rdf/issues{/number}","pulls_url":"https://api.github.com/repos/ruby-rdf/rdf/pulls{/number}","milestones_url":"https://api.github.com/repos/ruby-rdf/rdf/milestones{/number}","notifications_url":"https://api.github.com/repos/ruby-rdf/rdf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruby-rdf/rdf/labels{/name}","releases_url":"https://api.github.com/repos/ruby-rdf/rdf/releases{/id}","created_at":"2009-12-22T17:30:41Z","updated_at":"2015-10-04T17:50:22Z","pushed_at":"2015-10-05T09:18:04Z","git_url":"git://github.com/ruby-rdf/rdf.git","ssh_url":"git@github.com:ruby-rdf/rdf.git","clone_url":"https://github.com/ruby-rdf/rdf.git","svn_url":"https://github.com/ruby-rdf/rdf","homepage":"http://rubygems.org/gems/rdf","size":5654,"stargazers_count":273,"watchers_count":273,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":65,"mirror_url":null,"open_issues_count":15,"forks":65,"open_issues":15,"watchers":273,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ruby-rdf/rdf/pulls/214"},"html":{"href":"https://github.com/ruby-rdf/rdf/pull/214"},"issue":{"href":"https://api.github.com/repos/ruby-rdf/rdf/issues/214"},"comments":{"href":"https://api.github.com/repos/ruby-rdf/rdf/issues/214/comments"},"review_comments":{"href":"https://api.github.com/repos/ruby-rdf/rdf/pulls/214/comments"},"review_comment":{"href":"https://api.github.com/repos/ruby-rdf/rdf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ruby-rdf/rdf/pulls/214/commits"},"statuses":{"href":"https://api.github.com/repos/ruby-rdf/rdf/statuses/f668af1108c058fa54b4ea0d9990799bd004fee9"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":92,"deletions":18,"changed_files":9}}