<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #826: Resource 'extra' fields</title>
    <link>http://localhost/ticket/826</link>
    <description>&lt;p&gt;
There are a number of extra properties we want to store in a resource:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;resource size (in bytes, no. triples etc.) - &lt;a class="ext-link" href="https://trac.dataco.coi.gov.uk/projects/datagov/ticket/673"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://trac.dataco.coi.gov.uk/projects/datagov/ticket/673&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;resource hash is 'static' (default) or 'changeable' - &lt;a class="ext-link" href="https://trac.dataco.coi.gov.uk/projects/datagov/ticket/674"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://trac.dataco.coi.gov.uk/projects/datagov/ticket/674&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;alternative link (e.g. TNA Web Archive) to use the link is broken - &lt;a class="ext-link" href="https://trac.dataco.coi.gov.uk/projects/datagov/ticket/173"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://trac.dataco.coi.gov.uk/projects/datagov/ticket/173&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
i.e. this is a much needed enhancement
&lt;/p&gt;
&lt;p&gt;
Need to be able to read/write these values in web interface and API.
&lt;/p&gt;
&lt;p&gt;
(At some point we may wish to have custom form widgets for these new fields in the resource table, but let's leave this for the future.)
&lt;/p&gt;
&lt;h1 id="Implementation"&gt;Implementation&lt;/h1&gt;
&lt;p&gt;
I suggest these are arbitrary key/value pairs, just like package extras, reusing &lt;a class="missing wiki"&gt;PackageExtra?&lt;/a&gt; code as much as possible.
(Other much more radical alternative is to move model to RDF.)
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/826</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>pudo</dc:creator>

      <pubDate>Mon, 03 Jan 2011 11:20:58 GMT</pubDate>
      <title>milestone set</title>
      <link>http://localhost/ticket/826#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                set to &lt;em&gt;iati-4&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>kindly</dc:creator>

      <pubDate>Fri, 21 Jan 2011 09:17:51 GMT</pubDate>
      <title>owner changed</title>
      <link>http://localhost/ticket/826#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;rgrp&lt;/em&gt; to &lt;em&gt;kindly&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Mon, 07 Feb 2011 10:27:28 GMT</pubDate>
      <title>milestone changed</title>
      <link>http://localhost/ticket/826#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;iati-4&lt;/em&gt; to &lt;em&gt;ckan-v1.4-sprint-1&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Fri, 11 Feb 2011 08:53:32 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/826#comment:4</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:4</guid>
      <description>
        &lt;p&gt;
It's great that the extras are added in-line with other Resource properties (as opposed to package extras which are a dict not off 'package' but off 'package.extras').
&lt;/p&gt;
&lt;p&gt;
However, the resource extra field keys are defined in config option "ckan.extra_resource_fields". This config option should be removed - extras need to be entirely flexible for our purposes. (In the next ticket we should make it possible to add/remove both keys and values from the Web UI or API.)
&lt;/p&gt;
&lt;p&gt;
It would also be good to tidy things in this direction: &lt;a class="ext-link" href="http://wiki.okfn.org/Coding_Standards"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://wiki.okfn.org/Coding_Standards&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I've merged from default to the branch enhancment_826_resource_extra_fields ready for you.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>pudo</dc:creator>

      <pubDate>Fri, 11 Feb 2011 09:04:55 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/826#comment:5</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:5</guid>
      <description>
        &lt;p&gt;
I want to strongly support david in his call for fully flexible extras: one of my use cases for them is to store the various bits of fallout from an archiving process, such as:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;last-status
&lt;/li&gt;&lt;li&gt;last-crawled
&lt;/li&gt;&lt;li&gt;last-etag
&lt;/li&gt;&lt;li&gt;last-expires
&lt;/li&gt;&lt;li&gt;last-md5
&lt;/li&gt;&lt;li&gt;failure-count
&lt;/li&gt;&lt;li&gt;fall-back-url
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
These are things needed to really archive the data well, but they have nothing to do with CKAN core ops. Essentially, the archiver is a seperate concern and it need not appear in the CKAN config.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>kindly</dc:creator>

      <pubDate>Fri, 11 Feb 2011 09:34:39 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/826#comment:6</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:6</guid>
      <description>
        &lt;p&gt;
There is nothing to stop anyone from putting any extra attributes in the extra_info field dict.  So any have the flexibility you need.
&lt;/p&gt;
&lt;p&gt;
The config option is to add some fields that act in exactly the same way as python attributes, having the same semantics as them.  i.e if you have an extra field called alturl, you can do obj.alturl = 'fdsffs'.
&lt;/p&gt;
&lt;p&gt;
This is the best of both worlds as far as I can tell.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>kindly</dc:creator>

      <pubDate>Fri, 11 Feb 2011 09:51:40 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/826#comment:7</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:7</guid>
      <description>
        &lt;p&gt;
I forgot to mention that he main advantage of the fixed fields, is that we can make them properly searchable i.e the values searchable.  This currently does not work for package extra values as they are jsons.
&lt;/p&gt;
&lt;p&gt;
I have added this searchability for the sql backend.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Fri, 11 Feb 2011 10:43:42 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/826#comment:8</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:8</guid>
      <description>
        &lt;p&gt;
Ah - I understand. I'd like it if you could make all the extra fields work as attributes and be searchable - is that possible?
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>kindly</dc:creator>

      <pubDate>Fri, 11 Feb 2011 11:22:22 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/826#comment:9</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:9</guid>
      <description>
        &lt;p&gt;
This would be too much of a hack.  You do not want users overwriting any attributes on the object.  If they called the attribute "&lt;span class="underline"&gt;init&lt;/span&gt;" it would write over the actual &lt;span class="underline"&gt;init&lt;/span&gt;.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Fri, 11 Feb 2011 13:11:50 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost/ticket/826#comment:10</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:10</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Merged into default in cset:613d7bd5fc96.
&lt;/p&gt;
&lt;p&gt;
Future tickets in this area include:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="closed ticket" href="http://localhost/ticket/978" title="enhancement: Edit Resource including Extras in Web UI (closed: fixed)"&gt;#978&lt;/a&gt; Full edit in Web UI
&lt;/li&gt;&lt;li&gt;&lt;a class="assigned ticket" href="http://localhost/ticket/979" title="enhancement: Edit Resource extras in the API (assigned)"&gt;#979&lt;/a&gt; Edit Resource extras in the API
&lt;/li&gt;&lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Mon, 30 May 2011 14:34:17 GMT</pubDate>
      <title>repo, theme set</title>
      <link>http://localhost/ticket/826#comment:11</link>
      <guid isPermaLink="false">http://localhost/ticket/826#comment:11</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;repo&lt;/strong&gt;
                set to &lt;em&gt;ckan&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;theme&lt;/strong&gt;
                set to &lt;em&gt;none&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
This went into ckan release 1.3.2.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>