mdcode: carry OWL unqualified cardinality restrictions - #343
Draft
libei wants to merge 1 commit into
Draft
Conversation
Read an anonymous owl:Restriction reached through rdfs:subClassOf from a named class -- naming a property (owl:onProperty) and one or more of the unqualified cardinality predicates (owl:cardinality / owl:minCardinality / owl:maxCardinality) -- and carry it verbatim on the entity as a GOOGLE custom extension. Inert on push, lossless on the OSI round-trip, promotable later. OSI has no cardinality concept, so entity-level carriage is chosen so the restriction rides even when the restricted property has no field on the class (e.g. inherited). Qualified cardinality (owl:onClass / owl:onDataRange + the qualified predicates) is detected and skipped, deferred to a later stage. A value restriction (owl:someValuesFrom, no cardinality) and a malformed cardinality contribute nothing. Cardinality literals are parsed digits-only so an empty, hex, or exponent string is ignored rather than coerced. A blank node typed both owl:Restriction and a named kind is pruned from the named-term maps so it does not surface as a bogus entity; a named IRI typed owl:Restriction keeps its class identity. Docs and fixtures updated; adds targeted tests for the carried shapes, exclusions, and edge cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Stage 3 of the OWL→OSI converter: read an anonymous
owl:Restrictionreached throughrdfs:subClassOffrom a named class — naming a property (owl:onProperty) and one or more of the unqualified cardinality predicates (owl:cardinality/owl:minCardinality/owl:maxCardinality) — and carry it verbatim on the entity as aGOOGLEcustom extension.Carriage is inert on push and lossless on the OSI round-trip (promotable later). OSI has no cardinality concept, so entity-level carriage is used: the restriction rides even when the restricted property has no field on that class (e.g. inherited).
Scope / exclusions
owl:onClass/owl:onDataRange+ qualified predicates) is detected and skipped — deferred to a later stage.owl:someValuesFrom, no cardinality) and a malformed cardinality contribute nothing (no empty block).owl:Restrictionand a named kind is pruned from the named-term maps so it does not surface as a bogus entity; a named IRI typedowl:Restrictionkeeps its class identity.Tests
Full
bun testsuite green (510 pass / 0 fail). Adds targeted tests for the carried shapes (exact / min+max / multiple / in- vs cross-namespaceonProperty), the exclusions (qualified, value restriction, viaequivalentClass, noonProperty), and edge cases (malformed/coercible literals, dual-typed blank node, named dual-typed class). Docs (owl-import.md) and fixtures updated.