[ECODP-dev] ODP-248
John Glover
john.glover at okfn.org
Mon Sep 16 12:59:25 UTC 2013
Also: if you set the CKAN debug level to 'INFO' in the config, the command
will print the name of each new publisher that it creates, so it will be
easy to show exactly which name is causing the validation error.
Regards,
John
On 16 September 2013 14:57, John Glover <john.glover at okfn.org> wrote:
> Hi Bert,
>
> Yes, we do not de-duplicate the input or check for multiple values of the
> same publisher name. If there were 2 entries for English, that would lead
> to this ValidationError. If there are 2 values for another language you
> will just overwrite the first translation of the title with the second one.
>
> Regards,
> John
>
>
> On 16 September 2013 14:54, Bert Van Nuffelen <
> bert.van.nuffelen at tenforce.com> wrote:
>
>> Hi John,
>>
>> hence I have to check each publisher if there are 2 entries for the same
>> language.
>>
>> best,
>>
>> Bert
>>
>>
>> 2013/9/16 John Glover <john.glover at okfn.org>
>>
>>> Hi Bert,
>>>
>>> That happens for any language, but we only make an API call to create or
>>> update the publisher object itself if the language is English. For all
>>> other languages we use this parsed name value to update the stored title
>>> translations.
>>>
>>> Regards,
>>> John
>>>
>>>
>>> On 16 September 2013 14:42, Bert Van Nuffelen <
>>> bert.van.nuffelen at tenforce.com> wrote:
>>>
>>>> Hi John,
>>>>
>>>> is this test only for the english language or for any language?
>>>>
>>>> best regards,
>>>>
>>>> Bert
>>>>
>>>>
>>>> 2013/9/16 John Glover <john.glover at okfn.org>
>>>>
>>>>> Hi Bert,
>>>>>
>>>>> We currently parse this JSON as follows:
>>>>>
>>>>> name: take the string after the final '/' in the 'term' field (so WTO
>>>>> in this case)
>>>>> title: the 'label' field
>>>>> language: the 'language' field as you would expect
>>>>>
>>>>> So here, it would seem that a publisher with the name WTO already
>>>>> exists. Everything up to and including the last '/' in the 'term' field is
>>>>> ignored, so if you just changed the start of that URL for example that
>>>>> would not be enough to distinguish a separate publisher.
>>>>>
>>>>> Hope this helps.
>>>>>
>>>>> Regards,
>>>>> John
>>>>>
>>>>>
>>>>> On 16 September 2013 13:38, Bert Van Nuffelen <
>>>>> bert.van.nuffelen at tenforce.com> wrote:
>>>>>
>>>>>> Hi John,
>>>>>>
>>>>>> indeed the command is the paster command which uses the json as you
>>>>>> mentioned before. We have a transformation script that turns the RDF into
>>>>>> the desired json.
>>>>>>
>>>>>> so the error message would mean there is a duplicate in the json:
>>>>>>
>>>>>> {
>>>>>> "term" : { "type": "uri", "value": "
>>>>>> http://publications.europa.eu/resource/authority/corporate-body/WTO"
>>>>>> },
>>>>>> "label" : { "type": "literal", "value": "Organizaci\u00F3n
>>>>>> Mundial del Comercio" } ,
>>>>>> "language" : { "type": "literal" , "value" : "es" }
>>>>>> },
>>>>>>
>>>>>> Can you be more precise, on the above example what would be the
>>>>>> duplicate?
>>>>>> So that we can provide a correct search for the problem case?
>>>>>>
>>>>>> kind regards,
>>>>>>
>>>>>> Bert
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2013/9/16 John Glover <john.glover at okfn.org>
>>>>>>
>>>>>>> Hi Dimitrios,
>>>>>>>
>>>>>>> Thanks. That is an RDF file, where as our paster command reads from
>>>>>>> a JSON file (see [1] for example), so I assume that this is not using our
>>>>>>> paster command. So, the problem must be resolved by whoever is making the
>>>>>>> API request. Multiple publishers (also called 'groups' in CKAN internally)
>>>>>>> cannot have the same name, that is why validation is failing in this
>>>>>>> instance.
>>>>>>>
>>>>>>> [1]
>>>>>>> https://raw.github.com/okfn/ckanext-ecportal/master/data/po-corporate-bodies.json
>>>>>>>
>>>>>>> Regards,
>>>>>>> John
>>>>>>>
>>>>>>>
>>>>>>> On 16 September 2013 12:57, Dimitrios Mexis <
>>>>>>> dimitrios.mexis at tenforce.com> wrote:
>>>>>>>
>>>>>>>> Hello John,
>>>>>>>>
>>>>>>>> You can find this under:
>>>>>>>>
>>>>>>>> http://publications.europa.eu/mdr/resource/authority/corporate-body/skos/corporatebodies-skos.rdf
>>>>>>>>
>>>>>>>> It is the same as PO has used.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> Dimitrios
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Sep 16, 2013 at 12:54 PM, John Glover <john.glover at okfn.org
>>>>>>>> > wrote:
>>>>>>>>
>>>>>>>>> Hi Bert,
>>>>>>>>>
>>>>>>>>> The error message means that you are trying to create a new
>>>>>>>>> publisher (synonym for group) with the same name as an existing publisher
>>>>>>>>> name, and so validation is failing.
>>>>>>>>>
>>>>>>>>> Is this using our update-publishers paster command? If this is a
>>>>>>>>> publisher that should be updated instead of created, then this sounds like
>>>>>>>>> a bug. If so, can you provide me with the publishers list that you are
>>>>>>>>> using for this so that I can replicate this and resolve it?
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> John
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 16 September 2013 12:10, Bert Van Nuffelen <
>>>>>>>>> bert.van.nuffelen at tenforce.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi John,
>>>>>>>>>>
>>>>>>>>>> can you provide feedback on the error message occuring while
>>>>>>>>>> uploading a new publisher list.
>>>>>>>>>> Also it would be good, if the error message is more precise.
>>>>>>>>>>
>>>>>>>>>> Traceback (most recent call last):
>>>>>>>>>> File
>>>>>>>>>> "/applications/ecodp/users/ecodp/ckan/lib/ecodp/pyenv/bin/paster", line 8,
>>>>>>>>>> in <module>
>>>>>>>>>> load_entry_point('PasteScript==1.7.3', 'console_scripts',
>>>>>>>>>> 'paster')()
>>>>>>>>>> File
>>>>>>>>>> "/applications/ecodp/users/ecodp/ckan/lib/ecodp/pyenv/lib/python2.6/site-packages/paste/script/command.py",
>>>>>>>>>> line 84, in run
>>>>>>>>>> invoke(command, command_name, options, args[1:])
>>>>>>>>>> File
>>>>>>>>>> "/applications/ecodp/users/ecodp/ckan/lib/ecodp/pyenv/lib/python2.6/site-packages/paste/script/command.py",
>>>>>>>>>> line 123, in invoke
>>>>>>>>>> exit_code = runner.run(args)
>>>>>>>>>> File
>>>>>>>>>> "/applications/ecodp/users/ecodp/ckan/lib/ecodp/pyenv/lib/python2.6/site-packages/paste/script/command.py",
>>>>>>>>>> line 218, in run
>>>>>>>>>> result = self.command()
>>>>>>>>>> File
>>>>>>>>>> "/applications/ecodp/users/ecodp/ckan/lib/ecodp/pyenv/src/ckanext-ecportal/ckanext/ecportal/commands.py",
>>>>>>>>>> line 115, in command
>>>>>>>>>> self.update_publishers()
>>>>>>>>>> File
>>>>>>>>>> "/applications/ecodp/users/ecodp/ckan/lib/ecodp/pyenv/src/ckanext-ecportal/ckanext/ecportal/commands.py",
>>>>>>>>>> line 602, in update_publishers
>>>>>>>>>> self._add_publishers(new_publishers)
>>>>>>>>>> File
>>>>>>>>>> "/applications/ecodp/users/ecodp/ckan/lib/ecodp/pyenv/src/ckanext-ecportal/ckanext/ecportal/commands.py",
>>>>>>>>>> line 408, in _add_publishers
>>>>>>>>>> logic.get_action('group_create')(context, group)
>>>>>>>>>> File
>>>>>>>>>> "/applications/ecodp/users/ecodp/ckan/lib/ecodp/pyenv/src/ckan/ckan/logic/action/create.py",
>>>>>>>>>> line 483, in group_create
>>>>>>>>>> raise ValidationError(errors, error_summary(errors))
>>>>>>>>>> ckan.logic.ValidationError: {'Name': 'Group name already exists
>>>>>>>>>> in database'}
>>>>>>>>>>
>>>>>>>>>> more context see:
>>>>>>>>>>
>>>>>>>>>> https://webgate.ec.europa.eu/publications/jira/browse/ODP-248
>>>>>>>>>>
>>>>>>>>>> kind regards,
>>>>>>>>>>
>>>>>>>>>> Bert
>>>>>>>>>> --
>>>>>>>>>> Bert Van Nuffelen
>>>>>>>>>>
>>>>>>>>>> Semantic Technologies Software Architect at TenForce
>>>>>>>>>> www.tenforce.be
>>>>>>>>>>
>>>>>>>>>> Bert.Van.Nuffelen at tenforce.com
>>>>>>>>>> Office: +32 (0)16 31 48 60
>>>>>>>>>> Mobile:+32 479 06 24 26
>>>>>>>>>> skype: bert.van.nuffelen
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Ecodp-dev mailing list
>>>>>>>>>> Ecodp-dev at lists.okfn.org
>>>>>>>>>> http://lists.okfn.org/mailman/listinfo/ecodp-dev
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Ecodp-dev mailing list
>>>>>>>>> Ecodp-dev at lists.okfn.org
>>>>>>>>> http://lists.okfn.org/mailman/listinfo/ecodp-dev
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Ecodp-dev mailing list
>>>>>>>> Ecodp-dev at lists.okfn.org
>>>>>>>> http://lists.okfn.org/mailman/listinfo/ecodp-dev
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Ecodp-dev mailing list
>>>>>>> Ecodp-dev at lists.okfn.org
>>>>>>> http://lists.okfn.org/mailman/listinfo/ecodp-dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Bert Van Nuffelen
>>>>>>
>>>>>> Semantic Technologies Software Architect at TenForce
>>>>>> www.tenforce.be
>>>>>>
>>>>>> Bert.Van.Nuffelen at tenforce.com
>>>>>> Office: +32 (0)16 31 48 60
>>>>>> Mobile:+32 479 06 24 26
>>>>>> skype: bert.van.nuffelen
>>>>>>
>>>>>> _______________________________________________
>>>>>> Ecodp-dev mailing list
>>>>>> Ecodp-dev at lists.okfn.org
>>>>>> http://lists.okfn.org/mailman/listinfo/ecodp-dev
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Ecodp-dev mailing list
>>>>> Ecodp-dev at lists.okfn.org
>>>>> http://lists.okfn.org/mailman/listinfo/ecodp-dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Bert Van Nuffelen
>>>>
>>>> Semantic Technologies Software Architect at TenForce
>>>> www.tenforce.be
>>>>
>>>> Bert.Van.Nuffelen at tenforce.com
>>>> Office: +32 (0)16 31 48 60
>>>> Mobile:+32 479 06 24 26
>>>> skype: bert.van.nuffelen
>>>>
>>>> _______________________________________________
>>>> Ecodp-dev mailing list
>>>> Ecodp-dev at lists.okfn.org
>>>> http://lists.okfn.org/mailman/listinfo/ecodp-dev
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Ecodp-dev mailing list
>>> Ecodp-dev at lists.okfn.org
>>> http://lists.okfn.org/mailman/listinfo/ecodp-dev
>>>
>>>
>>
>>
>> --
>> Bert Van Nuffelen
>>
>> Semantic Technologies Software Architect at TenForce
>> www.tenforce.be
>>
>> Bert.Van.Nuffelen at tenforce.com
>> Office: +32 (0)16 31 48 60
>> Mobile:+32 479 06 24 26
>> skype: bert.van.nuffelen
>>
>> _______________________________________________
>> Ecodp-dev mailing list
>> Ecodp-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ecodp-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ecodp-dev/attachments/20130916/8f039967/attachment.html>
More information about the ecodp-dev
mailing list