# Construct religion affiliation 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 relgp:    <http://example.org/migrants/religions#>

CONSTRUCT {
  ?s a tm:ReligionAffiliation .
  ?s tm:religionAffiliationPerson ?person .
  ?s tm:religion ?religion .
  ?s tm:denomination ?denomination .
  ?s rdfs:comment ?comment .
  ?s tm:dateStartMin ?dsMin .
  ?s tm:dateStartMax ?dsMax .
  ?s tm:dateEndMin ?deMin .
  ?s tm:dateEndMax ?deMax .
  ?s tm:dateStartFuzzy ?dsFuzzy .
}
WHERE {
  ?s a migrants:religions .
  OPTIONAL { ?s relgp:ref-IDPerson ?person }
  OPTIONAL { ?s relgp:religion ?religion }
  OPTIONAL { ?s relgp:denomination ?denomination }
  OPTIONAL { ?s relgp:comment ?comment }
  OPTIONAL { ?s relgp:date_start ?dsMin }
  OPTIONAL { ?s relgp:DateStart_Max ?dsMax }
  OPTIONAL { ?s relgp:DateEnd_Min ?deMin }
  OPTIONAL { ?s relgp:DateEnd_Max ?deMax }
  OPTIONAL { ?s relgp:DateStart_Fuzzy ?dsFuzzy }
}
