How many {author of foreword} are to/by {John Lasseter} ?
John Lasseter authored how many forewords?
How many forewords did John Lasseter author?
SELECT ( COUNT ( ?t ) AS ?g ) { ?t property:author_of_foreword resource:John_Lasseter }
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/P2679> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q269214 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P2679 wd:Q269214 }
5