PREFIX xsd: PREFIX ex: PREFIX dc: # The closest pre-operative physical examination SELECT ?exam ?date { ?exam a ex:PhysicalExamination; dc:date ?date . ?op a ex:SurgicalProcedure; dc:date ?opDT . #MINUS { FILTER NOT EXISTS { ?otherExam a ex:PhysicalExamination; dc:date ?otherExDT FILTER(?date < ?otherExDT && ?otherExDT < ?opDT) } FILTER(?date < ?opDT) }