A predicate is named one way - #536
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
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.
The Properties rail read like four different projects. In one knowledge base with
schema.org loaded:
acceptedAnswerownsApplicableCertificateaccess toScrolling that column,
accessModeSufficientsits next toaccess toand thesecond one looks like a mistake.
The rule
Classes are UpperCamelCase, predicates are lowerCamelCase. That is the RDF/OWL and
schema.org convention, and it carries information: the case tells you whether a
term is a class or a property. The library already followed it — 2774 of 2777
classes are UpperCamel (the other three are schema.org's own
3DModel, whichstarts with a digit and is correct), and 3800+ predicates are already lowerCamel.
So this is a 148-row correction, not a rewrite.
Changing
labelis safe because it is never identity. 4875 predicates carry aniri; RDF export uses theiri, or mints one fromkeywhen there is none. Noexport path reads the label.
keywas already normalised to snake_case — for4996 of 4999 rows it differs from the label only in case and separators.
Only the wrong ones, and never from
keyDeriving the label from
keywould look tidy and would be wrong:to_keydoes notinsert an underscore between consecutive capitals, so
productIDbecomesproduct_id, and rebuilding givesproductId. The acronym is gone.So the migration touches exactly two things and never the inside of a word:
access to→accessToApplicableCertificate→applicableCertificateChecked against the data first: of the 88 labels with separators, zero contain a
run of capitals; of the 60 starting with a capital, none start with two. So neither
rule can damage an acronym here.
productID,hasLEI,accessibilityAPIandcheckoutPageURLTemplatecome through untouched.Those 60 UpperCamel predicates all come from
unece.org, and their label isfaithfully the IRI's local name — the vocabulary is inconsistent with itself
(
brandNamelives in the same namespace). Diverging from its local name isdeliberate; the
irikeeps the truth.New labels are normalised at the three write paths in
ontology.rs(
create_relation_type,create_relation_types_bulk,update_relation_type), soan import or a rename cannot put a spaced label back.
A fact row is a sentence, not a vocabulary
Li Si — worksFor — Meridian Systemsreads like code. So the surfaces that read asprose — the fact row and the entity timeline — split the predicate back into words
at render time (
predicateText.ts). The ontology surfaces keep camelCase, becausethere you are looking at the term itself and
acceptedAnsweris what you wouldsearch for in schema.org's docs.
Acronyms stay whole there too:
productIDrenders as "product ID", not "productid", and
checkoutPageURLTemplateas "checkout page URL template". Facts are alsosorted by the rendered form, so the order matches what is on screen.
Checked
cargo buildandpnpm buildclean; style guard 46/46.acronyms, already-correct input, and idempotence.
lowerCamel 3967 and single lowercase words 1032. Zero with separators, zero
starting with a capital, and all 78 acronym labels still intact.
accessModeSufficient/accessTo/accommodationFloorPlanin order, and the entity panel shows "subject of","advocated for", "branch of" with no camelCase left in it.
🤖 Generated with Claude Code