-
Notifications
You must be signed in to change notification settings - Fork 89
Code to make RDF ontology from CSS properties JSON #327
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The code seems good but I'm not fully clear what value such an RDF ontology is going to bring if:
- It only contains CSS properties from the CSS 2.2 specification (
../ed/css/CSS.json
), excluding CSS properties defined in other CSS module specs (the other JSON files in../ed/css/
). What are usage scenarios that only need CSS 2.2 properties? - Its maintenance is not automated. In other words, https://www.w3.org/ns/css.ttl strikes me as a brittle source of truth if it gets updated manually. Automated maintenance is doable. I note we need to fix/improve a couple of things first (starting with making sure that CSS properties are defined only once, see CSS package: consider additional parsing guarantees #127)
@prefix css: <http://www.w3.org/ns/css#> . | ||
|
||
<> rdfs:comment """This ontology allows CSS properties to be expressed in RDF. | ||
The same camelcase convention is usede as is used by the subproperties of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same camelcase convention is usede as is used by the subproperties of the | |
The same camelcase convention is used as is used by the subproperties of the |
""" . | ||
`) | ||
for (const prop in cssData.properties) { | ||
const camel = camelCasify(prop) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I note that the JSON file exposes the camelcase name in the styleDeclaration
property (last item in that array), so the camelCase
function could be dropped and this line replaced by something like:
const camel = camelCasify(prop) | |
const camel = cssData.properties[prop].styleDeclaration.pop() |
Going ahead and merging the PR. I filed #366 to track improvements and automation. |
Implements suggestions in #327
Implements suggestions in #327
No description provided.