Querying: Difference between revisions

Jump to navigation Jump to search
adding nahiye seat query
(adding nahiye seat query)
Line 162: Line 162:
   #enter same year twice
   #enter same year twice
   FILTER(YEAR(?starttime) <= 1700 && YEAR(?endtime) > 1700)
   FILTER(YEAR(?starttime) <= 1700 && YEAR(?endtime) > 1700)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
=== Map of nahiye seats, colored by vilayet, in 1900 ==
This is a variation on the sancak seat map on the main page. [http://tinyurl.com/2ae3rfxb run]
SELECT ?vilayet3Label ?nahiyeSeat_ota ?nahiyeSeat ?nahiyeCoord ?nahiyeSeatLabel
WHERE
{   
  # nahiye
  ?nahiye ogp:P15 ?statement4.
  ?statement4 ogps:P15 og:Q2.
  ?statement4 ogpq:P7 ?starttime4.
  ?statement4 ogpq:P34 ?kaza2.
  ?nahiye ogt:P14 ?nahiyeSeat.
  ?nahiyeSeat ogt:P10 ?nahiyeCoord.
  OPTIONAL{?statement4 ogpq:P8 ?endtime4.}
  OPTIONAL{?statement4 ogpq:P22 ?endtime4.}
           
  # find sanckas for kazas
  ?kaza2 ogp:P15 ?statement5.
  ?statement5 ogps:P15 og:Q3.
  ?statement5 ogpq:P7 ?starttime5.
  ?statement5 ogpq:P34 ?sancak3.
  OPTIONAL{?statement5 ogpq:P8 ?endtime5.}
  OPTIONAL{?statement5 ogpq:P22 ?endtime5.}
             
  # find vilayets for kazas
  ?sancak3 ogp:P15 ?statement6.
  ?statement6 ogps:P15 og:Q4.
  ?statement6 ogpq:P7 ?starttime6.
  ?statement6 ogpq:P34 ?vilayet3.
  OPTIONAL{?statement6 ogpq:P8 ?endtime6.}
  OPTIONAL{?statement6 ogpq:P22 ?endtime6.}
 
  # get ottoman label
  ?nahiyeSeat rdfs:label ?nahiyeSeat_ota filter (lang(?nahiyeSeat_ota) = "ota")
           
  #enter same year twice
  FILTER(YEAR(?starttime4) <= 1900 && YEAR(?endtime4) > 1900)
  FILTER(YEAR(?starttime5) <= 1900 && YEAR(?endtime5) > 1900)
  FILTER(YEAR(?starttime6) <= 1900 && YEAR(?endtime6) > 1900)
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
  }
  }

Navigation menu