what is the {series ordinal} for {Megawati Sukarnoputri} has {position held} as {President of Indonesia} ?
Megawati Sukarnoputri was what number President of Indonesia?
What number President of Indonesia was Megawati Sukarnoputri?
SELECT ?c WHERE { ?q property:series_ordinal ?c . resource:Megawati_Sukarnoputri property:position_held ?q . ?q property:position_held resource:President_of_Indonesia }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q76179> .
?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/Q11755916> .
?statement <http://www.wikidata.org/entity/P1545> ?value. 
} 

SELECT ?value WHERE { wd:Q76179 p:P39 ?s . ?s ps:P39 wd:Q11755916 . ?s pq:P1545 ?value}