Skip to content

Commit 42aee90

Browse files
authored
fix(core): fix metadata to match RFC and properly format wasDerivedFrom (#3166)
1 parent 83318aa commit 42aee90

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

renku/command/schema/composite_plan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Meta:
4242
invalidated_at = fields.DateTime(prov.invalidatedAtTime, format="iso")
4343
keywords = fields.List(schema.keywords, fields.String(), load_default=None)
4444
name = fields.String(schema.name, load_default=None)
45-
derived_from = fields.String(prov.wasDerivedFrom, load_default=None)
45+
derived_from = fields.IRI(prov.wasDerivedFrom, load_default=None)
4646
project_id = fields.IRI(renku.hasPlan, reverse=True)
4747
plans = Nested(renku.hasSubprocess, [PlanSchema, "CompositePlanSchema"], many=True)
4848
links = Nested(renku.workflowLinks, [ParameterLinkSchema], many=True, load_default=None)

renku/command/schema/plan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class PlanSchema(JsonLDSchema):
3535
class Meta:
3636
"""Meta class."""
3737

38-
rdf_type = [prov.Plan, schema.Action, schema.CreativeWork]
38+
rdf_type = [prov.Plan, schema.Action, schema.CreativeWork, renku.Plan]
3939
model = Plan
4040
unknown = marshmallow.EXCLUDE
4141

@@ -47,7 +47,7 @@ class Meta:
4747
invalidated_at = fields.DateTime(prov.invalidatedAtTime, format="iso")
4848
keywords = fields.List(schema.keywords, fields.String(), load_default=None)
4949
name = fields.String(schema.name, load_default=None)
50-
derived_from = fields.String(prov.wasDerivedFrom, load_default=None)
50+
derived_from = fields.IRI(prov.wasDerivedFrom, load_default=None)
5151
project_id = fields.IRI(renku.hasPlan, reverse=True)
5252
outputs = Nested(renku.hasOutputs, CommandOutputSchema, many=True, load_default=None)
5353
parameters = Nested(renku.hasArguments, CommandParameterSchema, many=True, load_default=None)

renku/data/shacl_shape.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@
983983
}
984984
],
985985
"closed": false,
986-
"targetClass": "prov:Plan",
986+
"targetClass": "renku:Plan",
987987
"property": [
988988
{
989989
"nodeKind": "sh:Literal",

tests/core/commands/test_graph.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def input_objects(request, dataset_model, activity_model, plan_model):
168168
"http://schema.org/Action",
169169
"http://schema.org/CreativeWork",
170170
"http://www.w3.org/ns/prov#Plan",
171+
"https://swissdatasciencecenter.github.io/renku-ontology#Plan",
171172
],
172173
"http://schema.org/dateCreated": [{"@value": "2022-07-12T16:29:14+02:00"}],
173174
"http://schema.org/keywords": [],
@@ -204,6 +205,7 @@ def input_objects(request, dataset_model, activity_model, plan_model):
204205
"http://schema.org/Action",
205206
"http://schema.org/CreativeWork",
206207
"http://www.w3.org/ns/prov#Plan",
208+
"https://swissdatasciencecenter.github.io/renku-ontology#Plan",
207209
],
208210
"http://schema.org/dateCreated": [{"@value": "2022-07-12T16:29:14+02:00"}],
209211
"http://schema.org/keywords": [],
@@ -336,7 +338,12 @@ def test_graph_export_full():
336338
},
337339
{
338340
"@id": "/plans/abcdefg123456",
339-
"@type": ["http://schema.org/Action", "http://schema.org/CreativeWork", "http://www.w3.org/ns/prov#Plan"],
341+
"@type": [
342+
"http://schema.org/Action",
343+
"http://schema.org/CreativeWork",
344+
"http://www.w3.org/ns/prov#Plan",
345+
"https://swissdatasciencecenter.github.io/renku-ontology#Plan",
346+
],
340347
"http://schema.org/dateCreated": [{"@value": "2022-07-12T16:29:14+02:00"}],
341348
"http://schema.org/keywords": [],
342349
"http://schema.org/name": [{"@value": "echo"}],

0 commit comments

Comments
 (0)