PREFIX xsd: PREFIX ex: PREFIX dc: # The closest pre-operative physical examination SELECT ?exam ?date { ?exam a ex:PhysicalExamination; dc:date ?date; ex:precedes ex:operation1 . ?op a ex:SurgicalProcedure; dc:date ?opDT . FILTER NOT EXISTS { ?otherExam a ex:PhysicalExamination; ex:follows ?exam; ex:precedes ex:operation1 } }