what is the {series ordinal} for {James A. Garfield} has {position held} as {President of the United States} ?
Which number US president was James A. Garfield ?
Which President of the United States was James A. Garfield?
SELECT ?t WHERE { ?g property:series_ordinal ?t . resource:James_A._Garfield property:position_held ?g . ?g property:position_held resource:President_of_the_United_States }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q34597> .
?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/Q11696> .
?statement <http://www.wikidata.org/entity/P1545> ?value. 
} 

SELECT ?value WHERE { wd:Q34597 p:P39 ?s . ?s ps:P39 wd:Q11696 . ?s pq:P1545 ?value}