Created
June 9, 2022 09:42
-
-
Save rjurney/a89e7f4d586c349ec276d15993f7d9ab to your computer and use it in GitHub Desktop.
Example of a GraphletBaseClass interface for serializing plain old python objects as DataFrames to encapsulate ETL logic inside a reusable class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GitRepo(GraphletBaseClass): | |
"""A GitRepo is a source code repository in a knowledge graph about the open source ecosystem.""" | |
structure = "node" | |
name = "repo" | |
def __init__(self, name, url, description, platform): | |
"""Instantiate a Git Repo given its properties""" | |
self._id = uuid.uuid4() | |
self._name = name | |
self._url = url | |
self._description = description | |
self._platform = platform | |
@graphlet.property("string", 1) | |
def name(self): | |
"""Parse a name and return it""" | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment