{"action":"created","issue":{"url":"https://api.github.com/repos/google/cayley/issues/208","labels_url":"https://api.github.com/repos/google/cayley/issues/208/labels{/name}","comments_url":"https://api.github.com/repos/google/cayley/issues/208/comments","events_url":"https://api.github.com/repos/google/cayley/issues/208/events","html_url":"https://github.com/google/cayley/pull/208","id":56975108,"number":208,"title":"Go API","user":{"login":"barakmich","id":98356,"avatar_url":"https://avatars.githubusercontent.com/u/98356?v=3","gravatar_id":"","url":"https://api.github.com/users/barakmich","html_url":"https://github.com/barakmich","followers_url":"https://api.github.com/users/barakmich/followers","following_url":"https://api.github.com/users/barakmich/following{/other_user}","gists_url":"https://api.github.com/users/barakmich/gists{/gist_id}","starred_url":"https://api.github.com/users/barakmich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barakmich/subscriptions","organizations_url":"https://api.github.com/users/barakmich/orgs","repos_url":"https://api.github.com/users/barakmich/repos","events_url":"https://api.github.com/users/barakmich/events{/privacy}","received_events_url":"https://api.github.com/users/barakmich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-09T00:02:18Z","updated_at":"2015-02-09T00:28:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/google/cayley/pulls/208","html_url":"https://github.com/google/cayley/pull/208","diff_url":"https://github.com/google/cayley/pull/208.diff","patch_url":"https://github.com/google/cayley/pull/208.patch"},"body":"First run at a Go-importable API for Cayley. This would be the first step into using Cayley as a library and tackling #64 to a degree.\r\n\r\nIt's more or less a port of Gremlin into Go syntax with a little magic behind the scenes. Evaluation still remains unchanged (that'd be a nice followup PR -- get all top level nodes, get all tags, etc) but it's much, much easier to build iterator trees now.\r\n\r\nNeeds a large amount of documentation before committing. Sending the PR for initial feedback.\r\n\r\n/cc @sdboyer @kortschak "},"comment":{"url":"https://api.github.com/repos/google/cayley/issues/comments/73442506","html_url":"https://github.com/google/cayley/pull/208#issuecomment-73442506","issue_url":"https://api.github.com/repos/google/cayley/issues/208","id":73442506,"user":{"login":"barakmich","id":98356,"avatar_url":"https://avatars.githubusercontent.com/u/98356?v=3","gravatar_id":"","url":"https://api.github.com/users/barakmich","html_url":"https://github.com/barakmich","followers_url":"https://api.github.com/users/barakmich/followers","following_url":"https://api.github.com/users/barakmich/following{/other_user}","gists_url":"https://api.github.com/users/barakmich/gists{/gist_id}","starred_url":"https://api.github.com/users/barakmich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barakmich/subscriptions","organizations_url":"https://api.github.com/users/barakmich/orgs","repos_url":"https://api.github.com/users/barakmich/repos","events_url":"https://api.github.com/users/barakmich/events{/privacy}","received_events_url":"https://api.github.com/users/barakmich/received_events","type":"User","site_admin":false},"created_at":"2015-02-09T00:28:01Z","updated_at":"2015-02-09T00:28:01Z","body":"FWIW, a quick run at a separate app using Cayley as a library:\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\r\n\t\"github.com/google/cayley/graph\"\r\n\t_ \"github.com/google/cayley/graph/memstore\"\r\n\t\"github.com/google/cayley/graph/path\"\r\n\t\"github.com/google/cayley/quad\"\r\n\t_ \"github.com/google/cayley/writer\"\r\n)\r\n\r\nfunc main() {\r\n\t// Could have a helper function for memstore like cases\r\n\tqs, _ := graph.NewQuadStore(\"memstore\", \"\", nil)\r\n\tw, _ := graph.NewQuadWriter(\"single\", qs, nil)\r\n\r\n\tw.AddQuad(quad.Quad{\"food\", \"is\", \"good\", \"\"})\r\n\r\n\tp := path.StartPath(qs, \"food\").Out(\"is\")\r\n\r\n\t// Could be added to the library\r\n\tit := p.BuildIterator()\r\n\tfor graph.Next(it) {\r\n\t\tv := qs.NameOf(it.Result())\r\n\t\tfmt.Println(v)\r\n\t}\r\n}\r\n\r\n```"}}