Re: CSS and predictability

Dear all,  I agree with this analysis.  In particular, I find the distinction between CSS and RDF convincing. CSS can rely on a relatively well-understood processing model, where graceful degradation is usually a reasonable design goal. RDF concrete syntaxes, however, are consumed in many different contexts, and the same recovery strategy may be acceptable in one application and unacceptable in another. Because of that, I do not think that RDF should normatively define a single graph corresponding to invalid input.  I also agree that saying that the graph is undefined for documents that do not satisfy the syntax specification is the safest and most future-proof approach. It avoids turning today’s invalid syntax into a normatively defined graph, which could later make future extensions harder or introduce unnecessary compatibility problems.  At the same time, I still think that "Option 2" is useful. We do not need to define a detailed taxonomy of RDF syntax errors, but it would be helpful to have a small, optional, extensible way to describe what the processor actually did after detecting an error. This is also the direction I tried to capture in issue #196:  github.com https://github.com/w3c/rdf-star-wg/issues/196  Each of these could be identified by a standard IRI, while still allowing implementations to use their own IRIs when their behavior does not fit the predefined categories.  Best, Dominik 
       
        
         
           Dnia 08 lipca 2026 17:17 
            Pierre-Antoine Champin  < pierre-antoine@w3.org >  napisał(a):
         
      
         
    
  
   
     Dear WG, 
     our last meeting gave me a lot of food for thought; , that helped
      me put my finger more clearly on the gut feeling that I have that
      CSS may not be the best point of comparison for RDF. 
     Below is an excerpt of an email that I sent to Yves Lafon,
      summarizing what I took away from our meeting. TL;DR: it explains,
      with arguments, why I think that the CSS example can and should
      not be applied as is to RDF, and that the best way forward for RDF
      is to leave  unspecified  the graph corresponding to
      "invalid" N-Triples (which is what "signal an error" conveys). 
     As I still anticipate that TAG might not be entirely satisfied
      with that, I still believe that we should pursue "Option 2",
      namely: provide a way to document, even crudely, how a specific
      parser reacted in the presence of an error. I can see 3 obvious
      categories 
     - return an empty graph/dataset  
      - return all triples parsed before the error was encountered  
      - continue parsing after the error (i.e. "warning", which may
      indicate a loss of triples and/or modified/corrupted triples --
      may be this should be split in two) 
     This should be extensible: each category is identified by a
      standard IRI, but parsers could return their own IRIs if their
      behavior does not fit in one of these categories. 
       best 
     On 06/07/2026 19:25, Pierre-Antoine
      Champin wrote:  
     
     (...)
       It is not "browser" vs. "data", it is not even "user-facing" vs
        "dev-facing" (although that plays a role, see below), but it is
        "single processing model" vs. "multiple (and open-ended)
        processing models". 
       CSS is defining two things at once: the parsing (how to map an
        application/css text into a set of rules in the CSSOM model),
        and the processing (what to do with that model). I know those
        are specified in separate specs, but yet, the CSS-Syntax spec is
        entirely oriented towards the unique processing model
        implemented in user-agents. 
       RDF concrete syntaxes, on the other hand, are agnostic to how
        the data will be processed. It may be processed under open-world
        assumption (OWL reasoning, some SPARQL queries,...), or under
        closed-world assumption (SHACL validation, other SPARQL
        queries,...). It may be needed "all or nothing" or it may be
        useful even in partial form. It really depends on the
        application, so different parsers may be designed for different
        use-cases. In fact, multiple parsers actually offer
        configuration parameters to switch between different behaviors,
        so that developers can chose what fits best their use-case. (In
        contrast, I don't think that user-agents offer an option to the
        user to switch between the two legal behaviours in CSS, namely,
        stop at the first error vs. recover and continue parsing -- this
        is where, indirectly, the "user-facing" vs. "dev-facing"
        manifests). 
       Given that the N-Triples spec (as all other concrete syntax)
        focuses on the format (how it maps to the abstract syntax), and
        not on a specific processing mode, I would argue that the only
        future proof way to go is to say: 
       * for any document that does not satisfy the spec, the
        corresponding graph is undefined 
       (which is basically what the current spec says, "signaling an
        error" meaning "warn the application that whatever the parser
        returns is  not  the normative result of the parsing"). 
       Instead, the CSS way would be to specify that the following
        N-Triples text maps to a well-defined graph: 
         <uri:1> <uri:2> "literal1".  
          <uri:3> <uri:4> %some_future_stuff%.  
          <uri:5> <uri:6> "literal2". 
       If we were to say, in RDF 1.2, that this corresponds to a graph
        of 0 triples (drop all), or 1 triples (stop at 1st error) or 2
        triples (recover and continue), then RDF 1.3 could not assign a
        meaning to %some_future_stuff% without introducing a breaking
        change: this text would now map to a graph with 3 triples,  contradicting
          the previous spec . 
       Why is this not a problem in CSS? Because CSS is embracing this
        breaking change in exchange for  graceful degradation :
        the current behavior is considered the best possible (or at
        least an acceptable) approximation of the future behavior, so
        breaking backward compatibility that way will not be a problem.
        But to come back to my general point, this is only possible
        because how the CSS is  processed ,  after the parsing ,
        is known in advance. 
       We can't make this kind of prediction in RDF. A graceful
        degradation for one application will be an unacceptable
        approximation for another one. 
        
       
       In response to your motivating examples from last week: 
       * the server being able to "control" how the client will
        behave, by composing the data in a certain way, did not quite
        convince. Again: the server publishing data often does not now
        who will consume their data and how. 
       * the application being able to switch from one parser to
        another: as I wrote above, different parsers will treat the
        "undefined behaviour" of unrecognized syntax differently, and
        that's a feature, not a bug. When building your app, you should
        chose the parser careful -- or better, chose a configurable
        parser, and configure it so that it does what you need. 
      (...)

Received on Wednesday, 8 July 2026 19:23:47 UTC