AKSW / QuitDiff

Command line comparison tool for semantic web data, it can be used as git difftool for RDF data as well.
GNU General Public License v3.0
7 stars 2 forks source link

unexpected output when diffing files not in repository root #1

Closed seebi closed 2 months ago

seebi commented 8 years ago

Hi norman and nate,

I tried to test quitdiff but got an unexpected diff output.

I opened an existing turtle file in a repository and added a triple there (an additional comment). Then I ran git diff in order to have the standard output to compare it with quitdiff. here it is:

∴ git diff
diff --git a/data/aksw.ttl b/data/aksw.ttl
index 0a1f015..680f2f9 100644
--- a/data/aksw.ttl
+++ b/data/aksw.ttl
@@ -1887,6 +1887,7 @@ aksworg:MichaelMartin
     foaf:currentProject ns6:LeipzigerSemanticWebTag, projects:CSVImport, projects:CubeViz, projects:Erfurt, projects:FTS, projects:GeoKnow, projects:LODStats
     foaf:depiction <http://bis.informatik.uni-leipzig.de/images/jpegPhoto.php?name=sn&value=martin> ;
     foaf:familyName "Martin" ;
+    foaf:nickname "Micha" ;
     foaf:mbox <mailto:martin@informatik.uni-leipzig.de> ;
     foaf:name "Michael Martin" ;
     foaf:pastProject projects:LATC, projects:LE4SW, projects:OntoWikiEU, projects:Scoreboard ;

The I ran quitdiff with the documented config (git difftool -t quitdiff-eccrev) but got a huge changeset of just deleting everything and then inserting everything.

I expected to get only one triple in the diff.

splattater commented 7 years ago

Hey @seebi can you try to run git difftool -dir-diff -t quitdiff-eccrev

It may be that rdf serializations using triples (not quads) will be parsed in a named graph assigned by the absolute file path (a/data/aksw.ttl vs. b/data/aksw.ttl).

Using -dir-diff may help until we fix this issue, since the files are handled in a different way.

seebi commented 7 years ago

Norm, by using --dir-diff only empty changesets are generated

∴ git diff
diff --git a/data/skos.ttl b/data/skos.ttl
index dde50c4..7f6705d 100644
--- a/data/skos.ttl
+++ b/data/skos.ttl
@@ -10,6 +10,7 @@
     dct:description "An RDF vocabulary for describing the basic structure and content of concept schemes such as thesauri, classification schemes, subject he
     dct:title "SKOS Vocabulary"@en ;
     a owl:Ontology ;
+    a <urn:y> ;
     rdfs:seeAlso <http://www.w3.org/TR/skos-reference/> .

 skos:Collection
∴ git difftool --dir-diff -t quitdiff-eccrev
@prefix eccrev: <https://vocab.eccenca.com/revision/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

{
    <urn:commit:52dc6bc2-8303-11e6-9bd6-80e65013f9e2:> a eccrev:Commit .
}
splattater commented 7 years ago

3 should fix this.

Add a walk through subdirectories. Add a default named graph URI so file names won't be taken as named graph URI.