Closed rhmccullough closed 10 years ago
the README.md should not be at the top level. Maybe in the tests area. If it's just about this pull request, delete the file and put in the PR description
How different is the mkr work compared to turtle. Is a whole new serializer / writer needed or could the turtle one do it with some flags?
Is mkr really generating 30,000 line results? e.g. test-14.mkr that seems huge
Dave,
I'll try to cover all 4 emails in this reply.
1) It is possible the turtle serializer could do mKR's work with flags. The basic rules are: "." => ";" "( x y z )" => "[ x, y, z ]" and "( )" => "[ ]" "[ ... ]" => "{ ... }" subject => . is subject ; predicate object1, object2, ... ; => . has predicate = [ object1, object2, ... ] ; except rdf:type object1, object2, ... ; => . isu object1, object2, ... ; rdfs:subClassOf object1, object2, ... ; => . iss object1, object2, ... ; rdfs:subPropertyOf object1, object2, ... ; => . iss object1, object2, ... ;
The basic philosophy is: "." stands for current concept, and is short enough to make mKR as readable as Turtle. Everything is a complete sentence, and all the more advanced features can be expressed in more complicated sentences. FYI: mKR uses "isa" to mean either "isu" or "iss".
2) re Makefile.am etc. I'm a real novice with the automake tools. I'll do it anyway you want.
3) re 30,000 line mKR file. That's for real. It's a translation of your 10,000 line Turtle file. I suggest deleting test-16.ttl and test-16.mkr
4) re test-08.ttl Turtle serializer changes "( )" to "rdf:nil". That seems contrary to the spirit of Turtle. I put a 3 line patch in raptor_mkr_emit_resource() that could put out "( )" instead.
5) listing4-3.ttl from "Linked Data" book has @base declaration. I do not know what is supposed to be done with it. Turtle serializer outputs no @base declaration. My hack of Turtle serializer outputs @base with local file name replacing original URI.
6) re building with github files I have not been able to do a successful build -- missing dependency & .am files. For now, I can only build by copying github files into the files I downloaded from librdf.org.
I'll start work on the changes you suggested. How do I keep my changes from affecting you?
if(mkr)
parts@base
is done in raptor_turtle_writer_base()
and only if the write_base_uri
argument to raptor_new_turtle_writer()
is true.Your changes should be applied and the existing tests must all pass. Also I'd like a configure
option to enable/disable mKR; defaulting to disable, and the new code made conditional with something like #ifdef RAPTOR_MKR
. You can use an automake conditional for that; see configure.ac
Re-implemented mKR serializer using raptor_serialize_turtle.c & raptor_turtle_writer.c. I reverted all the changes in rhmccullough/raptor master. All the latest changes are in the mkr-serializer branch of rhmccullough/raptor. I use context->emit_mkr = 1 for mKR and = 0 for Turtle. Since writer does not use context, I added emit_mkr argument to _prefix and _base procedures. I have been using tests/mkr/Makefile.mkr for testing, since your latest build aborts in scripts (can't find raptor2.h).
Since you've reverted everything, I'll close this PR and you can make a new one from the mkr-serializer branch.
New files for mKR writer, serializer, tests. Minimal changes to other programs to add a new language. I have some questions re: Turtle serializer handling of @base and rdf:nil.