Skip to content
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

Code to make RDF ontology from CSS properties JSON #327

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

timbl
Copy link
Contributor

@timbl timbl commented Aug 19, 2021

No description provided.

Copy link
Member

@tidoust tidoust left a 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:

  1. 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?
  2. 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Member

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:

Suggested change
const camel = camelCasify(prop)
const camel = cssData.properties[prop].styleDeclaration.pop()

@tidoust
Copy link
Member

tidoust commented Sep 23, 2021

Going ahead and merging the PR. I filed #366 to track improvements and automation.
I'll add the editorial fixes after merge.

@tidoust tidoust merged commit 22f67b1 into w3c:master Sep 23, 2021
tidoust added a commit that referenced this pull request Sep 23, 2021
tidoust added a commit that referenced this pull request Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants