Get all defined colors using DBpedia and SPARQL

How can I query DBpedia to get the names and hexadecimal codes of all color values ​​(i.e. any use of the color info color ) on Wikipedia? Spring Green uses the color pattern as follows:

 {{infobox color| title=Spring Green|textcolor=black| hex=00FF7F| r= 0|g= 255|b= 127|sRGB=1 c=100|m=0|y=50|k=0| h=150|s=100|v=100<ref>{{cite web|url=http://web.forret.com/tools/color.asp?RGB=%2300FF7F|title=web.forret.com Color Conversion Tool set to hex code of color #00FF7F (Spring Green):}}</ref> |source=[[Web colors#X11 color names|X11]]}} 
+4
source share
1 answer

You can try the following query:

 select distinct ?colour ?hex where { ?colour a dbpedia-owl:Colour . ?colour dbpprop:hex ?hex . } 

see the results here .

also the following query:

 select distinct ?colour ?hex where { ?colour a dbpedia-owl:Colour . ?colour dbpedia-owl:colourHexCode ?hex . } 

and the result .

+7
source

Source: https://habr.com/ru/post/1393257/


All Articles