Skip Menu |

This queue is for tickets about the XML-SemanticDiff CPAN distribution.

Report information
The Basics
Id: 40893
Status: rejected
Priority: 0/
Queue: XML-SemanticDiff

People
Owner: Nobody in particular
Requestors: kawas7 [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.99
Fixed in: (no value)



Subject: error comparing unordered child nodes
When using the following code: #start code use Data::Dumper; use strict; use XML::SemanticDiff; my $test_file = "getUnitprotDescriptorsByKeyword-test-output.xml"; my $control_file = "getUnitprotDescriptorsByKeyword-control-output.xml"; my $diff = XML::SemanticDiff->new(keeplinenums => 1); foreach my $change ($diff->compare($test_file, $control_file)) { print "$change->{message} (between lines $change->{startline} and $change->{endline})\n"; } #end code The 2 docs report to be different, when they are not. The XML docs have one node in them with lots of child nodes. The ordering was all that is different. Thanks.
Subject: getUnitprotDescriptorsByKeyword-unit-test.rdf

Message body not shown because it is not plain text.

Subject: getUnitprotDescriptorsByKeyword-control-output.xml

Message body is not shown because it is too large.

Sorry, the files that I attached were incorrect! getUnitprotDescriptorsByKeyword-control-output.xml and getUnitprotDescriptorsByKeyword-test-output.xml are the correct ones.

Message body is not shown because it is too large.

DAAAAAAAAHUUUUUUUUUUUT! I have a much smaller and hopefully helpful example of what I think may be the same bug. At work, we've painted ourselves into a corner that relies on the structure of an RDF/XML document, so I'm running Test::XML to verify the structure, and I've seen that the test fails even when it is correct. I'm attaching two trimmed-down examples. Cheers, Kjetil
<?xml version="1.0"?> <rdf:RDF xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:user="http://tigger.computas.int:8180/sublima-webapp-1.0-SNAPSHOT/user/" xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#" xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#" xmlns:wdr="http://www.w3.org/2007/05/powder#" xmlns:status="http://sublima.computas.com/status/" xmlns:agent="http://tigger.computas.int:8180/sublima-webapp-1.0-SNAPSHOT/agent/" xmlns:lingvoj="http://www.lingvoj.org/ontology#" xmlns:swrlb="http://www.w3.org/2003/11/swrlb#" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:http="http://www.w3.org/2007/ont/http#" xmlns:topic="http://tigger.computas.int:8180/sublima-webapp-1.0-SNAPSHOT/topic/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:dct="http://purl.org/dc/terms/" xmlns:p1="http://xmlns.computas.com/sublima-information-model#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:swrl="http://www.w3.org/2003/11/swrl#" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:sub="http://xmlns.computas.com/sublima#" xmlns:resource="http://tigger.computas.int:8180/sublima-webapp-1.0-SNAPSHOT/resource/"> <rdfs:Class rdf:about="http://xmlns.computas.com/sublima#Resource"> <owl:unionOf rdf:resource="http://rdfs.org/sioc/ns#Item"/> <owl:unionOf rdf:resource="http://rdfs.org/sioc/ns#Site"/> <rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/> </rdfs:Class> </rdf:RDF>
Hi! Thanks for you report - see below for my comments. On Thu Feb 26 08:39:27 2009, KJETILK wrote: Show quoted text
> DAAAAAAAAHUUUUUUUUUUUT! > > I have a much smaller and hopefully helpful example of what I think may > be the same bug. At work, we've painted ourselves into a corner that > relies on the structure of an RDF/XML document, so I'm running Test::XML > to verify the structure, and I've seen that the test fails even when it > is correct. > > I'm attaching two trimmed-down examples. >
The problem here is that in one example the "#Item" unionOf comes before the "Site" union-of and in the second one, it's the opposite. Since XML::SemanticDiff compares elements according to their order in the document, then it fails to compare them to each other. I'm not sure what is the correct behaviour here. XML::SemanticDiff now seems to me like one big hack, that can be expected to fail for a large percent of the time. I adopted it because some of my code broke under Test::XML, and Test::XML was the first (or possibly only) module I found for comparing XML. However, now I've been meaning to work on an XML comparing module that will compare the XML elements in order and as they are, which is more suitable for my needs. So I'm not very enthusiastic on fixing it, because: 1. I'm not sure what is the correct behaviour. 2. I have little selfish motivation to fix it. Regards, Shlomi Fish
No response from the original reporter, and it seems like it's an edge case. Closing.