class SimpleProvenanceService implements ProvenanceService {

    @Override
    public void addActivity(Activity activity) {
        try (RepositoryConnection conn = repo.getConnection()) {
            if (conn.contains(activity.getResource(), null, null)) {
                throw new IllegalArgumentException("Activity " + activity.getResource() + " already exists");
            }
            conn.add(activity.getModel());
        }
    }

}