You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ossie.apache.org by "Ostrzyciel (via GitHub)" <gi...@apache.org> on 2026/09/13 18:00:48 UTC
[PR] Add LinkML <-> Ossie ontology converters [ossie]
Ostrzyciel opened a new pull request, #389:
URL: https://github.com/apache/ossie/pull/389
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## Summary
**Little bit of context:** Hi, I'm Piotr, maintainer of one of LinkML implementations: [LinkML-Scala](https://github.com/NeverBlink-OSS/linkml-scala). We've been tracking Ossie's progress, and saw a good opportunity to contribute converters for LinkML, as this was already requested by the Ossie community. We'll be more active in the community in the coming weeks :) we plan to start attending the WG meetings.
This PR adds converters for LinkML -> Ossie ontology, and Ossie ontology -> LinkML.
- The converters use an external dependency, [`neverblink-linkml`](https://pypi.org/project/neverblink-linkml/).
- This is a natively-compiled version of LinkML-Scala. No, it does **not** use Java or the JVM :) modern Scala can also compile natively.
- The library is licensed on Apache 2.0. It has no transitive dependencies. The binary size is ~2–3 MB, depending on the platform.
- The PyPI package has wheels for all popular platforms, and an sdist, so it should work anywhere.
- Why is the dependency needed?
- LinkML is an very complex framework. Doing anything in LinkML requires you to resolve imports, merge schemas, perform class & attribute derivation using some rather complex algorithms and so on. LinkML devs call this resolved form "SchemaView". You can find our implementation [here](https://github.com/NeverBlink-OSS/linkml-scala/tree/main/schemaview/src/eu/neverblink/linkml/schemaview).
- To implement a converter from LinkML you must look at this resolved form, not the plain YAML syntax.
- There are currently 2 SchemaView implementations – one is ours, another written in Python is maintained mainly by bioinformatics people. The Python implementation [pulls in many transitive deps](https://github.com/linkml/linkml/blob/main/pyproject.toml), some which are apparently GPL-ed (?).
- Coverage of the mapping is documented here: https://github.com/NeverBlink-OSS/linkml-scala/blob/main/docs/ossie_mapping.md
- You can try out these new converters here: https://linkml.neverblink.eu/playground/
- This is a 100% in-browser playground. LinkML-Scala also compiles to JavaScript.
- Tests.
- The tests here are minimal, because the implementation is already well-tested in LinkML-Scala – currently 409 tests.
- Tests: [unit](https://github.com/NeverBlink-OSS/linkml-scala/tree/main/generator/test/src/eu/neverblink/linkml/generator/ossie), [integration](https://github.com/NeverBlink-OSS/linkml-scala/tree/main/generator/test/src-jvm/eu/neverblink/linkml/generator/ossie) (cross-check with Ossie JSON Schema and the Ossie validator). This includes round-trip testing, testing over a large catalog of edge cases, and fuzzing the expression parser.
- Maintenance.
- We would prefer to maintain the code in our repository and here only keep up the wrapper, minimal tests, and docs relevant to the Ossie community.
- I've added links in the code and docs to direct bug reports to our repository.
- We are also open to alternative arrangements! If you have any ideas, please shoot.
## Related Issues
<!-- Link any related GitHub issues: Closes #123, Fixes #456 -->
## Checklist
### Converters
- [x] New converters include tests under the converter's test directory
### Documentation
- [x] `docs/` is updated to reflect any user-facing changes
- [x] New features or behaviors are documented with examples where appropriate
### Tests
- [x] All existing tests pass (`pytest` / CI green)
- [x] New functionality is covered by tests
### Compliance
- [x] ASF license headers are present on all new source files
- [ ] No third-party dependencies are added without PMC/IPMC approval
**^ needs PMC approval!** This should be easy, though, because the only dependency is licensed on Apache 2.0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add LinkML <-> Ossie ontology converters [ossie]
Posted by "Ostrzyciel (via GitHub)" <gi...@apache.org>.
Ostrzyciel commented on PR #389:
URL: https://github.com/apache/ossie/pull/389#issuecomment-5892494294
I updated the PR to use the latest version of LinkML-Scala, which implements prefixes and IRIs in Ossie (#332).
LinkML-Scala PR: https://github.com/NeverBlink-OSS/linkml-scala/pull/248
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add LinkML <-> Ossie ontology converters [ossie]
Posted by "christianeu-db (via GitHub)" <gi...@apache.org>.
christianeu-db closed pull request #389: Add LinkML <-> Ossie ontology converters
URL: https://github.com/apache/ossie/pull/389
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add LinkML <-> Ossie ontology converters [ossie]
Posted by "jochenchrist (via GitHub)" <gi...@apache.org>.
jochenchrist commented on PR #389:
URL: https://github.com/apache/ossie/pull/389#issuecomment-5684664426
Are there any elements that cannot be transpiled?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add LinkML <-> Ossie ontology converters [ossie]
Posted by "Ostrzyciel (via GitHub)" <gi...@apache.org>.
Ostrzyciel commented on PR #389:
URL: https://github.com/apache/ossie/pull/389#issuecomment-5695675807
@jochenchrist addressed your comment, there are now 2 new tests.
I've also added a link to the source code in the PR description and in the README.
Can I get an approval for this now?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add LinkML <-> Ossie ontology converters [ossie]
Posted by "jochenchrist (via GitHub)" <gi...@apache.org>.
jochenchrist commented on PR #389:
URL: https://github.com/apache/ossie/pull/389#issuecomment-5684655807
In the tests, I would love to see a full example for both YAML structures, and the properties match.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add LinkML <-> Ossie ontology converters [ossie]
Posted by "christianeu-db (via GitHub)" <gi...@apache.org>.
christianeu-db commented on PR #389:
URL: https://github.com/apache/ossie/pull/389#issuecomment-6333980887
@Ostrzyciel the converters have moved to their own dedicated repository (https://github.com/apache/ossie-converters). Do you mind moving (creating) the PR on the new repo? Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add LinkML <-> Ossie ontology converters [ossie]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #389:
URL: https://github.com/apache/ossie/pull/389#discussion_r4000404943
##########
converters/ontology/scripts/linkml_to_ossie.py:
##########
@@ -0,0 +1,59 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+# Description:
+#
+# This script converts a LinkML schema into an Ossie compliant YAML
+# representation of the ontology it describes, printed to stdout. The schema's
+# 'imports' are resolved from disk, exactly as the linkml-scala CLI resolves
+# them.
+#
+# A schema can load and still have errors and warnings against it. Any the
Review Comment:
This sentence is ungrammatical and makes the CLI behavior description unclear; please change “Any the loader reports” to “Any issues the loader reports”.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add LinkML <-> Ossie ontology converters [ossie]
Posted by "Ostrzyciel (via GitHub)" <gi...@apache.org>.
Ostrzyciel commented on PR #389:
URL: https://github.com/apache/ossie/pull/389#issuecomment-5663346070
@kayemkim
> Until then a line in the README saying which forms the importer reads would help.
Done, also updated the docstrings of scripts.
> Nit: scripts/linkml_to_ossie.py lines 26-27 repeat the "loader reports are written to stderr" sentence, the original line was left in when the Copilot fix was applied.
Done.
Could you re-review the PR?
Regarding the warnings and the compatibility in general – oh dear :D it's an extremely complex problem you are touching upon here. We've been working on something very similar in LinkML, so I have some perspective here. In general, schema/ontology languages are not equal. They use different formalisms, have different expressivity and lists of supported features. Any conversion is inherently lossy.
With emitting warnings, the issue is both the unclear (unformalized) scope of both Ossie and LinkML, and their broad feature sets. LinkML has hundreds of features (e.g., see [the definition of a slot in the metamodel](https://linkml.io/linkml-model/latest/docs/SlotDefinition/)) and the vast majority of them are not directly expressible in Ossie, so we would issue hundreds of warnings. For the opposite direction, it's not really clear what is and is not a feature of Ossie, because it's so young.
Proving reliably that feature X is representable in both language A and language B, requires at least some minimal rigor in how each language is defined. We don't have that yet.
If you look at how we write and test LinkML-Scala, we use very much a robust, spec-driven approach: we use BNF-derived grammars for parsing, ASTs with case matching for behaviors, we write spec-driven fuzzing tests, and test the conversion on a large catalog of sample schemas. We _can_ get to good bi-di conversion coverage :) but (1) it's never going to be 100%, and (2) it's going to require a lot of formal/semi-formal work in both specifications. Our team would be happy to help with that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add LinkML <-> Ossie ontology converters [ossie]
Posted by "Ostrzyciel (via GitHub)" <gi...@apache.org>.
Ostrzyciel commented on PR #389:
URL: https://github.com/apache/ossie/pull/389#issuecomment-6423270923
@christianeu-db thanks for the guidance! Recreated here: https://github.com/apache/ossie-converters/pull/85
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org