How many {home port} are to/by {Southampton} ?
How many home ports are by the Southhamptons?
SELECT ( COUNT ( ?m ) AS ?k ) { ?m property:home_port resource:Southampton }
SELECT (COUNT(?sub) AS ?subs ) {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?sub .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P504> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q79848 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P504 wd:Q79848 }
32