Difference between revisions of "Structured Data/Wikidata"

From Open Food Facts wiki
Jump to navigation Jump to search
(→‎Categories: categories are classes)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
This project aims at improving Wikidata with Open Food Facts Data, with the aim of eventually reusing the data, and linking the Open Food Facts data with Wikidata, and thus with many other services.
 
This project aims at improving Wikidata with Open Food Facts Data, with the aim of eventually reusing the data, and linking the Open Food Facts data with Wikidata, and thus with many other services.
 +
 +
See also: https://www.wikidata.org/wiki/Wikidata:WikiProject_Food
  
 
=== Companies ===
 
=== Companies ===
Line 14: Line 16:
 
=== Labels ===
 
=== Labels ===
 
* Adding the Wikidata item number (QXXXXXX) on the Open Food Facts taxonomy
 
* Adding the Wikidata item number (QXXXXXX) on the Open Food Facts taxonomy
 +
* https://www.wikidata.org/wiki/Wikidata:Property_proposal/Open_Food_Facts_label
 
=== Additives ===
 
=== Additives ===
 
* Marking additives as "instance of" food additives, or better yet, in the sub category
 
* Marking additives as "instance of" food additives, or better yet, in the sub category
 
* Adding the Wikidata item number (QXXXXXX) on the Open Food Facts taxonomy
 
* Adding the Wikidata item number (QXXXXXX) on the Open Food Facts taxonomy
 +
* https://query.wikidata.org/embed.html#%23Cats%0ASELECT%20%3Fitem%20%3FitemLabel%20WHERE%20%7B%0A%20%20%3Fitem%20wdt%3AP2093%20%22Cosmetic%20Ingredient%20Review%20Expert%20Panel%22.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D
 +
=== Ingredients ===
 +
 +
=== Diets ===
 +
Diets on Wikidata: https://tools.wmflabs.org/wikidata-todo/tree.html?q=474191&rp=279,31
 +
 +
=== Stores ===
 +
* https://bmericskay.github.io/portfolio/Disgressions.html
 +
* https://twitter.com/BorisMericskay/status/1315213965333495808?s=09
 +
 +
== Getting information into Wikidata ==
 +
 +
* Mix and Match for food and eating catalogs: https://mix-n-match.toolforge.org/#/group/ig_wikidata_property_related_to_food_and_eating
 +
* <nowiki>https://www.wikidata.org/wiki/Wikidata:WikiProject_Spain/Alimentos_de_Espa%C3%B1a</nowiki>
 +
* https://www.wikidata.org/wiki/Wikidata:Property_proposal/GLN
 +
* Discussions about country/place adjectives
 +
** https://openfoodfacts.slack.com/archives/C081BENER/p1587568951002800
 +
** <nowiki>https://tools.wmflabs.org/lexeme-forms/</nowiki>
 +
** <nowiki>https://www.wikidata.org/wiki/Wikidata:Wikidata_Lexeme_Forms</nowiki>
 +
** Exemple d'utilisation avec <nowiki>https://tools.wmflabs.org/lexeme-forms/template/french-adjective/</nowiki>
 +
** See SPARQL queries for current data
 +
* <nowiki>https://www.wikidata.org/wiki/Wikidata:Property_proposal/GS1_GPC_brick_code</nowiki>
 +
* <nowiki>https://www.wikidata.org/wiki/Wikidata:Property_proposal/note</nowiki>
 +
* <nowiki>https://www.wikidata.org/wiki/Wikidata:Property_proposal/Common_procurement_vocabulary#Discussion</nowiki>
 +
* add images to food on Wikidata: <nowiki>https://tools.wmflabs.org/fist/wdfist/?sparql=SELECT%20?item%20WHERE%20{%20?item%20wdt:P31%20wd:Q5%20.%20?item%20wdt:P27%20wd:Q889%20}#top</nowiki>
  
 
== Getting information from Wikidata ==
 
== Getting information from Wikidata ==
Line 24: Line 52:
 
* food additives : http://tools.wmflabs.org/wikidata-todo/tree.html?q=189567&rp=279
 
* food additives : http://tools.wmflabs.org/wikidata-todo/tree.html?q=189567&rp=279
 
* brands : http://tools.wmflabs.org/wikidata-todo/tree.html?q=167270&rp=31
 
* brands : http://tools.wmflabs.org/wikidata-todo/tree.html?q=167270&rp=31
 +
* dishes: http://tools.wmflabs.org/wikidata-todo/tree.html?q=746549&rp=279
 +
* https://www.wikidata.org/w/index.php?search=&search=%22as+used+in+cosmetics%22&title=Special:Search&go=Go&ns0=1&ns1=1&ns4=1&ns120=1
 +
*
 +
 +
== Food properties ==
 +
 +
* barcode property: <nowiki>https://www.wikidata.org/wiki/Property:P3962</nowiki>
 +
* PLU Code property: <nowiki>https://www.wikidata.org/wiki/Property:P4030</nowiki>
 +
* INAO:  <nowiki>https://www.wikidata.org/wiki/Property:P3895</nowiki>
 +
 +
* https://www.wikidata.org/wiki/Wikidata:Property_proposal/AGROVOC_ID
 +
* https://www.wikidata.org/wiki/Wikidata:Property_proposal/Forest_Stewardship_Council_Certificate_Code
 +
* https://www.wikidata.org/wiki/Wikidata:Property_proposal/Forest_Stewardship_Council_License_Code
 +
 +
== Tools ==
 +
Getting a wikidata taxonomy in JSON
 +
npm install -g wikidata-taxonomy
 +
wdtaxonomy -d -i -f json 2095
 +
<nowiki>https://www.npmjs.com/package/wikidata-taxonomy</nowiki>
 +
 +
== SPARQL ==
 +
For SPARQL queries: <nowiki>https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries#Understanding_SPARQL</nowiki> -
 +
 +
* All cheses made with cow milk: <nowiki>https://query.wikidata.org/#%23Cheeses%0ASELECT%20%3Fitem%20%3FitemLabel%0AWHERE%0A%7B%0A%09%3Fitem%20wdt%3AP279%20wd%3AQ3088299%20.%0A%09SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%7D%0A%7D</nowiki>
 +
* EFSA opinions: https://query.wikidata.org/#SELECT%20%3Fitem%20%28SUBSTR%28%3Fpublished1%2C%201%2C%2010%29%20as%20%3Fpublished%20%29%3Fvolume%20%3Fissue%20%3Fpages%20%3Fdoi%20%3Ftitle%20WHERE%20%7B%20%20%0A%20%20%3Fitem%20wdt%3AP1433%20wd%3AQ45098548%20.%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP577%20%3Fpublished1%7D%20.%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP478%20%3Fvolume%7D%20.%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP433%20%3Fissue%7D%20.%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP304%20%3Fpages0%7D%20.%20%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP356%20%3Fdoi%7D%20.%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP1476%20%3Ftitle%7D%20.%20%0A%20%20BIND%28REPLACE%28%3Fpages0%2C%20%22-%22%2C%20%22%E2%80%93%22%29%20AS%20%3Fpages%29%0A%20%20BIND%28if%28contains%28%3Fpages%2C%20%20%22%E2%80%93%22%29%2C%20strbefore%28%3Fpages%2C%20%22%E2%80%93%22%29%2C%20%3Fpages%29%20as%20%3Fstartpage%29%0A%20%20BIND%28if%28contains%28%3Fpages%2C%20%20%22%E2%80%93%22%29%2C%20strafter%28%3Fpages%2C%20%22%E2%80%93%22%29%2C%20%3Fpages%29%20as%20%3Fendpage%29%0A%7D%0AORDER%20BY%20ASC%28%3Fpublished%29%20ASC%28xsd%3Ainteger%28%3Fissue%29%29%20ASC%28xsd%3Ainteger%28%3Fstartpage%29%29
 +
* Country adjectives (for the ingredients parser): https://query.wikidata.org/embed.html#%23Noms%20des%20pays%20d%E2%80%99Afrique%20dans%20leurs%20langues%20officielles%20ainsi%20qu%E2%80%99en%20anglais%0ASELECT%20DISTINCT%20%3Fitem%20%3FitemLabel_ol%20%3Fadjectives%20%3FitemLabel_en%20WHERE%20%7B%0A%20%20%3Fitem%20wdt%3AP31%20wd%3AQ6256%20%3B%0A%20%20%20%20%20%20%20%20wdt%3AP1549%20%3Fadjectives.%0A%7D%0AORDER%20BY%20%3Fitem%20%3FitemLabel_lol%20%3Fadjectives
  
 
== Models on the French Wikipedia ==
 
== Models on the French Wikipedia ==
Line 29: Line 83:
 
* [https://fr.wikipedia.org/wiki/Mod%C3%A8le:OpenFoodFacts_Additif Modèle:OpenFoodFacts_Additif]
 
* [https://fr.wikipedia.org/wiki/Mod%C3%A8le:OpenFoodFacts_Additif Modèle:OpenFoodFacts_Additif]
  
 +
== Presentation during the Wikidata Reuse Days ==
 +
* Presentation slides: https://docs.google.com/presentation/d/1_WRGmyM7N6bsP4UPmdu1zeNC71By3RHEZNYs6wOCPfI/edit?usp=sharing
 +
* https://diff.wikimedia.org/event/%e2%99%bb%ef%b8%8f-open-food-facts-and-wikidata-structured-food-for-thought/
 +
 +
== Open Beauty Facts ==
 +
https://wiki.openfoodfacts.org/OBF:Wikidata
 +
 +
== Open Products Facts ==
 +
* We have 36000 categories of products to model
 +
* We have many times this of instances of products
 +
* We have all the associated properties, brands, labels… to improve maintain…
 +
 +
== Open Pet Food Facts ==
 +
 +
== Other/To investigate ==
 +
* Interesting ESG data projects: https://wikirate.org/The_Coca_Cola_Company, Open Corporates
 
[[Category:Structured Data]]
 
[[Category:Structured Data]]
 +
[[Category:Open Food Facts]]
 +
[[Category:Wikidata]]
 +
== Get in touch ==
 +
{{Box
 +
| 1    =  Slack channel
 +
| 2    =  [https://openfoodfacts.slack.com/messages/C081BENER/ #wikidata]
 +
}}

Latest revision as of 10:34, 17 August 2024

This project aims at improving Wikidata with Open Food Facts Data, with the aim of eventually reusing the data, and linking the Open Food Facts data with Wikidata, and thus with many other services.

See also: https://www.wikidata.org/wiki/Wikidata:WikiProject_Food

Companies

Brands

  • Marking brands as "instance of" brands
  • Adding the Wikidata item number (QXXXXXX) on the Open Food Facts taxonomy

Categories

  • Marking categories as "subclass of" their parent category
  • Adding the Wikidata item number (QXXXXXX) on the Open Food Facts taxonomy

Labels

Additives

Ingredients

Diets

Diets on Wikidata: https://tools.wmflabs.org/wikidata-todo/tree.html?q=474191&rp=279,31

Stores

Getting information into Wikidata

Getting information from Wikidata

Food properties

  • barcode property: https://www.wikidata.org/wiki/Property:P3962
  • PLU Code property: https://www.wikidata.org/wiki/Property:P4030
  • INAO: https://www.wikidata.org/wiki/Property:P3895

Tools

Getting a wikidata taxonomy in JSON

npm install -g wikidata-taxonomy
wdtaxonomy -d -i -f json 2095

https://www.npmjs.com/package/wikidata-taxonomy

SPARQL

For SPARQL queries: https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries#Understanding_SPARQL -

Models on the French Wikipedia

Presentation during the Wikidata Reuse Days

Open Beauty Facts

https://wiki.openfoodfacts.org/OBF:Wikidata

Open Products Facts

  • We have 36000 categories of products to model
  • We have many times this of instances of products
  • We have all the associated properties, brands, labels… to improve maintain…

Open Pet Food Facts

Other/To investigate

Get in touch

Slack channel