diff --git a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/class_node.py b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/class_node.py deleted file mode 100644 index f72a7b8..0000000 --- a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/class_node.py +++ /dev/null @@ -1,19 +0,0 @@ -from .base_models import BaseNode, ContainsRelationship -from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One,ArrayProperty,VectorIndex,FloatProperty - -class Class(BaseNode): - """Represents a class in a package""" - class_name = StringProperty(required=True) - class_implementation_summary = StringProperty(default="") - class_objective = StringProperty(default="") - class_objective_embedding = ArrayProperty( - FloatProperty(), - vector_index=VectorIndex(dimensions=4096, similarity_function='cosine') - ) - class_implementation_summary_embedding = ArrayProperty( - FloatProperty(), - vector_index=VectorIndex(dimensions=4096, similarity_function='cosine') - ) - # Class relationships - package = RelationshipFrom('Package', 'CONTAINS', model=ContainsRelationship, cardinality=One) - methods = RelationshipTo('Method', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) diff --git a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/codebase_node.py b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/codebase_node.py deleted file mode 100644 index c948796..0000000 --- a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/codebase_node.py +++ /dev/null @@ -1,29 +0,0 @@ -from neomodel import ( - StringProperty, - RelationshipTo, - RelationshipFrom, - ZeroOrMore, - One, - ArrayProperty, - VectorIndex, - FloatProperty -) -from .base_models import BaseNode, ContainsRelationship - -class Codebase(BaseNode): - """Represents a codebase in the system""" - codebase_summary = StringProperty(default="") - codebase_objective = StringProperty(default="") - codebase_objective_embedding = ArrayProperty( - FloatProperty(), - vector_index=VectorIndex(dimensions=4096, similarity_function='cosine') - ) - codebase_implementation_embedding = ArrayProperty( - FloatProperty(), - vector_index=VectorIndex(dimensions=4096, similarity_function='cosine') - ) - # One codebase can contain multiple packages - packages = RelationshipTo('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) - - - diff --git a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_class.py b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_class.py new file mode 100644 index 0000000..094331b --- /dev/null +++ b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_class.py @@ -0,0 +1,13 @@ +from .base_models import BaseNode, ContainsRelationship +from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One,ArrayProperty,VectorIndex,FloatProperty + +class ConfluenceClass(BaseNode): + """Represents a class in a package""" + class_name = StringProperty(required=True) + class_implementation_summary = StringProperty(default="") + class_objective = StringProperty(default="") + class_objective_embedding = ArrayProperty(FloatProperty()) + class_implementation_summary_embedding = ArrayProperty(FloatProperty()) + # Class relationships + package = RelationshipFrom('ConfluencePackage', 'CONTAINS', model=ContainsRelationship, cardinality=One) + methods = RelationshipTo('ConfluenceMethod', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) diff --git a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_codebase.py b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_codebase.py new file mode 100644 index 0000000..616f2a3 --- /dev/null +++ b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_codebase.py @@ -0,0 +1,23 @@ +from neomodel import ( + StringProperty, + RelationshipTo, + RelationshipFrom, + ZeroOrMore, + One, + ArrayProperty, + VectorIndex, + FloatProperty +) +from .base_models import BaseNode, ContainsRelationship + +class ConfluenceCodebase(BaseNode): + """Represents a codebase in the system""" + codebase_summary = StringProperty(default="") + codebase_objective = StringProperty(default="") + codebase_objective_embedding = ArrayProperty(FloatProperty()) + codebase_implementation_embedding = ArrayProperty(FloatProperty()) + # One codebase can contain multiple packages + packages = RelationshipTo('ConfluencePackage', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) + + + diff --git a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_method.py b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_method.py new file mode 100644 index 0000000..3d60784 --- /dev/null +++ b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_method.py @@ -0,0 +1,12 @@ +from .base_models import BaseNode, ContainsRelationship +from neomodel import RelationshipFrom, StringProperty,One,ArrayProperty,VectorIndex,FloatProperty + +class ConfluenceMethod(BaseNode): + """Represents a method in a class""" + function_name = StringProperty(required=True) + function_implementation_summary = StringProperty(default="") + function_objective = StringProperty(default="") + function_objective_embedding = ArrayProperty(FloatProperty()) + function_summary_embedding = ArrayProperty(FloatProperty()) + # Method relationships + confluence_class = RelationshipFrom('ConfluenceClass', 'CONTAINS', model=ContainsRelationship, cardinality=One) diff --git a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_package.py b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_package.py new file mode 100644 index 0000000..5e40064 --- /dev/null +++ b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/confluence_package.py @@ -0,0 +1,13 @@ +from .base_models import BaseNode, ContainsRelationship +from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One,ArrayProperty,VectorIndex,FloatProperty + +class ConfluencePackage(BaseNode): + """Represents a package in the codebase""" + package_objective = StringProperty(required=True) + package_implementation_summary = StringProperty(required=True,default="") + + package_objective_embedding = ArrayProperty(FloatProperty()) + package_implementation_summary_embedding = ArrayProperty(FloatProperty()) + confluence_codebase = RelationshipFrom('ConfluenceCodebase', 'CONTAINS', model=ContainsRelationship, cardinality=One) + sub_packages = RelationshipTo('ConfluencePackage', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) + classes = RelationshipTo('ConfluenceClass', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) diff --git a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/method_node.py b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/method_node.py deleted file mode 100644 index c636d06..0000000 --- a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/method_node.py +++ /dev/null @@ -1,18 +0,0 @@ -from .base_models import BaseNode, ContainsRelationship -from neomodel import RelationshipFrom, StringProperty,One,ArrayProperty,VectorIndex,FloatProperty - -class Method(BaseNode): - """Represents a method in a class""" - function_name = StringProperty(required=True) - function_implementation_summary = StringProperty(default="") - function_objective = StringProperty(default="") - function_objective_embedding = ArrayProperty( - FloatProperty(), - vector_index=VectorIndex(dimensions=4096, similarity_function='cosine') - ) - function_summary_embedding = ArrayProperty( - FloatProperty(), - vector_index=VectorIndex(dimensions=4096, similarity_function='cosine') - ) - # Method relationships - class_ = RelationshipFrom('Class', 'CONTAINS', model=ContainsRelationship, cardinality=One) diff --git a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/package_node.py b/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/package_node.py deleted file mode 100644 index f29141a..0000000 --- a/unoplat-code-confluence-commons/unoplat_code_confluence_commons/graph_models/package_node.py +++ /dev/null @@ -1,22 +0,0 @@ -from .base_models import BaseNode, ContainsRelationship -from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One,ArrayProperty,VectorIndex,FloatProperty - -class Package(BaseNode): - """Represents a package in the codebase""" - package_objective = StringProperty(required=True) - package_implementation_summary = StringProperty(required=True,default="") - - package_objective_embedding = ArrayProperty( - FloatProperty(), - vector_index=VectorIndex(dimensions=4096, similarity_function='cosine') - ) - package_implementation_summary_embedding = ArrayProperty( - FloatProperty(), - vector_index=VectorIndex(dimensions=4096, similarity_function='cosine') - ) - - codebase = RelationshipFrom('Codebase', 'CONTAINS', model=ContainsRelationship, cardinality=One) - - sub_packages = RelationshipTo('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore) - - classes = RelationshipTo('Class', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)