blinry / wikidata-cardgame

Use Wikidata to generate fact cards on arbitrary topics!
https://cardgame.morr.cc
64 stars 7 forks source link

Give the user some control over properties #10

Open thisisTQ opened 5 years ago

thisisTQ commented 5 years ago

Currently, properties are chosen by ... well, as my JS knowledge is almost non-existent and I can't find enough comments that explain the operations, I have to guess: by variety and presence in the items?

It'd be awesome if for richer categories with lots of properties there were options to choose from. Would also make the whole card game more useful for a variety of scenarios, like being used as a learning game.

jooooaah commented 1 year ago

That would be cool :) - the more wikidata is filled, the more application areas open up, especially for education sector,..

ross-spencer commented 1 year ago

I was prompted to take a look to understand more how this can be used in my field.

User interface aside, in the backend you have the query here: https://github.com/blinry/wikidata-cardgame/blob/84ca89ce78d559cf3fd2c67f0b1a4a4f7f0694f6/cardgame.js#L230-L268

That if I read correctly, returns time and quantity values (makes sense as they're easily comparable).

Strangely enough, the list is only 44 for the elements:

0: (3) ['http://www.wikidata.org/entity/P1086', 99, 'atomic number']
1: (3) ['http://www.wikidata.org/entity/P1108', 93, 'electronegativity']
2: (3) ['http://www.wikidata.org/entity/P575', 93, 'time of discovery or invention']
3: (3) ['http://www.wikidata.org/entity/P2067', 89, 'mass']
4: (3) ['http://www.wikidata.org/entity/P10685', 89, 'ionic radius']
5: (3) ['http://www.wikidata.org/entity/P1121', 55, 'oxidation state']
6: (3) ['http://www.wikidata.org/entity/P2054', 40, 'density']
7: (3) ['http://www.wikidata.org/entity/P2101', 40, 'melting point']
8: (3) ['http://www.wikidata.org/entity/P2102', 37, 'boiling point']
9: (3) ['http://www.wikidata.org/entity/P2119', 26, 'vapor pressure']
10: (3) ['http://www.wikidata.org/entity/P2404', 25, 'time-weighted average exposure limit']
11: (3) ['http://www.wikidata.org/entity/P2129', 21, 'immediately dangerous to life or health']
12: (3) ['http://www.wikidata.org/entity/P3071', 19, 'standard molar entropy']
13: (3) ['http://www.wikidata.org/entity/P2260', 11, 'ionization energy']
14: (3) ['http://www.wikidata.org/entity/P2068', 9, 'thermal conductivity']
15: (3) ['http://www.wikidata.org/entity/P2075', 9, 'speed of sound']
16: (3) ['http://www.wikidata.org/entity/P2055', 8, 'electrical conductivity']
17: (3) ['http://www.wikidata.org/entity/P2407', 5, 'short-term exposure limit']
18: (3) ['http://www.wikidata.org/entity/P1088', 4, "Mohs' hardness"]
19: (3) ['http://www.wikidata.org/entity/P5480', 4, 'tensile modulus of elasticity']
20: (3) ['http://www.wikidata.org/entity/P2116', 3, 'molar enthalpy of vaporization']
21: (3) ['http://www.wikidata.org/entity/P2066', 3, 'molar fusion enthalpy']
22: (3) ['http://www.wikidata.org/entity/P2405', 3, 'ceiling exposure limit']
23: (3) ['http://www.wikidata.org/entity/P1109', 2, 'refractive index']
24: (3) ['http://www.wikidata.org/entity/P5479', 2, 'ultimate tensile strength']
25: (3) ['http://www.wikidata.org/entity/P2120', 2, 'radius']
26: (3) ['http://www.wikidata.org/entity/P2204', 2, 'minimum explosive concentration']
27: (3) ['http://www.wikidata.org/entity/P2056', 2, 'specific heat capacity']
28: (3) ['http://www.wikidata.org/entity/P5593', 2, "Poisson's ratio"]
29: (3) ['http://www.wikidata.org/entity/P2240', 2, 'median lethal dose (LD50)']
30: (3) ['http://www.wikidata.org/entity/P5679', 2, 'electrical resistivity']
31: (3) ['http://www.wikidata.org/entity/P3070', 1, 'dynamic viscosity']
32: (3) ['http://www.wikidata.org/entity/P6075', 1, 'embodied energy']
33: (3) ['http://www.wikidata.org/entity/P5676', 1, 'relative permeability']
34: (3) ['http://www.wikidata.org/entity/P5483', 1, 'hardness']
35: (3) ['http://www.wikidata.org/entity/P5673', 1, 'shear modulus']
36: (3) ['http://www.wikidata.org/entity/P2113', 1, 'sublimation temperature']
37: (3) ['http://www.wikidata.org/entity/P2300', 1, 'minimal lethal dose']
38: (3) ['http://www.wikidata.org/entity/P5993', 1, 'compressive modulus of elasticity']
39: (3) ['http://www.wikidata.org/entity/P2710', 1, 'minimal lethal concentration']
40: (3) ['http://www.wikidata.org/entity/P5674', 1, 'thermal diffusivity']
41: (3) ['http://www.wikidata.org/entity/P1092', 1, 'total produced']
42: (3) ['http://www.wikidata.org/entity/P2284', 1, 'price'] 
43: (3) ['http://www.wikidata.org/entity/P2117', 1, 'combustion enthalpy']

So your opportunities for a decent sized deck (10+?) diminish after the 14th item (13:) which is one thing to keep in mind with time and quantity at least.

But if one could select from those, then they could be folded into the card filtering, perhaps here: https://github.com/blinry/wikidata-cardgame/blob/84ca89ce78d559cf3fd2c67f0b1a4a4f7f0694f6/cardgame.js#L162 where you have a sorted list with all the elements in from the original SPARQL which is then "cut" using MAX_PROPERTIES: https://github.com/blinry/wikidata-cardgame/blob/master/cardgame.js#L1

So, something seems doable, but UX may be the hardest bit?