Menu

#20 Challenge's children not returned

open-fixed
6
2011-06-20
2011-03-16
No

When a new challenge is created using http://telefonica.ontotext.com/platform-rest/scoring-service/storeChallenge and the following payload:
json=
{
"parent": "http://telefonica.com/insemtives/challenges",
"creator": "http://user00001.myopenid.com",
"children": ["http://telefonica.com/insemtives/challenges#badges#early_riser"],
"description": "The TID's badges challenge.",
"scores": null,
"name": "TID's badge",
"uri": "http://telefonica.com/insemtives/challenges#badges",
"keywords": null,
"relatedMedia": null
}
and it is retrieved using the http://telefonica.ontotext.com/platform-rest/scoring-service/loadChallenges method. The data returned is:
[ {
"parent" : "http://telefonica.com/insemtives/challenges",
"creator" : "http://user00001.myopenid.com",
"children" : [ ],
"scores" : [ ],
"name" : "TID's INSEMTIVES challenges",
"uri" : "http://telefonica.com/insemtives/challenges#badges"
}, {
"parent" : "http://telefonica.com/insemtives/challenges",
"creator" : "http://user00001.myopenid.com",
"children" : [ ],
"scores" : [ ],
"name" : "TID's badge",
"uri" : "http://telefonica.com/insemtives/challenges#badges"
} ]
Many issues here:
1.- The children information is not returned. BTW, which is the rationale of the "children" parameter?
2.- 2 challenges exist for the same parent and uri. Does this have any sense? The only difference in the example is the name.
3.- The challenge description is not returned. It should be returned or not be taken as a parameter by storeChallenge.

Discussion

  • Atanas Ilchev

    Atanas Ilchev - 2011-03-21

    works fine now,
    After fixing the store JSON - ( .. "scores":[ ] ..), I get 1 item with all the fields you mention above. Guess it was fixed by a previous commit (again..)

     
  • Atanas Ilchev

    Atanas Ilchev - 2011-03-21
    • assigned_to: atanas_ilchev --> gtorodelvalle
    • status: open --> open-out-of-date
     
  • Germán Toro del Valle

    Hi Atanas, I am starting to doubt if we are both testing the same platform, in my case http://telefonica.ontotext.com/platform-rest

    I have just created a new challenge invoking http://telefonica.ontotext.com/platform-rest/scoring-service/storeChallenge
    with the following payload:
    json=
    {
    "parent": "http://telefonica.com/insemtives/challenges",
    "creator": "http://www.facebook.com/people/gtorodelvalle",
    "children": ["http://telefonica.com/insemtives/challenges#childrenTest001"],
    "description": "The TID's test challenge.",
    "scores": [],
    "name": "TID's test challenge",
    "uri": "http://telefonica.com/insemtives/challenges#Test001",
    "keywords": null,
    "relatedMedia": null
    }
    and after invoking http://telefonica.ontotext.com/platform-rest/scoring-service/storeChallenge with the following payload:
    json={"uri": "http://telefonica.com/insemtives/challenges#Test002"}
    we get:
    [ {
    "parent" : "http://telefonica.com/insemtives/challenges",
    "description" : "The TID's test challenge.",
    "creator" : "http://www.facebook.com/people/gtorodelvalle",
    "children" : [ ],
    "ratingTotal" : 0,
    "ratingCount" : 0,
    "scores" : [ ],
    "keywords" : [ ],
    "relatedMedia" : [ ],
    "synsets" : [ ],
    "name" : "TID's test challenge",
    "uri" : "http://telefonica.com/insemtives/challenges#Test002"
    } ]
    where, as you can see, the children information is missing.

    Please, update the documentation at http://insemtives-wiki.sti2.at/index.php/WP4/L!NKS/Scoring_Service regarding the storeChallenge method since the example provided set "scores" to null whereas it should be "[]" as you mention in your latest comment. We need proper documentation if we are supposed to use the platform ;-)

    Thank you very much!

     
  • Germán Toro del Valle

    • assigned_to: gtorodelvalle --> atanas_ilchev
     
  • Germán Toro del Valle

    Setting the Resolution to Rejected.

     
  • Germán Toro del Valle

    • status: open-out-of-date --> open-rejected
     
  • Atanas Ilchev

    Atanas Ilchev - 2011-03-22
    • status: open-rejected --> open-accepted
     
  • Atanas Ilchev

    Atanas Ilchev - 2011-03-22

    Hi German, It is a bug indeed.. I think that I'll be able to fix it by the end of the day

     
  • Atanas Ilchev

    Atanas Ilchev - 2011-03-22
    • assigned_to: atanas_ilchev --> gtorodelvalle
     
  • Atanas Ilchev

    Atanas Ilchev - 2011-03-22

    Hi German,

    supplying values in the children field does not store them - something more, it has no meaning within the context of the storeChallenge method (please tell me if an error should be thrown in this case). Children are challenges whose parent is the current challenge. In order the example below to work, you must have stored a challenge like:
    {
    "parent": "http://telefonica.com/insemtives/challenges#badges",
    "creator": "http://user00001.myopenid.com",
    "children": [],
    "description": "The TID's badges challenge child#1.",
    "scores": null,
    "name": "TID's badge's child",
    "uri": "http://telefonica.com/insemtives/challenges#badges#early_riser",
    "keywords": null,
    "relatedMedia": null
    }

    PS: I've removed the "not null" check for the scores field.
    PS: Will update the wiki about this

     
  • Germán Toro del Valle

    • assigned_to: gtorodelvalle --> atanas_ilchev
     
  • Germán Toro del Valle

    (Re-writing my comment since it seems it does not appear... :-OOO )

    So Atanas, if I get your point right, the "children" input parameter of /platform-rest/scoring-service/storeChallenge is basically useless. My question is, why do you document an input parameter which does nothing and should always be passed as null. In fact, I have tried /platform-rest/scoring-service/storeChallenge with the following paylad and it works:
    json={
    "parent": "http://telefonica.com/insemtives/challenges",
    "creator": "http://www.facebook.com/gtorodelvalle",
    "description": "TID's test challenge.",
    "scores": null,
    "name": "TID's test challenge 6",
    "uri": "http://telefonica.com/insemtives/challenges#testChallenge006",
    "keywords": null,
    "relatedMedia": null
    }
    this is, with no "children" input parameter.

    So, my recommendation would be to delete from earth any comment about the "children" input parameter from the /platform-rest/scoring-service/storeChallenge documentation at http://insemtives-wiki.sti2.at/index.php/WP4/L!NKS/Scoring_Service#storeChallenge not to create further confusion to the potential client application developers.

    @Atanas: what do you think?, am I missing anything?

    BTW, I accept the solution provided but I have re-assigned the ticket to Atanas to discuss this issue.

    Thank you very much!

     
  • Atanas Ilchev

    Atanas Ilchev - 2011-03-23

    Hi German, I've removed the misleading "children" from the example. Something more, due to a recent update of the platform-rest servlet, it is no more obligatory to specify fields which have null value - this is done automatically (that's why the example you've tried didn't finish with "Missing field" exception).

     
  • Atanas Ilchev

    Atanas Ilchev - 2011-03-23
    • assigned_to: atanas_ilchev --> gtorodelvalle
    • status: open-accepted --> open-fixed
     
  • Germán Toro del Valle

    @Daniel: could you please check the behavior and include any comments you may consider appropriate? Thank you much! ;-)

     
  • Germán Toro del Valle

    • assigned_to: gtorodelvalle --> danielfdez
     
  • Daniel Fernández Casado

    • assigned_to: danielfdez --> atanas_ilchev
    • priority: 5 --> 6
     
  • Daniel Fernández Casado

    Some comments according to the initial issues exposed:

    1 - The children appear correctly on the answer now and the system of inheritance seems to work properly in my tests. [SOLVED]
    2 - If I create a challenge that previously exists it appears duplicated. It duplicate scores associates to old challenge too. It is not a desirable behavior. Ideally, when I store a existing challenge i should edit it. And I add the following information: In "scores attribute it appears the URI challenge for each item. Is there any sense to send duplicate information?
    3 - Challenge description is correctly stored. This parameter is optional in storeChallenge method. [SOLVED]

    Assigning the ticket to ... Atanas :)

     

Log in to post a comment.

MongoDB Logo MongoDB