# Construct person-name triples with tm: vocabulary.

PREFIX rdfs:     <http://www.w3.org/2000/01/rdf-schema#>
PREFIX tm:       <https://daniel.degu.cl/ontologies/theatre-migrants/>
PREFIX migrants: <http://example.org/migrants/>
PREFIX pnp:      <http://example.org/migrants/personnames#>

CONSTRUCT {
  ?s a tm:PersonName .
  ?s tm:personNamePerson ?person .
  ?s tm:nameType ?nameType .
  ?s tm:personName ?name .
  ?s tm:personSurName ?surname .
  ?s rdfs:comment ?comment .
  ?s tm:dateStartMin ?dsMin .
  ?s tm:dateStartMax ?dsMax .
  ?s tm:dateEndMin ?deMin .
  ?s tm:dateEndMax ?deMax .
  ?s tm:dateStartFuzzy ?dsFuzzy .
  ?s tm:dateEndFuzzy ?deFuzzy .
}
WHERE {
  ?s a migrants:personnames .
  OPTIONAL { ?s pnp:ref-IDPerson ?person }
  OPTIONAL { ?s pnp:Nametype ?nameType }
  OPTIONAL { ?s pnp:personName ?name }
  OPTIONAL { ?s pnp:personSurName ?surname }
  OPTIONAL { ?s pnp:comment ?comment }
  OPTIONAL { ?s pnp:DateStart_Min ?dsMin }
  OPTIONAL { ?s pnp:DateStart_Max ?dsMax }
  OPTIONAL { ?s pnp:DateEnd_Min ?deMin }
  OPTIONAL { ?s pnp:DateEnd_Max ?deMax }
  OPTIONAL { ?s pnp:DateStart_Fuzzy ?dsFuzzy }
  OPTIONAL { ?s pnp:DateEnd_Fuzzy ?deFuzzy }
}
