Since you are dealing with classification, it might be interesting for you to have a look at AlchemyAPI, http://www.alchemyapi.com/products/features/
. You have a free api key where you can try things.
But this doesn't stops here, if you want to do it manually, as your can see in @tripleee answer, WordNet is mentioned, this is also something interesting, and right now you have API where you can use like Java and interact with WordNet.
More, you have ontologies and many are free, these ontologies are normally in OWL or RDF. You can query these ontologies and find the relevant information. For OWL ontologies, you have the OWLAPI which you can use to interact, for RDF ontologies, you can use Apache Jena and write SPARQL statements.
Also, you have dbpedia, which is very very interesting and I believe that this might solve your problem to a big extent. dbpedia is Wikipedia in machine-readable format.
For example, you can write SPARQL (much like SQL Statements), for e.g. suppose I want to check the relationship between London and UK,
SELECT ?property
WHERE {
:London ?property :United_Kingdom
}
OR suppose that I want to get all countries and cities,
SELECT DISTINCT ?city ?country
WHERE { ?city rdf:type dbpedia-owl:City ;
rdfs:label ?label ;
dbpedia-owl:country ?country
}