def get_rdf_object(graph, subject, predicate):
    """Takes an rdflib Graph, subject and predicate, and returns the first
    matching object if one exists. If none exist, returns None."""
    objects = list(graph.objects(subject, predicate))
    if len(objects) == 0:
        return None
    else:
        return objects[0].toPython()
