Filaments in observed and mock galaxy catalogues