def filter_individuals(graph, s, *args):
    """Filtering function to keep just the individuals of the classes
    we are interested in when serializing.
    :param graph: OWLReady2 graph
    :param s: storeid specifying an individual in graph.onto
    :return: Boolean deciding whether the instance specified by its storeid
             should be returned or not
    """
    classes = [graph.onto.Line, graph.onto.Word, graph.onto.Syllable]
    return s >= 0 and any(isinstance(graph.onto.world._get_by_storid(s), cls)
                          for cls in classes)