def value(self, subject=None, predicate=RDF.value, object=None,
              default=None, any=True):
        retval = default

        if (subject is None and predicate is None) or \
                (subject is None and object is None) or \
                (predicate is None and object is None):
            return None

        if object is None:
            values = self.objects(subject, predicate)
        if subject is None:
            values = self.subjects(predicate, object)
        if predicate is None:
            values = self.predicates(subject, object)

        try:
            retval = values.next()
        except StopIteration:
            retval = default
        else:
            if any is False:
                try:
                    values.next()
                    msg = ("While trying to find a value for (%s, %s, %s) the"
                           " following multiple values where found:\n" %
                           (subject, predicate, object))
                    triples = self.store.triples(
                        (subject, predicate, object), None)
                    for (s, p, o), contexts in triples:
                        msg += "(%s, %s, %s)\n (contexts: %s)\n" % (
                            s, p, o, list(contexts))
                    raise exceptions.UniquenessError(msg)
                except StopIteration:
                    pass
        return retval
The L{Deferred} returned by L{ClientCreator.connectTCP} can be cancelled
dataset/ETHPy150Open RDFLib/rdflib/rdflib/graph.py/Graph.value--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/internet/test/test_protocol.py/ClientCreatorTests.test_cancelConnectTCP