Question: What country trades with Mexico and was ruled by Philip IV of Spain?
Answer(s):
answer: Portugal

SPARQL query:
#MANUAL SPARQL
PREFIX ns: <http://rdf.freebase.com/ns/>
SELECT DISTINCT ?x 
WHERE {
	FILTER (?x != ns:m.0b90_r)
	{ 
	  ns:m.0b90_r ns:location.statistical_region.places_exported_to ?y .
	  ?y ns:location.imports_and_exports.exported_to ?x . 
	}
	UNION
	{
	  ns:m.0b90_r ns:location.statistical_region.places_imported_from ?y .
	  ?y ns:location.imports_and_exports.imported_from ?x . 
	}?x ns:royalty.kingdom.rulers ns:m.0132m7 . 
}