Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 76 schema template #78

Closed
wants to merge 3 commits into from
Closed

Issue 76 schema template #78

wants to merge 3 commits into from

Conversation

turbomam
Copy link
Contributor

#76

@cmungall I wrote test_schema_metadata and added

elif t == T_SCHEMA and isinstance(element, SchemaDefinition)

to schemasheets/schema_exporter.py, following your #77

but I think the exporting steps may have to be different, because we won't be iterating over a multiple schema rows, like we would for slots, classes or prefixes.

cmungall and others added 2 commits September 15, 2022 12:58
This test uses SchemaBuilder to generate a fake schema with
only prefixes in it

We then use the generic roundtripping mechanism in the
test framework to see if we can go Schema->TSV->Schema,
retaining the prefixes

This uses a simple TSV specification with two columns:

 - prefix
 - prefix_reference

As expected, this test failed, so we included a fix here.

The bug was simply that Prefix was not considered among
the list of possible Elements (it's not really an element
in the same way Class, Slot, etc are).

To fix this we add a condition checking to see if there is
a column 'prefix', and if so, if a prefix object is passed,
then use the prefix column as the primary ID (i.e prefix_prefix)
@@ -172,6 +174,39 @@ def test_enums():
_roundtrip(schema, ENUM_SPEC)


def test_prefixes():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like your PR is mixing in changes from a previous PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I treid to build upon your prefixes template fix. does that screw something up?

@@ -215,6 +250,3 @@ def test_export_metamodel_slots():
# of this will change
examples = s['examples']
assert 'bibo:draft' == examples



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to start with tox for this repo!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I watched a video about tox last night, but I don't think I'm ready to make that change yet.

@turbomam turbomam closed this Jul 15, 2023
@turbomam turbomam deleted the issue-76-schema-template branch July 17, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants