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

Interface with webprotege #53

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

Conversation

JosePizarro3
Copy link
Contributor

@JosePizarro3 JosePizarro3 commented Jan 21, 2025

Closes #35

@carlosmada22 do you mind reviewing this? It is working quite well, I can also drive you through the WebProtege thingy to export from the generated .owl file, but it is quite easy

List of main changes:

  • Added export_to_rdf CLI
  • Added entities_to_rdf.py module
  • Added to_rdf() method for BaseEntity in entities.py
  • Added Python class naming as id field of entities (instead of code). This is extracted without the need of populating it when defining a new entity.

@JosePizarro3 JosePizarro3 linked an issue Jan 21, 2025 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Jan 22, 2025

Pull Request Test Coverage Report for Build 12949275347

Details

  • 43 of 145 (29.66%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 96.7%

Changes Missing Coverage Covered Lines Changed/Added Lines %
bam_masterdata/cli/cli.py 6 19 31.58%
bam_masterdata/metadata/entities.py 16 44 36.36%
bam_masterdata/cli/entities_to_rdf.py 11 72 15.28%
Totals Coverage Status
Change from base Build 12926597400: -0.6%
Covered Lines: 16411
Relevant Lines: 16971

💛 - Coveralls



def entities_to_rdf(
graph: "Graph", module_path: str, logger: "BoundLoggerLazyProxy"
Copy link
Collaborator

Choose a reason for hiding this comment

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

How does the "Graph" class work? Does it inserts everything inside the file already nested?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Graph is the class to describe the triples in notologies, and hence when printing to RDF/XML already has the format looked for

"triples" are normally 2 nodes connected via a relationship. Something like: (node_1, relationship, node_2), which you can see some examples when using Graph.add(). Basically it is a way of defining DAGs.

Here the complication is not printing to RDF/XML, or to create the Graph, but actually mapping the openBIS info into the triples.

Added extraction of id after instantiation as the class name

Fix testing
Added _base_attrs to BaseEntity property

Added entities_to_rdf cli
@JosePizarro3 JosePizarro3 force-pushed the 35-interface-with-webprotege branch from 784aa8f to b8c2430 Compare January 23, 2025 09:54
@JosePizarro3
Copy link
Contributor Author

JosePizarro3 commented Jan 24, 2025

TODO:

Deleted inheritance from ObjectType and other types
@JosePizarro3 JosePizarro3 force-pushed the 35-interface-with-webprotege branch from 77be8a7 to f020504 Compare January 24, 2025 09:03
Changed OWL.Class to OWL.Thing

Added descriptions for relationships
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.

Interface with WebProtege
3 participants