@py3compat.format_doctest_out
    def preferredLabel(self, subject, lang=None, default=None,
                       labelProperties=(SKOS.prefLabel, RDFS.label)):

        if default is None:
            default = []

        # setup the language filtering
        if lang is not None:
            if lang == '':  # we only want not language-tagged literals
                langfilter = lambda l: l.language is None
            else:
                langfilter = lambda l: l.language == lang
        else:  # we don't care about language tags
            langfilter = lambda l: True

        for labelProp in labelProperties:
            labels = filter(langfilter, self.objects(subject, labelProp))
            if len(labels) == 0:
                continue
            else:
                return [(labelProp, l) for l in labels]
        return default
Implemented by modules to set the output ports.
dataset/ETHPy150Open RDFLib/rdflib/rdflib/graph.py/Graph.preferredLabel--crossover with--dataset/ETHPy150Open VisTrails/VisTrails/vistrails/tests/resources/myjob.py/SuspendNJob.job_set_results