File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,14 +132,10 @@ def do_entity_test(
132132 json .dump (rocrate , f )
133133 # update the RO-Crate metadata using SPARQL, if required
134134 if rocrate_entity_mod_sparql is not None :
135- base = "https://example.org/"
136- rocrate_graph = rdflib . Graph ()
137- rocrate_graph .parse ( data = rocrate , format = "json-ld" , publicID = base )
135+ rocrate_graph = load_graph_and_preserve_relative_ids ( rocrate )
136+
137+ rocrate_graph .update ( rocrate_entity_mod_sparql )
138138
139- query = f"""BASE <{ base } >
140- { rocrate_entity_mod_sparql }
141- """
142- rocrate_graph .update (query )
143139 # save the updated RO-Crate metadata
144140 context = "https://w3id.org/ro/crate/1.1/context"
145141 rocrate_graph .serialize (
@@ -148,10 +144,7 @@ def do_entity_test(
148144 context = context ,
149145 indent = 2 ,
150146 use_native_types = True ,
151- base = base ,
152147 )
153- # TODO: tweak the generated crate to strip leading slash from relative URIs, and ensure RDE ID is ./
154- # set the new rocrate path
155148 rocrate_path = temp_rocrate_path
156149
157150 if expected_triggered_requirements is None :
You can’t perform that action at this time.
0 commit comments