prefix bio:
prefix foaf:
prefix time:
prefix xsd:
prefix ex:
prefix thing:
# Find the latest address that contains a date before 1874
# Find the next address
select ?nameBefore ?nameAfter where {
thing:anon bio:condition ?condBefore .
?condBefore ex:residence ?resBefore .
?resBefore foaf:name ?nameBefore .
?condBefore time:intervalContains ?dateBefore .
filter (xsd:integer(?dateBefore) <= 1874) .
thing:anon bio:condition ?condAfter .
?condAfter ex:residence ?resAfter .
?resAfter foaf:name ?nameAfter .
?condAfter time:intervalContains ?dateAfter .
filter (xsd:integer(?dateAfter) > 1874) .
?condBefore time:intervalBefore ?condAfter .
}