arne-bdt commented on issue #2473:
URL: https://github.com/apache/jena/issues/2473#issuecomment-2107665328

   This could be a major issue since the parser behaves completely differently 
in Jena 5.0 for CIM DifferenceModels.
   
   The nested triples under 'forwardDifferences' are all treated as a single 
XMLLiteral in Jena 4.8 but not in Jena 5.0.
   To explain the background: DifferenceModels work like 
[rdf-patch](https://jena.apache.org/documentation/rdf-patch/). They contain a 
list of added triples (A/forwardDifferences) and a list of triples to delete 
(D/backwardDifferences).
   
   I replaced `res.write(System.out, "ttl");` with 
`RDFDataMgr.write(System.out, res, RDFFormat.JSONLD11_PRETTY);` and ran the 
code using Jena 4.8 and Jena 5.0.
   
   Jena 4.8 produces:
   ```
   {
       "@id": "cim:_248c809d-1d7b-397c-830f-6928007ae6d9",
       "@type": "dm:DifferenceModel",
       "md:Model.modelingAuthoritySet": "unknown",
       "cim:Model.modelVersionIri": "http://ontology.adms.ru/UIP/md/2021-1";,
       "md:Model.version": "1715589426",
       "cim:Model.differenceTo": "2027-10-01T08:37:06.779475Z",
       "md:Model.created": "2024-05-13T08:37:06.830Z",
       "md:Model.profile": "http://profile/";,
       "md:Model.scenarioTime": "2024-05-13T08:37:06.830Z",
       "dm:forwardDifferences": {
           "@value": "\n<cim:A 
xmlns:cim=\"http://iec.ch/TC57/2014/CIM-schema-cim16#\"; 
xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"; 
rdf:about=\"#_individual-A-1\">\n<cim:A-2-B 
rdf:resource=\"#_individual-B-1\"></cim:A-2-B>\n</cim:A>\n<cim:B 
xmlns:cim=\"http://iec.ch/TC57/2014/CIM-schema-cim16#\"; 
xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"; 
rdf:about=\"#_individual-B-1\"></cim:B>\n<cim:D 
xmlns:cim=\"http://iec.ch/TC57/2014/CIM-schema-cim16#\"; 
xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"; 
rdf:about=\"#_individual-D-1\"></cim:D>\n",
           "@type": "rdf:XMLLiteral"
       },
       "cim:Model.differenceFrom": "2024-04-01T07:55:06.779475Z",
       "dm:reverseDifferences": {
           "@value": "\n",
           "@type": "rdf:XMLLiteral"
       },
       "@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#";
       }
   }
   ```
   where Jena 5.0 produces:
   
   ```
   {
       "@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"
           },
           {
               "@id": "cim:_248c809d-1d7b-397c-830f-6928007ae6d9",
               "md:Model.version": "1715589426",
               "cim:Model.differenceTo": "2027-10-01T08:37:06.779475Z",
               "@type": "dm:DifferenceModel",
               "md:Model.profile": "http://profile/";,
               "cim:Model.modelVersionIri": 
"http://ontology.adms.ru/UIP/md/2021-1";,
               "md:Model.scenarioTime": "2024-05-13T08:37:06.830Z",
               "dm:reverseDifferences": "\n",
               "cim:Model.differenceFrom": "2024-04-01T07:55:06.779475Z",
               "dm:forwardDifferences": {
                   "@id": "cim:_individual-A-1"
               },
               "md:Model.modelingAuthoritySet": "unknown",
               "md:Model.created": "2024-05-13T08:37:06.830Z"
           }
       ],
       "@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#";
       }
   }
   ```
   
   I have no clue about the parsers and how they should behave.


-- 
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