Ooh, forgot one detail: I put the rdf-toolkit.jar and pre-commit files in my .git/hooks directory. And another note about the scope of this project. It's designed so that if folks are using different tools that, say, export turtle differently, this hook will hopefully make all output look the same, so if you e.g. made a one-line change in a tool like Protege that someone else had last edited using another tool, the saved ttl might normally produce a multi-line diff, but this tries to get everything in the same canonical form so that the final diff is just the one line. On Tuesday, May 31, 2022 at 1:00:36 PM UTC-4 Donny Winston wrote:
> I was just introduced to a nifty RDF Serializer published by the > Enterprise Data Management Council (http://www.edmcouncil.org/): < > https://github.com/edmcouncil/rdf-toolkit>. Its intention is to be used > in a git hook to automatically rewrite RDF for readable diffs. > > Here's a toy example of the hook in action: < > https://github.com/KGConf/Bookclub-ontology/commit/ecc392924f88efc738e0ad776048b12c48f745bc > >. > > My method (I'm on MacOS with x86 architecture): > 1. I installed > https://github.com/edmcouncil/rdf-toolkit/blob/master/etc/git-hook/pre-commit > and > https://jenkins.edmcouncil.org/view/rdf-toolkit/job/rdf-toolkit-build/lastSuccessfulBuild/artifact/target/rdf-toolkit.jar > > (link in the https://github.com/edmcouncil/rdf-toolkit README.md). > 2. I changed two lines in the pre-commit file: > ``` > case ${extension} in > rdf) > ``` > to > ``` > case ${extension} in > ttl) > ``` > and > ``` > --target-format rdf-xml \ > ``` > to > ``` > --target-format turtle \ > ``` > > You do need Java. For me, I installed a pre-built binary for OpenJDK 11 > from <https://adoptopenjdk.net/index.html> a while ago, which is now < > https://adoptium.net/temurin/releases/?version=11>. So e.g. for me, `echo > $JAVA_HOME` is > `/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home`. > On Saturday, March 12, 2022 at 5:13:36 PM UTC-5 Graham Higgins wrote: > >> On Saturday, March 12, 2022 at 11:28:32 AM UTC Nicholas Car wrote: >> >>> Any feedback on this format or on RDF text files and version control in >>> general would be great. >>> >> >> On the topic of managed changes to Graphs - SOLID has a scheme whereby >> changes are specified using N3 "Patches" - see “6.3.1 Modifying >> Resources Using N3 Patches” >> <https://solidproject.org/TR/protocol#writing-resources>: >> >> Example: Applying an N3 patch. >> @prefix solid: <http://www.w3.org/ns/solid/terms#>. >> @prefix ex: <http://www.example.org/terms#>. >> _:rename a solid:InsertDeletePatch; >> solid:where { ?person ex:familyName "Garcia". }; >> solid:inserts { ?person ex:givenName "Alex". }; >> solid:deletes { ?person ex:givenName "Claudia"} . >> >> Has the advantage of providing a tractable change history. >> > -- http://github.com/RDFLib --- You received this message because you are subscribed to the Google Groups "rdflib-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/5455efa6-dab5-4134-b793-37f7da378f06n%40googlegroups.com.