what is the {series ordinal} for {James Irwin} has {given name} as {James} ?
Who was the first James Irwin?
Who was the first James Irwin named James?
SELECT ?a WHERE { ?y property:given_name resource:James . ?y property:series_ordinal ?a . resource:James_Irwin property:given_name ?y }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q297801> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P735> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q677191> .
?statement <http://www.wikidata.org/entity/P1545> ?value. 
} 

SELECT ?value WHERE { wd:Q297801 p:P735 ?s . ?s ps:P735 wd:Q677191 . ?s pq:P1545 ?value}