Skip to content

Update graph.rst - teachers to lectures #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

veto8
Copy link

@veto8 veto8 commented May 12, 2025

The graph linking should be teachers to lectures
instead teachers to teachers
teach = school.create_edge_definition(
edge_collection='teach',
from_vertex_collections=['teachers'],
to_vertex_collections=['lectures']
)

The graph linking should be teachers to lectures
instead teachers to teachers 
 teach = school.create_edge_definition(
            edge_collection='teach',
            from_vertex_collections=['teachers'],
            to_vertex_collections=['lectures']
        )
@apetenchea apetenchea self-requested a review May 16, 2025 20:25
Copy link
Member

@apetenchea apetenchea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somewhat debatable, see the whole example:

# Create an edge definition named "teach". This creates any missing
# collections and returns an API wrapper for "teach" edge collection.
if not school.has_edge_definition('teach'):
    teach = school.create_edge_definition(
        edge_collection='teach',
        from_vertex_collections=['teachers'],
        to_vertex_collections=['teachers']
    )

# List edge definitions.
school.edge_definitions()

# Replace the edge definition.
school.replace_edge_definition(
    edge_collection='teach',
    from_vertex_collections=['teachers'],
    to_vertex_collections=['lectures']
)

The edge definition is replaced with the correct one later on. I am not sure if this was intended to illustrate a replacement use-case, or if was a mistake.

I suggest making it obvious this time by also editing the replace_edge_definition call too with something like:

# Replace the edge definition.
    school.replace_edge_definition(
        edge_collection='teach',
        from_vertex_collections=['teachers'],
        to_vertex_collections=['new_lectures']
)

This way we've got teachers->lectures which gets replaced by teachers->new_lectures. I feel like it illustrates the point even better.

What do you think?

@apetenchea apetenchea mentioned this pull request Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants