maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
227 stars 24 forks source link

Error when creating item on wikibase with federated properties #151

Open harej opened 2 years ago

harej commented 2 years ago
  1. Configure the Wikibase CLI to use a Wikibase that uses federated properties such as https://wikipediacitations.wiki.opencura.com/wiki/

  2. Try to create an item. Example command: wb create-entity \'{"type":"item","labels": {"en": "enwiki#308988"}, "descriptions": {"en": "article on English Wikipedia"}, "claims": {"P9675": ["308988"], "P2699": ["https://en.wikipedia.org/w/index.php?curid=308988"], "P1433": ["Q2"]}}'

  3. Error results (partly cut off):

    :{"*":"You can not interact with properties using this API while federated properties is enabled"}}],"*":"See https://wikipediacitations.wiki.opencura.com/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."}} {
    statusCode: 200,
    statusMessage: undefined,
    headers: Headers {
    [Symbol(map)]: [Object: null prototype] {
      server: [ 'nginx/1.17.8' ],
      date: [ 'Thu, 04 Nov 2021 03:13:15 GMT' ],
      'content-type': [ 'application/json; charset=utf-8' ],
      'transfer-encoding': [ 'chunked' ],
      connection: [ 'keep-alive' ],
      vary: [ 'Accept-Encoding' ],
      'x-powered-by': [ 'PHP/7.4.23' ],
      'x-content-type-options': [ 'nosniff' ],
      'mediawiki-api-error': [ 'param-illegal' ],
      'x-frame-options': [ 'DENY' ],
      'content-disposition': [ 'inline; filename=api-result.json' ],
      'cache-control': [ 'private, must-revalidate, max-age=0' ],
      'x-request-id': [ '0a02feb306f60cb3d8498710' ],
      'x-wbstack-mw-backend': [ 'mediawiki-135-app-api' ],
      'strict-transport-security': [ 'max-age=15724800; includeSubDomains' ],
      'content-encoding': [ 'gzip' ]
    }
    },
    body: {
    error: {
      code: 'param-illegal',
      info: 'You can not interact with properties using this API while federated properties is enabled',
      messages: [
        {
          name: 'wikibase-federated-properties-local-property-api-error-message',
          parameters: [],
          html: {
            '*': 'You can not interact with properties using this API while federated properties is enabled'
          }
        }
      ],
      '*': 'See https://wikipediacitations.wiki.opencura.com/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.'
    }
    },
    url: 'https://wikipediacitations.wiki.opencura.com/w/api.php?action=wbgetentities&ids=P9675%7CP2699%7CP1433&format=json&props=info',
    context: {
    url: 'https://wikipediacitations.wiki.opencura.com/w/api.php?action=wbgetentities&ids=P9675%7CP2699%7CP1433&format=json&props=info',
    body: {
      error: {
        code: 'param-illegal',
        info: 'You can not interact with properties using this API while federated properties is enabled',
        messages: [
          {
            name: 'wikibase-federated-properties-local-property-api-error-message',
            parameters: [],
            html: {
              '*': 'You can not interact with properties using this API while federated properties is enabled'
            }
          }
        ],
        '*': 'See https://wikipediacitations.wiki.opencura.com/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.'
      }
    }
    }
    }
maxlath commented 2 years ago

I haven't looked at FederatedProperties yet, I guess some adaptation would be required in wikibase-edit to support it: I opened an issue on that matter https://github.com/maxlath/wikibase-edit/issues/75