Skip to content

Commit

Permalink
simplify rewwriting of files after deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Apr 5, 2024
1 parent eceed02 commit 493aa77
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pyscal_rdf/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,22 +289,14 @@ def delete(self, ids=None, indices=None, condition=None, selection=False):
position_identifier = self.graph.graph.value(URIRef(f'{self.sample}_Position'), CMSO.hasIdentifier).toPython()
species_identifier = self.graph.graph.value(URIRef(f'{self.sample}_Species'), CMSO.hasIdentifier).toPython()

#open the file for reading
with open(filepath, 'r') as fin:
data = json.load(fin)
positions = data[position_identifier]['value']
species = data[species_identifier]['value']

#clean up items
positions = self.schema.atom_attribute.positions
species = self.schema.atom_attribute.species
datadict = {
position_identifier:{
"value": positions,
"value": self.schema.atom_attribute.position(),
"label": "position",
},
species_identifier:{
"value": species,
"value": self.schema.atom_attribute.species(),
"label": "species",
},
}
Expand Down

0 comments on commit 493aa77

Please sign in to comment.