[ckan-discuss] Search by "Extras" field
William Waites
ww at styx.org
Tue Mar 9 21:22:07 GMT 2010
Also, how should we construct RDF out of the extras?
Searching it would be easy in that case...
Do we make an extras key namespace? Do we make a (configurable)
mapping onto terms from other vocabularies? Both (via sameAs?)
Are the values always text strings or might they be URIs?
Cheers,
-w
Le 10-03-09 à 20:15, David Read a écrit :
> The simplest way to do this is with the search API. You can do
> something like this:
>
> http://ckan.net/api/search/package?department=Her+Majesty's+Treasury
>
> The docs ( http://knowledgeforge.net/ckan/doc/ckan/api.html ) show
> that 'department' is in a small hard-coded list of extra fields that
> are indexed in the search and accessible through the API. So as it is
> right now, 'ministry' won't work in this way, because we've not needed
> this flexibility up until now.
>
> It might make sense to have this list configurable in the config file.
> Alternatively we could just index all extra fields and when parsing
> the search query, if the key isn't one of the known fields or search
> commands then search the extra fields for it. Perhaps it would be best
> to allow key prefixed with 'extra-', giving
> "?extra-ministry=Treasury". Rufus, what do you think?
>
> David
>
> On 9 March 2010 19:23, Colin Calnan <colin at raisedeyebrow.com> wrote:
>> Is there anyway to list Packages by "extras" fields via the API?
>>
>> Would it be possible to call ckan.net/api/rest/package/extrasKey-
>> extrasValue
>> ?
>>
>> We're using extras fields to hold information about government
>> ministries,
>> and it would be great if we could list all packages that are
>> assigned a
>> ministry. Right now to get that data I have to loop through every
>> package
>> and build the list as I go along.
>>
>> Regards,
>> Colin
>> --
>> *Colin Calnan | Front End Developer*
>> Raised Eyebrow Web Studio
>> www.raisedeyebrow.com <http://www.raisedeyebrow.com>
>> T. 604.684.2498, ext. 5 | E. colin at raisedeyebrow.com
>> UFCW Local 120B
>>
>>
>> _______________________________________________
>> ckan-discuss mailing list
>> ckan-discuss at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-discuss
>>
>
> _______________________________________________
> ckan-discuss mailing list
> ckan-discuss at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-discuss
--
William Waites VE2WSW <ww at styx.org>
http://www.irl.styx.org/ +44 131 516 3563
CD70 0498 8AE4 36EA 1CD7 281C 427A 3F36 2130 E9F5
More information about the ckan-discuss
mailing list