Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

global: system ingestion date #30

Merged
merged 1 commit into from
Aug 27, 2015

Conversation

jbenito3
Copy link
Member

Signed-off-by: Jose Benito Gonzalez Lopez jose.benito.gonzalez@cern.ch

* Saves an ingestion date in the database. (closes inveniosoftware#7)

* Exposes that ingestion date in GET queries.

Signed-off-by: Jose Benito Gonzalez Lopez <jose.benito.gonzalez@cern.ch>
@jbenito3
Copy link
Member Author

@tiborsimko I hope I understood correctly the ticket and it solves it.

@tiborsimko tiborsimko added this to the v0.2.0 milestone Aug 27, 2015
@tiborsimko
Copy link
Member

@jbenito3 Yes, sounds good. However I think we should modify the JSON schemas accordingly. From the client side, it is not "allowed" to set this field (or its setting would not have any effect). But from the server side, we need to return it in the response. Kind of like:

    {
      "claimant": "ADS",
      "received": "2015-08-27T11:23:58Z",
      "subject": {
          "type": "ARXIV_ID",
          "value": "astro-ph/0501001"
       },
      "claim": {
          "predicate": "is_same_as",
          "datetime": "2015-05-26T11:00:00Z",
          "certainty": 1,
      },
      "object": {
           "type": "ADS_BIBCODE",
           "value": "2005astro.ph..1001H"
      }
    }

Hence this received field should be probably optional in the JSON Schema for claims.

BTW if we want to distinguish these "system" fields from the rest of the claimed information, we could perhaps use some kind of prefix namespace convention, say:

      "__received__": "2015-08-27T11:23:58Z",

at a price of certain ugliness.

@jbenito3
Copy link
Member Author

@tiborsimko That example you referred in your previous comment:

    {
      "claimant": "ADS",
      "received": "2015-08-27T11:23:58Z",
      "subject": {
          "type": "ARXIV_ID",
          "value": "astro-ph/0501001"
       },
      "claim": {
          "predicate": "is_same_as",
          "datetime": "2015-05-26T11:00:00Z",
          "certainty": 1,
      },
      "object": {
           "type": "ADS_BIBCODE",
           "value": "2005astro.ph..1001H"
      }
    }

Does it refer only to GET claims reply? Because at the moment the GET claims reply would be something like this:

{
    "json_list": [
        {
            "claim_details": {
                "claim": {
                    "arguments": {
                        "actor": "CDS_submission",
                        "human": "False"
                    },
                    "certainty": 100,
                    "datetime": "2015-05-25T11:00:00Z",
                    "predicate": "is_same_as"
                },
                "claimant": "CDS",
                "object": {
                    "type": "CDS_REPORT_NUMBER",
                    "value": "CMS-PAS-HIG-14-008"
                },
                "subject": {
                    "type": "CDS_RECORD_ID",
                    "value": "2001192"
                }
            },
            "created": "2015-05-25T11:00:00+00:00"
        }
    ]
}

I would definitely change, in my example, that created to received and datetime to created (also in the JSON schemas and RFC). What do you think?

BTW, I will get rid of that json_list in favor of something more meaningful.

@tiborsimko
Copy link
Member

Does it refer only to GET claims reply?

Yes, I just modified the GET output example from the RFC.

BTW, I will get rid of that json_list in favor of something more meaningful.

Do we actually need it? Can be skipped out, returning only list of claims, if we put the system date "inside". Ditto for claim_details and friends that we could refactor. Simplifying the GET output structure can be part of another PR...

@tiborsimko tiborsimko merged commit 61eaec0 into inveniosoftware:master Aug 27, 2015
@jbenito3
Copy link
Member Author

@tiborsimko Thanks for merging. I will take in to account your comments and implement the changes in my current task #23 (which is quite related).

@jbenito3 jbenito3 deleted the 7-system-ingestion-date branch August 27, 2015 10:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

api: expose system ingestion date in GET queries
2 participants