what is the {series ordinal} for {Caligula} has {position held} as {Roman emperor} ?
How many Roman emperors were there before Caligula?
How many people held the position of Roman emperor before Caligula?
SELECT ?f WHERE { ?d property:position_held resource:Roman_emperor . resource:Caligula property:position_held ?d . ?d property:series_ordinal ?f }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q1409> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P39> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q842606> .
?statement <http://www.wikidata.org/entity/P1545> ?value. 
} 

SELECT ?value WHERE { wd:Q1409 p:P39 ?s . ?s ps:P39 wd:Q842606 . ?s pq:P1545 ?value}