magnusmanske / magnusmanske/quickstatements

Problem with units when using QuickStatements on a Wikibase

Open
#37 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
58
Forks
21
PR merge metrics
No merged PRs in 30d

Description

@magnusmanske, I have a custom Wikibase and the following QuickStatement:

      CREATE
      
      LAST	P1	Q2
      LAST	Den	"chemical compound"
      LAST	P7	"CCCCCOC1=C2C3=C(C(=O)CC3)C(=O)OC2=C4[C@@H]5C=CO[C@@H]5OC4=C1"	S14	Q5
      LAST	P3	"C₂₁H₂₀O₆"	S14	Q5
      LAST	P2	368.3807U3	S14	Q5
      LAST	Len	"foo"
      LAST	P9	"InChI=1S/C21H20O6/c1-2-3-4-8-24-14-10-15-18(12-7-9-25-21(12)26-15)19-17(14)11-5-6-13(22)16(11)20(23)27-19/h7,9-10,12,21H,2-6,8H2,1H3/t12-,21+/m0/s1"	S14	Q5
      LAST	P10	"VQBNVFKQPPPAER-LAJNKCICSA-N"

It works well, except for the line with 368.3807U3. When I include that I get the error it does not know about http://compoundcloud.wikibase.cloud/entity/Q3 not existing. This makes sense, because it should be https://compoundcloud.wikibase.cloud/entity/Q3 instead. With the 's'.

I am guessing the problem is that wikidata.org actually uses http in the URLs. I cannot see where in the code the translation to U3 to http://compoundcloud.wikibase.cloud/entity/Q3.

But since it is working as expected for other part of the QS, I am hoping the fix should be simple.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the quantity value 368.3807U3 is parsed and how its unit URL is constructed for a custom Wikibase. Reproduce the supplied QuickStatement against the linked Wikibase, then verify that the unit resolves to an HTTPS entity URL while the other statements continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.