Repository navigation
cdifTabularData: give the row and column counts a propertyID - #48
Merged
Merged
Conversation
countRows and countColumns were the only two properties on this class with no namespace and no description -- bare `type: integer` among twenty-one prefixed siblings (cdi:headerRowCount, cdi:skipRows, cdi:tableDirection, cdif:hasPhysicalMapping and the rest). Nothing said what they meant or tied them to a vocabulary, and because the class is open, nothing would ever complain. They become schema:additionalProperty PropertyValue entries carrying a schema:propertyID that names the concept each one quantifies: countRows http://rdf-vocabulary.ddialliance.org/discovery#caseQuantity countColumns http://rdf-vocabulary.ddialliance.org/discovery#variableQuantity DDI DISCOVERY, not Codebook -- confirmed with the originator. The terms are read from the vocabulary rather than from a documentation link: DISCO declares "The namespace for all terms in this ontology is: http://rdf-vocabulary.ddialliance.org/discovery#", so the IRIs are `discovery#caseQuantity` / `#variableQuantity` and NOT the `discovery.html#dfn-disco-casequantity` anchors that were first proposed -- those are doc-page fragments, with a different path and https where DISCO declares http. Either form is a string that validates, so a doc anchor would have sat in schema:propertyID identifying a web page instead of a property, and nothing downstream would have surfaced it. The semantics line up: both DISCO properties are datatype properties with domain DataFile and LogicalDataSet, and this class describes a tabular data file. variableQuantity is the count of variables (columns), caseQuantity the number of cases (rows). The array follows the house pattern from cdifProvActivity -- items $ref a $defs entry that in turn $refs schemaorgProperties/additionalProperty -- rather than restating the PropertyValue shape here. 30 occurrences across 12 example and negative-test files are converted, in cdifTabularData, cdifComplete and DiscoveryDataDescription. Note this was NOT a breaking change: the class has no additionalProperties:false, so the old bare form still validated and the examples were updated to demonstrate the convention rather than to repair a failure. The large cdifManifest/resolvedSchema.json diff is this change, not unrelated drift -- swapping two scalars for a $ref inlines the whole additionalProperty definition (PropertyValue, DefinedTerm, propertyID_item) into the resolved output. Verified by regenerating against a clean HEAD: "0 updated, 68 already current", so nothing was stale beforehand. validate_examples 130 passed, 0 failed test_fail_cases 103 of 103 still fail for the reason they name Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.
countRowsandcountColumnswere the only two properties on this class with no namespace and no description — baretype: integeramong twenty-one prefixed siblings (cdi:headerRowCount,cdi:skipRows,cdi:tableDirection,cdif:hasPhysicalMapping, …). Nothing said what they meant or tied them to a vocabulary, and because the class is open, nothing would ever complain.They become
schema:additionalPropertyPropertyValueentries carrying aschema:propertyID:schema:propertyIDcountRowshttp://rdf-vocabulary.ddialliance.org/discovery#caseQuantitycountColumnshttp://rdf-vocabulary.ddialliance.org/discovery#variableQuantityDDI Discovery, not Codebook — and the IRIs are not the doc anchors
Confirmed with the originator. The terms are read from the vocabulary, which declares "The namespace for all terms in this ontology is:
http://rdf-vocabulary.ddialliance.org/discovery#".The IRIs first proposed were
https://rdf-vocabulary.ddialliance.org/discovery.html#dfn-disco-casequantity— documentation anchors, with a different path (discovery.htmlvsdiscovery), a different fragment form, andhttpswhere DISCO declareshttp. Either form is a string that validates, so a doc anchor would have sat inschema:propertyIDidentifying a web page instead of a property, and nothing downstream would have surfaced it.Semantics line up: both DISCO properties are datatype properties with domain DataFile and LogicalDataSet, and this class describes a tabular data file.
variableQuantityis the count of variables (columns),caseQuantitythe number of cases (rows).Shape
Follows the house pattern from
cdifProvActivity—items$refa$defsentry that in turn$refsschemaorgProperties/additionalProperty— rather than restating the PropertyValue shape locally.Not a breaking change
The class has no
additionalProperties: false, so the old bare form still validated. The 30 occurrences across 12 example and negative-test files (incdifTabularData,cdifComplete,DiscoveryDataDescription) were updated to demonstrate the convention, not to repair a failure.On the large cdifManifest diff
cdifManifest/resolvedSchema.jsonchanges by ~650 lines, and that is this change rather than unrelated drift: swapping two scalars for a$refinlines the wholeadditionalPropertydefinition (PropertyValue, DefinedTerm,propertyID_item) into the resolved output.Verified by regenerating against a clean
HEADwith no source edit — "0 updated, 68 already current" — so nothing was stale beforehand. (I initially mis-called this as pre-existing drift from a 5-of-657 keyword count; the inlined lines simply don't contain the words I grepped for.)Verification
validate_examplestest_fail_casesresolve_schema --all/regenerate_schema_jsonDownstream
geochemBuildingBlocks vendors this class and shows these two on the distribution in composed
adaProduct. gBB uses them in 0 of its own examples, so the impact there is schema-only: after this merges and gh-pages redeploys, gBB needsresolve_schema.py --refresh-remoteplus a regenerate (~6 min).amds-ldeo/metadatahas two subject-key rows (939 records each) pointing at the old bare path that need re-pointing at theadditionalPropertypath.🤖 Generated with Claude Code