Skip to content

Add Graph.add_many to add an iterable of triples #3353

@multimeric

Description

@multimeric

This is such a common case that I think it would be nice to simplify it. For example, I propose:

from rdflib import Graph, BNode, SDO

graph = Graph()
entity = BNode()

graph.add_many([
    (entity, SDO.name, Literal("The Entity")),
    (entity, SDO.description, Literal("Description of the entity"))
])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions