How many {librettist} are to/by {Oscar Hammerstein II} ?
Provide the number of Songs has Oscar Hammerstein released.
How many songs has Oscar Hammerstein II made?
SELECT ( COUNT ( ?x ) AS ?l ) { ?x property:librettist resource:Oscar_Hammerstein_II }
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/P87> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q319693 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P87 wd:Q319693 }
18