Thanks for the quick reply Frederick, Hmm, List_of_colors does exist, and I got the basic results via this query on dbpedia's endpoint:
SELECT * WHERE {<http://dbpedia.org/resource/List_of_colors> ?p ?o} Please try this link: http://tinyurl.com/5c3qx2 Can you check and see if that works? This list has a lot more colors and corresponding hex values and is the reason why I'm querying it. I just don't understand how I'll get the separated names and hex values to come together. Thanks also for the example you gave; that's a great way to get the names but due to the inconsistencies of the wikipedia content there's not too many colors that match the query. However I'll see how I can work with your example on the above resource. If anyone has a solution to the same question, i.e. getting names+hex values from the List_of_colors resource, I will be eternally grateful! Cheers, Andrew On May 6, 2008, at 11:10 AM, Frederick Giasson wrote: > Hi Andrew, > > > > First, where List_of_colors doesn't seems to be on the dbpedia > endpoint (http://dbpedia.org/sparql/) > > > So I had to tweak it a bit (dunno if all colors are there): > > SELECT ?colorName ?hexValue from <http://dbpedia.org> WHERE > { > ?color <http://dbpedia.org/property/rgbspace> > <http://dbpedia.org/resource/sRGB_color_space > >. > ?color <http://dbpedia.org/property/hex> ?hexValue. > ?color <http://dbpedia.org/property/title> ?colorName. > } > > What I hope is that all colors have the property "rgbspace" with > "<http://dbpedia.org/resource/sRGB_color_space > >" has object. > > From there you get hex-values with names (titles...). > > The top 25 results are: *http://tinyurl.com/5xqaat > > > Names are weird though.... > > > Hope this helps. > > > Take care, > > Fred > * >> Hi everyone, >> >> I have a question with regards to forming a SPARQL query for >> DBPedia. I'm new to SPARQL and some help here will really be >> appreciated. >> >> What I'm trying to do is to pull off the list of colors, as well >> as their corresponding hex values off of this resource: >> >> http://dbpedia.org/resource/List_of_colors >> >> My test SPARQL query to grab all of the content in there looks >> like this: >> >> SELECT ?property ?hasValue WHERE { >> <http://dbpedia.org/resource/List_of_colors> ?property ?hasValue >> } >> >> And it looks good; I'm getting color names nicely split into >> separate elements: >> http://dbpedia.org/property/name http://dbpedia.org/resource/Alice_blue >> http://dbpedia.org/property/name http://dbpedia.org/resource/ >> Alizarin >> http://dbpedia.org/property/name >> http://dbpedia.org/resource/Amaranth_%28color%29 >> http://dbpedia.org/property/name >> http://dbpedia.org/resource/Aqua_%28color%29 >> ... >> >> The problem is, the corresponding hex values are dumped further >> down in separate rows: >> http://dbpedia.org/property/hex 0000C8 >> http://dbpedia.org/property/hex 0000CD >> http://dbpedia.org/property/hex 0000FF >> http://dbpedia.org/property/hex 002FA7 >> ... >> >> This list of colors are ordered by their hex value, and so do not >> match the same order of the list of color names. >> >> So my question is this: how will I be able to grab the matching >> hex values for each color? >> >> >> >> Thanks and regards, >> Andrew >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save >> $100. Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> _______________________________________________ >> Dbpedia-discussion mailing list >> Dbpedia-discussion@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion >> > ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Dbpedia-discussion mailing list Dbpedia-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion