{"action":"created","issue":{"url":"https://api.github.com/repos/dpla/KriKri/issues/181","labels_url":"https://api.github.com/repos/dpla/KriKri/issues/181/labels{/name}","comments_url":"https://api.github.com/repos/dpla/KriKri/issues/181/comments","events_url":"https://api.github.com/repos/dpla/KriKri/issues/181/events","html_url":"https://github.com/dpla/KriKri/pull/181","id":97143501,"number":181,"title":"field value report with csv download","user":{"login":"AudreyAltman","id":3615206,"avatar_url":"https://avatars.githubusercontent.com/u/3615206?v=3","gravatar_id":"","url":"https://api.github.com/users/AudreyAltman","html_url":"https://github.com/AudreyAltman","followers_url":"https://api.github.com/users/AudreyAltman/followers","following_url":"https://api.github.com/users/AudreyAltman/following{/other_user}","gists_url":"https://api.github.com/users/AudreyAltman/gists{/gist_id}","starred_url":"https://api.github.com/users/AudreyAltman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AudreyAltman/subscriptions","organizations_url":"https://api.github.com/users/AudreyAltman/orgs","repos_url":"https://api.github.com/users/AudreyAltman/repos","events_url":"https://api.github.com/users/AudreyAltman/events{/privacy}","received_events_url":"https://api.github.com/users/AudreyAltman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-24T20:45:55Z","updated_at":"2015-07-24T22:35:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dpla/KriKri/pulls/181","html_url":"https://github.com/dpla/KriKri/pull/181","diff_url":"https://github.com/dpla/KriKri/pull/181.diff","patch_url":"https://github.com/dpla/KriKri/pull/181.patch"},"body":"This introduces field value reports based on data that has been indexed into Solr.  The field value reports show all values for a given field in documents with a given provider.  It addresses the following tickets:\r\nhttps://www.pivotaltracker.com/n/projects/1172184/stories/79608350\r\nhttps://www.pivotaltracker.com/n/projects/1172184/stories/79330180\r\nhttps://www.pivotaltracker.com/n/projects/1172184/stories/85081820\r\n\r\n__CSV downloads__\r\nThis only offers the reports as CSV downloads - there is no web interface for the reports. Each row of the CSV table has three columns: the reporting field, the document `id`, and the document's `isShownAt_id` link.\r\n\r\nIf a document has a missing value for the reporting field, it will show up in the CSV table with `__MISSING__` as the field value.\r\n\r\nIf there are no indexed documents for the given provider, a CSV table will be generated with only one row, containing the headers.\r\n\r\n__ActiveModel__\r\nIn this iteration of the code, `ActiveModelBase` is a superclass.  `FieldValueReport` and `Provider` have both been made subclasses of `ActiveModelBase`.  We may decide to change `ActiveModel` to a module, depending on the outcome of our conversation here: https://gist.github.com/AudreyAltman/002b75e291fc5c7f4ffe  This change can be made in a separate PR so that @guegueng can have access to these reports ASAP.\r\n\r\n__Persistence__\r\nIn this iteration, field value reports are not persisted, but we may decide to persist them in the future if there are performance issues.\r\n\r\n__Relationship between `FieldValueReport` and `Provider`__\r\nThe field value report route is nested under the provider route.  This model could be extended to all other reports and to records so we can do away with the `current_provider` strategy.\r\n\r\n`FieldValueReports` and `Provider` have a relationship that approximates a `belongs_to` - `has_many` relationship, considering that `ActiveModel` does not support these relationships in the way that `ActiveRecord` does.  `FieldValueReport` has a `provider` attribute, and `Provider` has a (lazy-loading) `field_value_reports` attribute. \r\n\r\nI considered using the `activemodel-associations` gem to manage the relationship between `FieldValueReport` and `Provider`, but it turns out that this gem only works if you are associating an `ActiveModel` object with an `ActiveRecord` object, so it is not appropriate here.\r\n\r\n__QaReport code__\r\nI did not delete any of the QaReport code that @no-reply wrote b/c I wasn't sure if we would want to return to it any any time.  This code generates QA reports (including field value reports) from data that has been stored in Marmotta."},"comment":{"url":"https://api.github.com/repos/dpla/KriKri/issues/comments/124749779","html_url":"https://github.com/dpla/KriKri/pull/181#issuecomment-124749779","issue_url":"https://api.github.com/repos/dpla/KriKri/issues/181","id":124749779,"user":{"login":"AudreyAltman","id":3615206,"avatar_url":"https://avatars.githubusercontent.com/u/3615206?v=3","gravatar_id":"","url":"https://api.github.com/users/AudreyAltman","html_url":"https://github.com/AudreyAltman","followers_url":"https://api.github.com/users/AudreyAltman/followers","following_url":"https://api.github.com/users/AudreyAltman/following{/other_user}","gists_url":"https://api.github.com/users/AudreyAltman/gists{/gist_id}","starred_url":"https://api.github.com/users/AudreyAltman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AudreyAltman/subscriptions","organizations_url":"https://api.github.com/users/AudreyAltman/orgs","repos_url":"https://api.github.com/users/AudreyAltman/repos","events_url":"https://api.github.com/users/AudreyAltman/events{/privacy}","received_events_url":"https://api.github.com/users/AudreyAltman/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T22:35:15Z","updated_at":"2015-07-24T22:35:15Z","body":"@anarchivist re: your questions - I don't know, but if you have any suggestions for improving performance, queuing, etc. I would be interested to hear."}}