Skip to content

Commit

Permalink
some bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarocosta committed May 7, 2020
1 parent a1c775c commit 00f7929
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/components/edit-entity.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class EditEntityComponent implements OnInit {
const properties = {};
properties[this.uid] = {
$ref: ref,
title: 'Editing'
title: 'New relationship'
};
jsonSchema.properties = properties;
jsonSchema.desc = 'Description';
Expand Down
1 change: 1 addition & 0 deletions src/GCF/decorators/OntologyClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def generate_template(self):
range_schema_class_name = range.split("/")[2]
range_class_name = range_schema_class_name.split("Schema")[0]
template_aux[class_name][title] = range_class_name
#print(self.get_schema_with_template(template_aux))

return template

Expand Down
4 changes: 2 additions & 2 deletions src/Models/DataObject/v0_0_2/SuperClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def get_property_from_entity(self, property_name):
class_name = self.__class__.__name__ + "Schema"
return schema_node['definitions'][class_name]['properties'][property_name]

# def get_superclasses_name(self):
# return list(set(self.labels()))
def get_superclasses_name(self):
return list(set(self.labels()))

def get_schema_with_template(self, template):
jsonSchema = self.getSchema()
Expand Down
10 changes: 6 additions & 4 deletions src/Routes/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ def update_data_in_mongo(uid, data):


def get_schema_from_mongo(template):
#todo arranjar isto
#record = db.defaultTemplate.find_one({'template': template})
record = db.createdTemplate.find_one({'template': template})
record = db.defaultTemplate.find_one({'template': template})
if record is None:
return None
record = db.createdTemplate.find_one({'template': template})
if record is None:
return None
else:
return record["schema"]
else:
return record["schema"]

Expand Down
18 changes: 9 additions & 9 deletions src/Routes/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ def insert_template_in_mongodb(uid):
@cross_origin()
def get_schema(uid, template_str):
node = get_node_by_uid(uid)
# template = {
# "E52_Time_Span": {
# "has_value": "DataObject"}
# }
# todo descomentar isto
#template = json.load(template_str)


template = {
"E52_Time_Span": {
"P86_falls_within": "E52_Time_Span"}
"has_value": "DataObject"}
}
# todo descomentar isto
#template = json.loads(template_str)


# template = {
# "E52_Time_Span": {
# "P86_falls_within": "E52_Time_Span"}
# }
print(template)
if node is not None:
result = get_schema_from_mongo(template)
Expand Down

0 comments on commit 00f7929

Please sign in to comment.