title: date-literal-based immediately-precedes construction
body: <p>I have triples asserting that two different people (B and C) each have one patient role.  These roles are realized in three healthcare encounters each.  There's a process boundary that starts each encounter and a time measurement datum that's about each process boundary.  The time measurement datums have <code>xsd:date</code> values asserted with predicate <code>ns1:TURBO_0010094</code>.  See end of post.</p>
  
  <p>I would like to construct a timeline, in which each health care encounter can precede a maximum of one other encounter "belonging" to the same person.  I have a statement that constructs "encounter X precedes encounter Y" statements, but it obvious generates the following (using some <em>ad-hoc</em> abbreviation):</p>
  
  <ul>
  <li>HCE_B1 precedes HCE_B2 </li>
  <li>HCE_B1 precedes HCE_B3 </li>
  <li>HCE_B2 precedes HCE_B3</li>
  </ul>
  
  <p>I only want to say </p>
  
  <ul>
  <li>HCE_B1 precedes HCE_B2 </li>
  <li>HCE_B2 precedes HCE_B3</li>
  </ul>
  
  <p>Any chance this can be done in a single <code>construct</code> statement?  Here's what I have so far:</p>
  
  <pre><code>PREFIX obo: &lt;http://purl.obolibrary.org/obo/&gt;
  PREFIX ns1: &lt;http://transformunify.org/ontologies/&gt;
  construct {
      ?hce1 obo:BFO_0000063 ?hce2
  }
  WHERE {
      ?person rdf:type obo:NCBITaxon_9606 .
      ?patrole rdf:type obo:OMRSE_00000011 ;
               obo:RO_0000052 ?person .
      ?hce1 rdf:type obo:OGMS_0000097 ;
            obo:BFO_0000055 ?patrole .
      ?hce2 rdf:type obo:OGMS_0000097 ;
            obo:BFO_0000055 ?patrole .
      ?procbound1 rdf:type obo:BFO_0000035 ;
                  obo:RO_0002223 ?hce1 .
      ?procbound2 rdf:type obo:BFO_0000035 ;
                  obo:RO_0002223 ?hce2 .
      ?tmd1 rdf:type obo:IAO_0000416 ;
            obo:IAO_0000136 ?procbound1 ;
            ns1:TURBO_0010094 ?dateval1 .
      ?tmd2 rdf:type obo:IAO_0000416 ;
            obo:IAO_0000136 ?procbound2 ;
            ns1:TURBO_0010094 ?dateval2 .
      filter(?dateval2 &gt; ?dateval1)
  }
  </code></pre>
  
  <p>Data:</p>
  
  <pre><code>prefix obo: &lt;http://purl.obolibrary.org/obo/&gt; 
  prefix ns1: &lt;http://transformunify.org/ontologies/&gt; 
  prefix ns2: &lt;http://example.org/temporality_support/&gt;
  prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; 
  
  
  obo:HTN_00000010
    a obo:NCBITaxon_9606 ;
    rdfs:label "Basil" .
  
  obo:HTN_00000011
    a obo:NCBITaxon_9606 ;
    rdfs:label "Clara" .
  
  obo:HTN_00000019
    a obo:OGMS_0000097 ;
    obo:BFO_0000055 obo:HTN_00000029 ;
    rdfs:label "Basil's first health care encounter" .
  
  obo:HTN_00000029
    a obo:OMRSE_00000011 ;
    obo:RO_0000052 obo:HTN_00000010 ;
    rdfs:label "Basil's patient role" .
  
  obo:HTN_00000020
    a obo:OGMS_0000097 ;
    obo:BFO_0000055 obo:HTN_00000029 ;
    rdfs:label "Basil's second health care encounter" .
  
  ns2:9be7ae98-44f6-4d95-9938-4a91e1ade556
    a obo:OGMS_0000097 ;
    obo:BFO_0000055 obo:HTN_00000029 ;
    rdfs:label "Basil's third health care encounter" .
  
  ns2:c75d9821-fa00-449c-9d0b-791c1bbbc07e
    a obo:BFO_0000035 ;
    obo:RO_0002223 ns2:9be7ae98-44f6-4d95-9938-4a91e1ade556 ;
    rdfs:label "B HCE 3 start" .
  
  ns2:ed7bbf74-60c3-4fd7-b46f-d3fa1771e219
    a obo:IAO_0000416 ;
    obo:IAO_0000136 ns2:c75d9821-fa00-449c-9d0b-791c1bbbc07e ;
    ns1:TURBO_0010094 "2019-01-22"^^xsd:date ;
    rdfs:label "B HCE 3 start date" .
  
  obo:HTN_00000023
    a obo:OGMS_0000097 ;
    obo:BFO_0000055 obo:HTN_00000030 ;
    rdfs:label "Clara's first health care encounter" .
  
  obo:HTN_00000030
    a obo:OMRSE_00000011 ;
    obo:RO_0000052 obo:HTN_00000011 ;
    rdfs:label "Clara's patient role" .
  
  ns2:5121d5e2-41ed-48e1-9253-0aa1830c3f00
    a obo:OGMS_0000097 ;
    obo:BFO_0000055 obo:HTN_00000029 ;
    rdfs:label "Clara's third health care encounter" .
  
  ns2:bc09fab9-76fb-4072-af37-f52b49ba9c64
    a obo:BFO_0000035 ;
    obo:RO_0002223 ns2:5121d5e2-41ed-48e1-9253-0aa1830c3f00 ;
    rdfs:label "C HCE 3 start" .
  
  ns2:881afd3a-cf77-4365-b54f-6c7c99fd1e4b
    a obo:IAO_0000416 ;
    obo:IAO_0000136 ns2:bc09fab9-76fb-4072-af37-f52b49ba9c64 ;
    ns1:TURBO_0010094 "2019-01-23"^^xsd:date ;
    rdfs:label "C HCE 3 start date" .
  
  obo:HTN_00000025
    a obo:OGMS_0000097 ;
    obo:BFO_0000055 obo:HTN_00000030 ;
    rdfs:label "Clara's second health care encounter" .
  
  ns2:IAO_0000416_2
    a obo:IAO_0000416 ;
    obo:IAO_0000136 ns2:BFO_0000035_2 ;
    ns1:TURBO_0010094 "2019-01-15"^^xsd:date ;
    rdfs:label "B HCE 2 start date" .
  
  ns2:BFO_0000035_2
    a obo:BFO_0000035 ;
    obo:RO_0002223 obo:HTN_00000020 ;
    rdfs:label "B HCE 2 start" .
  
  ns2:IAO_0000416_3
    a obo:IAO_0000416 ;
    obo:IAO_0000136 ns2:BFO_0000035_3 ;
    ns1:TURBO_0010094 "2019-01-09"^^xsd:date ;
    rdfs:label "C HCE 1 start date" .
  
  ns2:BFO_0000035_3
    a obo:BFO_0000035 ;
    obo:RO_0002223 obo:HTN_00000023 ;
    rdfs:label "C HCE 1 start" .
  
  ns2:IAO_0000416_4
    a obo:IAO_0000416 ;
    obo:IAO_0000136 ns2:BFO_0000035_4 ;
    ns1:TURBO_0010094 "2019-01-16"^^xsd:date ;
    rdfs:label "C HCE 2 start date" .
  
  ns2:BFO_0000035_4
    a obo:BFO_0000035 ;
    obo:RO_0002223 obo:HTN_00000025 ;
    rdfs:label "C HCE 2 start" .
  
  ns2:IAO_0000416_7
    a obo:IAO_0000416 ;
    obo:IAO_0000136 ns2:BFO_0000035_7 ;
    ns1:TURBO_0010094 "2019-01-08"^^xsd:date ;
    rdfs:label "B HCE 1 start date" .
  
  ns2:BFO_0000035_7
    a obo:BFO_0000035 ;
    obo:RO_0002223 obo:HTN_00000019 ;
    rdfs:label "B HCE 1 start" .
  </code></pre>