afs commented on issue #2473:
URL: https://github.com/apache/jena/issues/2473#issuecomment-2118871307

   Some interesting points in those docs about the differences.
   
   * `rdf:ID`, `rdf:about` -- syntax oriented, needs to hook into the parser. 
But if there is to be CIM/JSON-LD, then the distinction ought to be ignored or 
converted to a property because it is an RDF/XML specific feature.
   * `xml:base`  -- This can be addressed in processing parser output with an 
`RDFStream` on the way to the model for storage. Uses a URI with private scheme 
e.g. `base:` as a marker. Teh data then has relative URIs/. Use with care!
   * Schema-defined datatyping. Very much inspired by XML!  
     It can be done by feeding the parse output to an `RDFStream` that looks 
for the properties with schema-defined datatype and converting the triple 
object from string to the datatype. 
   
   ---
   
   One way to encode the difference is use named graphs: if for JSON-LD, then 
using a blank node graph name is natural. This is using RDF datasets as 
"packages of graphs" - the default graph is the manifest and main data, the 
named graphs are sets of triples referred to from the default graph.
   
   However, there isn't a standard dataset/quads syntax based on XML. (TriX is 
a sort of de-facto standard but it isn't pretty.) 
   
   Based on the package idea, there is always a zip file with named files as 
named graphs. Not "a standard" but it only needs basic, common tools to work 
with.
   
   ```
   === Quads
   {
       "@graph": [
           {
               "@id": "cim:_248c809d-1d7b-397c-830f-6928007ae6d9",
               "md:Model.created": "2024-05-13T08:37:06.830Z",
               "cim:Model.differenceTo": "2027-10-01T08:37:06.779475Z",
               "md:Model.version": "1715589426",
               "cim:Model.differenceFrom": "2024-04-01T07:55:06.779475Z",
               "cim:Model.modelVersionIri": 
"http://ontology.adms.ru/UIP/md/2021-1";,
               "dm:forwardDifferences": "_:b0",
               "dm:reverseDifferences": {
                   "@value": "\n    ",
                   "@type": "rdf:XMLLiteral"
               },
               "@type": "dm:DifferenceModel",
               "md:Model.scenarioTime": "2024-05-13T08:37:06.830Z",
               "md:Model.modelingAuthoritySet": "unknown",
               "md:Model.profile": "http://profile/";
           },
           {
               "@id": "_:b0",
               "@graph": [
                   {
                       "@id": "cim:_individual-D-1",
                       "@type": "cim:D"
                   },
                   {
                       "@id": "cim:_individual-A-1",
                       "cim:A-2-B": {
                           "@id": "cim:_individual-B-1"
                       },
                       "@type": "cim:A"
                   },
                   {
                       "@id": "cim:_individual-B-1",
                       "@type": "cim:B"
                   }
               ]
           }
       ],
       "@context": {
           "dm": "http://iec.ch/2002/schema/CIM_difference_model#";,
           "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#";,
           "cim": "http://iec.ch/TC57/2014/CIM-schema-cim16#";,
           "meta": "http://iec.ch/TC57/2014/CIM-schema-cim16#";,
           "md": "http://iec.ch/TC57/61970-552/ModelDescription/1#";
       }
   }
   ```
   TriG:
   ```
   PREFIX cim:  <http://iec.ch/TC57/2014/CIM-schema-cim16#>
   PREFIX dm:   <http://iec.ch/2002/schema/CIM_difference_model#>
   PREFIX md:   <http://iec.ch/TC57/61970-552/ModelDescription/1#>
   PREFIX meta: <http://iec.ch/TC57/2014/CIM-schema-cim16#>
   PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   
   cim:_248c809d-1d7b-397c-830f-6928007ae6d9
           rdf:type                       dm:DifferenceModel;
           dm:forwardDifferences          _:b0;
           dm:reverseDifferences          "\n    "^^rdf:XMLLiteral;
           cim:Model.differenceFrom       "2024-04-01T07:55:06.779475Z";
           cim:Model.differenceTo         "2027-10-01T08:37:06.779475Z";
           cim:Model.modelVersionIri      
"http://ontology.adms.ru/UIP/md/2021-1";;
           md:Model.created               "2024-05-13T08:37:06.830Z";
           md:Model.modelingAuthoritySet  "unknown";
           md:Model.profile               "http://profile/";;
           md:Model.scenarioTime          "2024-05-13T08:37:06.830Z";
           md:Model.version               "1715589426" .
   
   _:b0 {
       cim:_individual-D-1
               rdf:type  cim:D .
       
       cim:_individual-A-1
               rdf:type   cim:A;
               cim:A-2-B  cim:_individual-B-1 .
       
       cim:_individual-B-1
               rdf:type  cim:B .
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to