If the article is about Lebron_James, then i would know it's about an athelete.
Asked
Active
Viewed 79 times
-2
-
2How would it magically accomplish that? You could use categories, maybe – Michael Mrozek Jul 20 '10 at 18:52
-
And if it's `Thomas_Jefferson`, it would detect with impeccable precision that it's the Caymanian Politician: http://en.wikipedia.org/wiki/Thomas_Jefferson_%28Caymanian_politician%29 – Pekka Jul 20 '10 at 18:53
-
1But seriously: Are you asking about ways to query Wikipedia? – Pekka Jul 20 '10 at 18:54
-
@Pekka, if you already have the article link ready. how would u determine this? – tomxu Jul 20 '10 at 22:56
-
@tomxu it's not easy, because Wikipedia doesn't have one single categorization like "Athlete". Your best bet is probably to parse the "Categories" links in the page foot using something like SimpleHTMLDom, and try to fetch out the category relevant for you. – Pekka Jul 21 '10 at 07:34
-
Wikipedia uses brackets e.g. Crisp (potato chip), Crisp (surname), etc for the **article name** Or, indeed, use categories. But I'm not sure what this question is trying to ask. @Tomxu - please clarify. – Reinstate Monica - Goodbye SE Jul 21 '10 at 18:41
-
@Tomxu - one more try - if what I wrote above is what you are looking for, please say so and I will answer. If not, please say what it is. – Reinstate Monica - Goodbye SE Jul 26 '10 at 21:00
1 Answers
0
Categories are useful but infoboxes are better. The problem then becomes how can you utilize the information in the infoboxes?
Have a look at the magic that is DBpedia. You'll have to read a fair chunk before you can play with it and then SPARQL has a hefty learning curve too:
SELECT ?property ?hasValue ?isValueOf
WHERE {
{ <http://dbpedia.org/resource/LeBron_James> ?property ?hasValue }
UNION
{ ?isValueOf ?property <http://dbpedia.org/resource/LeBron_James> }
}
Stackoverflow doesn't like this URL but it has tons of useful info for you to process:
http://dbpedia.org/snorql/?query=SELECT+%3Fproperty+%3FhasValue+%3FisValueOf%0D%0AWHERE+{%0D%0A++{+%3Chttp://dbpedia.org/resource/LeBron_James%3E+%3Fproperty+%3FhasValue+}%0D%0A++UNION%0D%0A++{+%3FisValueOf+%3Fproperty+%3Chttp://dbpedia.org/resource/LeBron_James%3E+}%0D%0A}

hippietrail
- 15,848
- 18
- 99
- 158