-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added common lib for ingestion and query utility
- Loading branch information
Showing
10 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
Empty file.
Empty file.
17 changes: 17 additions & 0 deletions
17
unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/base_models.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from neomodel import ( | ||
StructuredNode, | ||
StringProperty, | ||
JSONProperty, | ||
ArrayProperty, | ||
StructuredRel | ||
) | ||
|
||
class BaseNode(StructuredNode): | ||
"""Base node with common properties""" | ||
qualified_name = StringProperty(unique_index=True, required=True) | ||
objective_embedding = ArrayProperty(default=[]) | ||
implementation_embedding = ArrayProperty(default=[]) | ||
|
||
class ContainsRelationship(StructuredRel): | ||
"""Relationship for representing containment between nodes""" | ||
pass |
11 changes: 11 additions & 0 deletions
11
unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/class_node.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from .base_models import BaseNode, ContainsRelationship | ||
from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One | ||
|
||
class Class(BaseNode): | ||
"""Represents a class in a package""" | ||
node_name = StringProperty(required=True) | ||
node_summary = StringProperty(default="") | ||
node_objective = StringProperty(default="") | ||
# Class relationships | ||
package = RelationshipFrom('Package', 'CONTAINS', model=ContainsRelationship, cardinality=One) | ||
methods = RelationshipTo('Method', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) |
18 changes: 18 additions & 0 deletions
18
...lat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/codebase_node.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from neomodel import ( | ||
StringProperty, | ||
RelationshipTo, | ||
RelationshipFrom, | ||
ZeroOrMore, | ||
One | ||
) | ||
from .base_models import BaseNode, ContainsRelationship | ||
|
||
class Codebase(BaseNode): | ||
"""Represents a codebase in the system""" | ||
codebase_summary = StringProperty(default="") | ||
codebase_objective = StringProperty(default="") | ||
# One codebase can contain multiple packages | ||
packages = RelationshipTo('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) | ||
|
||
|
||
|
9 changes: 9 additions & 0 deletions
9
unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/method_node.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from .base_models import BaseNode, ContainsRelationship | ||
from neomodel import RelationshipFrom, StringProperty,One | ||
|
||
class Method(BaseNode): | ||
"""Represents a method in a class""" | ||
function_name = StringProperty(required=True) | ||
function_summary = StringProperty(default="") | ||
# Method relationships | ||
class_ = RelationshipFrom('Class', 'CONTAINS', model=ContainsRelationship, cardinality=One) |
12 changes: 12 additions & 0 deletions
12
unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/package_node.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from .base_models import BaseNode, ContainsRelationship | ||
from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One | ||
|
||
class Package(BaseNode): | ||
"""Represents a package in the codebase""" | ||
package_objective = StringProperty(required=True) | ||
package_summary = StringProperty(required=True) | ||
# Package relationships | ||
codebase = RelationshipFrom('Codebase', 'CONTAINS', model=ContainsRelationship, cardinality=One) | ||
sub_packages = RelationshipTo('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) | ||
parent_package = RelationshipFrom('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) | ||
classes = RelationshipTo('Class', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) |