Skip to content

Commit

Permalink
added requirements.txt for docker composing
Browse files Browse the repository at this point in the history
cleaned up packages for frontend to reduce size of load

*  fixed issue where # were added in the rocrate-metadata.json when trying to add annotation to a child node of a file
  • Loading branch information
cedricdcc committed May 3, 2022
1 parent aa85b0f commit d97b6d1
Show file tree
Hide file tree
Showing 7 changed files with 239 additions and 303 deletions.
14 changes: 5 additions & 9 deletions backend/app/model/rocrategit.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ def create_blank_node_by_id(self, file_id=str, node_type=str, uri_predicate=str)
#add uri predicate to the item with value of nw blacnk node @id
item[uri_predicate] = {"@id":new_uuid_blank_node}
#write the new graph to the metadata file
log.debug(data)
self._write_metadata_datacrate(data)
return new_blank_node

Expand Down Expand Up @@ -459,14 +460,9 @@ def add_predicates_by_id(self,toadd_dict_list=list, file_id=str):
test = shclh.ShapesInfoGraph(path_shacl)
shacldata = test.full_shacl_graph_dict()
data = self._read_metadata_datacrate()
try:
myrocrate = ROCrate(self.storage_path)
data_entities = myrocrate.data_entities
except Exception as e:
log.error(f'error when loading rocrate data via rocrate python lib: {e}')
log.exception(e)
data_entities = data['@graph']
log.debug(data_entities)

data_entities = data['@graph']
log.debug(data_entities)


#convert the chacl file to have all the properties per node id
Expand Down Expand Up @@ -548,7 +544,7 @@ def add_predicates_by_id(self,toadd_dict_list=list, file_id=str):
if uri_name not in chacl_URI_list:
warnings.append("non shacl defined constraint metadata has been added: "+ uri_name)

## implement annotation in the data is found , send warning message is annotation title not found in constraints ##
## implement annotation in the data is found , send warning message is annotation title not found in constraints ##
## write back to metadata file and return metadata.json file
try:
myrocrate.write(self.storage_path)
Expand Down
2 changes: 1 addition & 1 deletion backend/app/routers/APIV1/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class AnnotationModel(BaseModel):
value : str = Field(None, description = "Value linked to the URI predicate name chosen")

class BlankModel(BaseModel):
URI_predicate_name : str = Field(None, description = "Name of the URI that will be added, must be part of the RO-crate profile provided metadata predicates;")
URI_predicate_name : str = Field(None, description = "Name of the URI that will be added, must be part of the RO-crate profile provided metadata predicates")
node_type : str = Field(None, description = "Type of the node that will be added.")

class AnnotationsModel(BaseModel):
Expand Down
Loading

0 comments on commit d97b6d1

Please sign in to comment.