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

Refactor RdfsImportEngine #152

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

multimeric
Copy link

Built on top of #151 (so the diff will be simplified once that's merged).

Changes:

  • Refactored RdfsImportEngine. I did this in the process of trying to understand the existing code and why it wasn't working.
    • Added type annotations everywhere
    • Added descriptions of instance variables
    • Refactored out the class and the slot generation into separate functions for clarity
  • Fixed the issue with slots not correctly being assigned to classes (see Publish the compiled LinkML YAML? linkml-schemaorg#4). This was I think largely caused by the fact that we skipped any properties that weren't in the LinkML class metaschema, even when handling slots:
    if metaslot_name not in self.defclass_slots:
    continue

This now creates a good enough LinkML schema for schema.org classes. If you run:

schemauto import-rdfs https://schema.org/version/latest/schemaorg-current-https.ttl

You get the attaced LinkML schema, which now has the appropriate slots.
schema.yml.txt

@multimeric multimeric changed the title Refactor Refactor RdfsImportEngine Dec 18, 2024
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.

1 participant