inventaire icon indicating copy to clipboard operation
inventaire copied to clipboard

Add claim references

Open maxlath opened this issue 1 year ago • 2 comments

Use cases:

  • store the source of a claim when taken from authority sources (national libraries, etc), in order to be able to bring this data to Wikidata

maxlath avatar Jan 23 '24 15:01 maxlath

To bring references to Wikidata, applying the same data object as wikibase-edit seems reachable.

Storing references would go from today couchdb entity document:

{
  _id: "foo",
  claims: {
    "wdt:P31": [ 'wd:Q5' ]
  }
}

to

{
  _id: 'foo',
  claims: {
    'wdt:P31': [
      {
        value: 'wd:Q5',
        references: [
          {
            'wdt:P268': '13516296h',
            'wdt:P813': '2024-01-29'
          }
        ]
      }
    ]
  }
}

There seems to be 2 obvious ways to deal with current documents (without references):

  • keep them as is, with a serializer which would simplify claims to their mainsnak value (probably to be inserted in getInvEntitiesByClaim). This would keep administrative data update tasks small/inexitant, but would require additional code when references will be used in other part of the app (ie. entity history)
  • bulk update the million~ish entities.

In any case, patches would also need some updates with same possibilities as entities above: either an adapter to understand new claims structure, or rewrite patches (which would significantly increase patch db size).

jum-s avatar Jan 29 '24 06:01 jum-s

Issue on adding qualifiers https://github.com/inventaire/inventaire/issues/145

maxlath avatar Feb 19 '24 13:02 maxlath

Done by #748

maxlath avatar Aug 12 '24 16:08 maxlath