Skip to content

Commit 8a62f0e

Browse files
authored
Merge pull request #81 from INCATools/h2-patch-2
Remove `node_id` and replace with `about_node` for `ClassCreation` and `NodeCreation`
2 parents 0a37270 + 46f9792 commit 8a62f0e

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

src/data/examples/examples.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,15 @@ Test_9:
8787
Test_10:
8888
id: CHANGE:001
8989
type: ClassCreation
90+
about_node: GO:9999999
9091
about_node_representation: curie
91-
node_id: GO:9999999
9292
command_with_curie: create GO:9999999
9393
command_with_uri: create http://purl.obolibrary.org/obo/GO_9999999
9494
Test_11:
9595
id: CHANGE:001
9696
type: NodeCreation
9797
about_node: GO:9999999
9898
about_node_representation: curie
99-
node_id: GO:9999999
10099
name: foo
101100
command_with_curie: create node GO:9999999 'foo'
102101
command_with_uri: TODO

src/docs/examples.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ Class: [`ClassCreation`](https://w3id.org/kgcl/ClassCreation) </br></br>Command:
8787
```
8888
id: CHANGE:001
8989
type: ClassCreation
90+
about_node: GO:9999999
9091
about_node_representation: curie
91-
node_id: GO:9999999
9292
9393
```
9494
## Example: Creation of new node.
@@ -98,7 +98,6 @@ id: CHANGE:001
9898
type: NodeCreation
9999
about_node: GO:9999999
100100
about_node_representation: curie
101-
node_id: GO:9999999
102101
name: foo
103102
104103
```

src/kgcl_schema/grammar/parser.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def parse_create_class(tree, id):
250250
entity, representation = get_entity_representation(term_id_token)
251251

252252
return ClassCreation(
253-
id=id, node_id=entity, about_node_representation=representation
253+
id=id, about_node=entity, about_node_representation=representation
254254
)
255255

256256

@@ -317,7 +317,6 @@ def parse_create(tree, id):
317317
id=id,
318318
about_node=entity,
319319
about_node_representation=representation,
320-
node_id=entity, # was term_id_token
321320
name=label_value,
322321
language=language_token,
323322
)

src/kgcl_schema/grammar/render_operations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def render(kgcl_instance: Change) -> str:
197197
return "create " + subject
198198

199199
if type(kgcl_instance) is ClassCreation:
200-
subject = render_entity(kgcl_instance.node_id, "uri")
200+
subject = render_entity(kgcl_instance.about_node, "uri")
201201
return "create " + subject
202202

203203
if type(kgcl_instance) is NewSynonym:

tests/cases.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
(
187187
f"create {NEW_TERM}",
188188
f"create {NEW_TERM_URI}",
189-
ClassCreation(id=UID, node_id=NEW_TERM, about_node_representation="curie"),
189+
ClassCreation(id=UID, about_node=NEW_TERM, about_node_representation="curie"),
190190
None,
191191
),
192192
(
@@ -196,7 +196,6 @@
196196
TODO_TOKEN,
197197
NodeCreation(
198198
id=UID,
199-
node_id=NEW_TERM, ## TODO: remove this
200199
about_node=NEW_TERM,
201200
name="foo",
202201
about_node_representation="curie",

0 commit comments

Comments
 (0)