Re: Adding Semantic Metadata to Webpages' Elements via CSS Selectors

Martynas Jusevičius,
All,

After having expanded on these ideas some, instead of viewing them as competing with RDFa in terms of purpose, I would propose that they could serve including as an alternative to XSLT stylesheets with GRDDL. That is, one could use "additive CSS transformations" including wherever one can, today, use XSLT stylesheets with GRDDL.

Per GRDDL, one could use document metadata to indicate a number of additive CSS stylesheets which each produce a knowledge graph from a document. These knowledge graphs would be capable of being merged together into single graphs for documents.

<link rel="transformation" type="text/css" href="transformation-1.css" />
<link rel="transformation" type="text/css" href="transformation-2.css" />
<link rel="transformation" type="text/css" href="transformation-3.css" />

Also, in theory, one could use an additive CSS resource for styling and transformation simultaneously:

<link rel="stylesheet transformation" type="text/css" href="intricate.css" />



Best regards,
Adam Sobieski

P.S.: Also, beyond obtaining knowledge graphs for documents, I'm recently brainstorming about how one could bidirectionally map between nodes in obtained knowledge graphs and source documents' DOM elements. With such capabilities, one would be able to, for example, utilize SPARQL on a knowledge graph from a document to select a node, map that selected node to a source document element, and scroll to that element for an end-user.


________________________________
From: Adam Sobieski <adamsobieski@hotmail.com>
Sent: Tuesday, April 14, 2026 5:50 AM
To: Martynas Jusevičius <martynas@atomgraph.com>
Cc: W3C Semantic Web IG <semantic-web@w3.org>
Subject: Re: Adding Semantic Metadata to Webpages' Elements via CSS Selectors

Martynas Jusevičius,

Hello. There are some similarities but also some differences. Differences between RDFa and the indicated technique include:


  1.
RDFa requires adding attributes to HTML document markup to indicate and express semantic metadata. The indicated technique allows statements, graphs, and/or datasets to be attached to documents' elements by means of these elements being selected using CSS. So, no extra markup or attributes are required for the indicated technique (aside from, in some cases, style classes using the class attribute).

     *
The indicated technique allows selecting elements by their attributes, attributes' values, class names, IDs, types, and more. It should work with simple, compound, complex, and relative selectors as well as lists of these.

  2.
RDFa adds semantic metadata to HTML documents within the HTML documents themselves. In the indicated approach, semantic metadata could be expressed within <style> elements in the documents or in external stylesheets. As considered, elements would be able to have a style property named "metadata" which would, per Additive CSS, be able to hold zero, one, or multiple semantic statements (i.e., graphs or datasets).


Best regards,
Adam Sobieski


________________________________
From: Martynas Jusevičius <martynas@atomgraph.com>
Sent: Tuesday, April 14, 2026 4:10 AM
To: Adam Sobieski <adamsobieski@hotmail.com>
Cc: W3C Semantic Web IG <semantic-web@w3.org>
Subject: Re: Adding Semantic Metadata to Webpages' Elements via CSS Selectors

Wasn't RDFa created for this purpose?

https://www.w3.org/TR/rdfa-primer/


On Tue, Apr 14, 2026 at 9:16 AM Adam Sobieski <adamsobieski@hotmail.com<mailto:adamsobieski@hotmail.com>> wrote:
Semantic Web Interest Group,

Hello. I'm excited to share a new idea with the group that I recently posted in a CSS WG issue comment: https://github.com/w3c/csswg-drafts/issues/1594#issuecomment-4235095851 .

Succinctly, the idea is a means for adding semantic metadata to webpages' elements via CSS selectors. It is a potential use case for the Additive CSS proposal.

I hope that the idea is of some interest. Thank you.


Best regards,
Adam Sobieski
http://www.phoster.com

Received on Thursday, 23 April 2026 21:30:19 UTC