{"action":"created","issue":{"url":"https://api.github.com/repos/kasei/attean/issues/61","labels_url":"https://api.github.com/repos/kasei/attean/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/kasei/attean/issues/61/comments","events_url":"https://api.github.com/repos/kasei/attean/issues/61/events","html_url":"https://github.com/kasei/attean/issues/61","id":128540672,"number":61,"title":"Patterns as arguments to get_triples, get_quads, etc","user":{"login":"kjetilk","id":154068,"avatar_url":"https://avatars.githubusercontent.com/u/154068?v=3","gravatar_id":"","url":"https://api.github.com/users/kjetilk","html_url":"https://github.com/kjetilk","followers_url":"https://api.github.com/users/kjetilk/followers","following_url":"https://api.github.com/users/kjetilk/following{/other_user}","gists_url":"https://api.github.com/users/kjetilk/gists{/gist_id}","starred_url":"https://api.github.com/users/kjetilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjetilk/subscriptions","organizations_url":"https://api.github.com/users/kjetilk/orgs","repos_url":"https://api.github.com/users/kjetilk/repos","events_url":"https://api.github.com/users/kjetilk/events{/privacy}","received_events_url":"https://api.github.com/users/kjetilk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-25T13:47:45Z","updated_at":"2016-01-26T01:59:05Z","closed_at":null,"body":"I have an idea that I just wanted to ask about:\r\n\r\nI just intuitively did \r\n```perl \r\n$self->count_triples_estimate($pattern)\r\n``` \r\nand it didn't work, and it seems it shouldn't now. But intuitively, shouldn't that work? \r\n\r\nSo, I was thinking about how it could be made to work without placing too much burden on implementators. What I came up with is roughly that you'd need the idiom \r\n\r\n```perl\r\nsub get_triples {\r\n  my ($subject, $predicate, $object) = @_;\r\n  if ($subject->does('Attean::API::TriplePattern')) {\r\n    ($subject, $predicate, $object) = $subject->make_search_arguments;\r\n  }\r\n ...\r\n```\r\nand similarly for ```get_quads```. Then, ```make_search_arguments``` or whatever it is called could be implemented in ```Attean::API::TripleOrQuadPattern``` to return ```undef``` for variables (and blanks?).\r\nThe problem is that you'd need to have those everywhere, ```count_triples```, etc... Not very pretty and a lot of duplication.\r\n\r\nSo, perhaps ```get_triples``` and friends should only take patterns as arguments, and instead allow ```undef```s in the constructor of patterns, and generate variables from them?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kasei/attean/issues/comments/174773526","html_url":"https://github.com/kasei/attean/issues/61#issuecomment-174773526","issue_url":"https://api.github.com/repos/kasei/attean/issues/61","id":174773526,"user":{"login":"kasei","id":4872,"avatar_url":"https://avatars.githubusercontent.com/u/4872?v=3","gravatar_id":"","url":"https://api.github.com/users/kasei","html_url":"https://github.com/kasei","followers_url":"https://api.github.com/users/kasei/followers","following_url":"https://api.github.com/users/kasei/following{/other_user}","gists_url":"https://api.github.com/users/kasei/gists{/gist_id}","starred_url":"https://api.github.com/users/kasei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasei/subscriptions","organizations_url":"https://api.github.com/users/kasei/orgs","repos_url":"https://api.github.com/users/kasei/repos","events_url":"https://api.github.com/users/kasei/events{/privacy}","received_events_url":"https://api.github.com/users/kasei/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T01:59:05Z","updated_at":"2016-01-26T01:59:05Z","body":"How would you feel about just warning/dying if you pass a pattern object to a method expecting nodes? I think I'm hesitant to add lots of different ways the same method can be invoked. And if it died, you could change `get_triples($pattern)` to `get_triples($pattern->values)`, right?"}}