[go: nahoru, domu]

User:DePiep/chembox/wikidata

USER: /home-E /subpg · /sbox-E · /1 2 3 4 5 6  · {{X32}} (E) /help* /news /s-E /x-E /xx-E /row-E  EXTERNAL: EL:w3c-css · TOOLS: WD: rgx101 PETSCAN  · wtech /tpu · commons
WIKI: special:ExpandT Prefix (T:list) #parse {{MAGIC}} H:notes · _TOC_ WikiBlame mw:Lua man (patterns, debug, α) · T:SFW/s (M:,../sandbox· M:String · TFA /better signpost adnws · SPEEDY CFSD · alerts
/unicode: {{T:U+}} m:Uchar · U+abbr · {{ISO15924}} ff conv · {{ISO4217}} BOXES: /chembox /ChemData  · /drugbox T · TG · DEV: /CUR · /taxo · /chemlist · NBSP> < minus>−< NDASH>–< MDASH>—< NOT EQUAL>≠< DOTCIRCLE>◌<
ELEM: pv
/elem · WT · ISO-T symbol-to-data · datarefs · :c:cat:PT · U:PTG · WP:PTG (t)
This box: view · edit
(mostly 2016-17?)

Chemical compounds and Wikidata

edit

Example: en:Carbon monoxide == d:Q2025


In Wikidata

edit
Wiki poject site prefix: en: for enwiki <=> d: for Wikidata
Page content: "article" <=> "item"
Identifiers: en:Article <=> d:QID
Title: en:Pagename <=> d:en-label for QID
Property id: en: |CASNo= (infobox parameter) <=> d: P231 (property id for CAS number)
Property value: en: |CASNo=630-08-0 <=> {{#Property:P231|from=Q2025}} → 630-08-0
Chembox, Drugbox
d: single chemical


d:Wikidata:Glossary

local = in en:wiki, e.g. by parameter |CASNo= wd, d: in wikidata

Chemical compound data models

edit
In Wikidata
d:Chemical substance
can be
d:Chemical compound or
Ion or
Chemical element or
Mixture or
...
See also: d:Wikidata:WikiProject Chemistry
With Chembox

Article (title) can be

Single chemical compound
Multiple chemical compounds
Group (class) of chemical compounds -- Copaene
With Drugbox

Article (title) can be

Single chemical compound (most common)
Two chemical compounds
Vaccine (not a compound)
MAB (not a compound)
Combination of drugs (not a compound)

Wikidata item in Chembox

edit
edit
The link in {{Chembox}} to the Wikidata page (item page)
demo here

Article has its corresponding item in Wikidata connected (QID)

All properties available

Articles that are not present in Wikidata (do not have an item in WD): Category:Not in WD

Local input, read another d:item that the natural one: |QID=Q999 → read d:item Q999

Category:QID local
Provides the Wikidata link d:QID to view, edit.

Overview (item and QID)

edit
  • Parameters involved:
(default) 'natural item', d:page (has QID)
|QID= locally set tioo us alternate item
Article has natural item (d:QID)
Yes No
status code wdYes wdNo
track cat Category:Chemical compound in Wikidata
trivial
(be 0) Category:Chemical compound not in Wikidata
example carbon monoxide (todo)
d:link Q2025 d:Special:Search/Foobar (?)
to edit Green tick Y create d:Item | move article | not a compound?
Infobox has item set by |QID=
Yes overwrites natural item No
status code qidYes qidNo
track cat Category:Chemical compound by local QID for Wikidata (no cat)
example in Foobar |QID=Q9999 carbon monoxide (trivial)
d:link Q9999 (by natural item)
to edit create d:Item | article not a compound?

Note: these two settings are independent. One setting does not determine or influence the other one. However, we can combine them and apply logic.

  • "Not a compound" situation will require attention. Issue in the data models (infobox, Wikidata)?
  • Multiple compound situation: use indexes.
  • Checks to do:
qidYes: (localQID needed) not a compound? other data issue?
qidYes: local QID is a compound?
qidYes: localQID = natural QID: remove (blank) localQID

Item property in Wikidata

edit

Use ECHA InfoCard ID from Wikidata

edit
Straightforward: when the article item has a value for Property P2566 ECHA Infocard ID, it is shown.
Category:ECHA from WD

Use CAS number input from Wikidata

edit
Template {{Chembox}} reads item-property P231 (CAS number): {{#property:P231}}
{{Chembox}} can have QID set. In that case, that item's CAS number will be read:
QID=Q976 → CAS nr = ...

Overview (CAS)

edit

Category:CAS from wd loc=/TRIVIAL Category:wd-CAS is not local-CAS!!

Category:CAS from wd loc0/TRIVIAL Category:CAS local value only!

Category:CAS not local not from wd

Item has CAS number (P231)
Item is by localQID when set, or natural
Yes No
local
|CAS=
input
Yes
  • situation: YesYes SAME
  • cat: CAS number from Wikidata
  • edit: Green tick Y rm localCAS (trivial edit)
  • situation: NoYes
  • cat (be 0): CAS number local not in Wikidata
  • edit:    update d:item | rm localCAS | confirm CAS=none
  • situation: YesYes DIFF
  • cat (be 0): CAS number different in Wikidata
  • edit: Nota bene * solve conflict, rm localCAS or change d:CAS
No
  • situation: YesNo
  • cat: CAS number from Wikidata
  • edit: Green tick Y
  • situation: NoNo
  • cat (be 0) (cannot categorize, use PETSCAN): CAS number not in Wikidata
  • edit:    not a compound? | search CAS, add to d:Item
Add |wdIssue=nac/not a compound?

Multiple compounds in one article (indexes)

edit
One article can have multiple compounds.

In the infobox, these can be listed by using indexes. The first compound can be the article item (or the |QID= when set).

The other compounds require their own item (QID) being set. So for this one should use |QID1= ... |QID5=

|CASNo=
|PubChem=
|QID1=
|CASNo1=
|PubChem1=
|QID2=
|CASNo2=
|PubChem2=
|QID5=
|CASNo5=
|PubChem5=

Note that each index is about one single compound. So stuff1 has CASnr1 and PubChem1.

The <blank> values uses the article item value.


With that, CASNo1 and PubChem1 are read from |QID1=

Overview (indexed CAS)

edit
Copaene

(indexed does not categorize: CAS number from Wikidata)

wdCAS yes-->Category:CAS number (indexed) different in Wikidata
wdCAS no -->Category:CAS number (indexed) not in Wikidata