RDFLib/rdflib — Issue #178: Patch for generating xml:base attribute in RDF/XML output
Author: gjhiggins
Created: 2012-02-20 08:34:30+00:00
State: open

gklyn...@gmail.com, 2011-09-23T14:54:59.000Z

I have a need to be able to generate XML/RDF output with a specified xml:base value.

Attached is a patch that implements this for the XMLSerializer and PrettyXMLSerializer modules, with an extra test case forPrettyXMLSerializer, and a new test module for XMLSerializer.

test_serializexml.py is pretty much a copy of the test_prettyxml.py, with the tests tweaked to match the output generated.

Apart from the test cases, the patch contains no documentation for how to use this - I wasn't sure where that should go. (xml:base is generated by adding an xml_base=... keyword argument to the serialize call. There is no attempt to align the value with the base provided: my application uses different values for these, as I use a relative base URI.)

All tests pass on my system, which is MacOS 10.5 running Python 2.7:

[[
tinos:googlecode_rdflib graham$ python run_tests.py

Running nose with: --attr= test rdflib --where=./ --with-doctest --doctest-extension=.doctest --doctest-tests
RDFa TC #1: Predicate establishment with @property (approved) ... ok
RDFa TC #6: @rel and @rev (approved) ... ok
RDFa TC #7: @rel, @rev, @property, @content (approved) ... ok
RDFa TC #8: empty string @about (approved) ... ok
RDFa TC #9: @rev (approved) ... ok
RDFa TC #10: @rel, @rev, @href (approved) ... ok
RDFa TC #12: @xml:lang (approved) ... ok
RDFa TC #13: @xml:lang inheritance (approved) ... ok
RDFa TC #14: @datatype, xsd:integer (approved) ... ok
RDFa TC #15: meta and link (approved) ... ok
RDFa TC #17: Related blanknodes (approved) ... ok
RDFa TC #18: @rel for predicate (approved) ... ok
RDFa TC #19: @about for subject (approved) ... ok
RDFa TC #20: Inheriting @about for subject (approved) ... ok
RDFa TC #21: Subject inheritance with no @about (approved) ... ok
RDFa TC #23: @id does not generate subjects (approved) ... ok
RDFa TC #25: simple chaining test (approved) ... ok
RDFa TC #26: @content (approved) ... ok
RDFa TC #27: @content, ignore element content (approved) ... ok
RDFa TC #29: markup stripping with @datatype (approved) ... ok
RDFa TC #30: omitted @about (approved) ... ok
RDFa TC #31: simple @resource (approved) ... ok
RDFa TC #32: @resource overrides @href (approved) ... ok
RDFa TC #33: simple chaining test with bNode (approved) ... ok
RDFa TC #34: simple img[@src] test (approved) ... ok
RDFa TC #35: @src/@href test (approved) ... ok
RDFa TC #36: @src/@resource test (approved) ... ok
RDFa TC #37: @src/@href/@resource test (approved) ... ok
RDFa TC #38: @rev - img[@src] test (approved) ... ok
RDFa TC #39: @rev - @src/@href test (approved) ... ok
RDFa TC #40: @rev - @src/@resource test (approved) ... ok
RDFa TC #41: @rev - @src/@href/@resource test (approved) ... ok
RDFa TC #42: img[@src] test with omitted @about (approved) ... ok
RDFa TC #46: @typeof with @rel present, no @href, @resource, or @about (approved) ... ok
RDFa TC #47: @typeof with @rel and @resource present, no @about (approved) ... ok
RDFa TC #48: @typeof with @about and @rel present, no @resource (approved) ... ok
RDFa TC #49: @typeof with @about, no @rel or @resource (approved) ... ok
RDFa TC #50: @typeof without anything else (approved) ... ok
RDFa TC #51: @typeof with a single @property (approved) ... ok
RDFa TC #52: @typeof with @resource and nothing else (approved) ... ok
RDFa TC #53: @typeof with @resource and nothing else, with a subelement (approved) ... ok
RDFa TC #54: multiple @property (approved) ... ok
RDFa TC #55: multiple @rel (approved) ... ok
RDFa TC #56: @typeof applies to @about on same element with hanging rel (approved) ... ok
RDFa TC #57: hanging @rel creates multiple triples (approved) ... ok
RDFa TC #58: hanging @rel creates multiple triples, @typeof permutation (approved) ... ok
RDFa TC #59: multiple hanging @rels with multiple children (approved) ... ok
RDFa TC #60: UTF-8 conformance (approved) ... ok
RDFa TC #61: @rel in head using reserved, non-prefixed XHTML value (approved) ... ok
RDFa TC #62: @rev in head using reserved, non-prefixed XHTML value (approved) ... ok
RDFa TC #63: @rel in head using reserved XHTML value and empty-prefix CURIE syntax (approved) ... ok
RDFa TC #64: @about with safe CURIE (approved) ... ok
RDFa TC #65: @rel with safe CURIE (approved) ... ok
RDFa TC #66: @about with @typeof in the head (approved) ... ok
RDFa TC #67: @property in the head (approved) ... ok
RDFa TC #68: Relative URI in @about (approved) ... ok
RDFa TC #69: Relative URI in @href (approved) ... ok
RDFa TC #70: Relative URI in @resource (approved) ... ok
RDFa TC #71: No explicit @about (approved) ... ok
RDFa TC #72: Relative URI in @about (with XHTML base in head) (approved) ... ok
RDFa TC #73: Relative URI in @resource (with XHTML base in head) (approved) ... ok
RDFa TC #74: Relative URI in @href (with XHTML base in head) (approved) ... ok
RDFa TC #75: Reserved word 'license' in @rel with no explizit @about (approved) ... ok
RDFa TC #76: All reserved XHTML @rel values (approved) ... ok
RDFa TC #77: All reserved XHTML @rev values (approved) ... ok
RDFa TC #78: Multiple incomplete triples (approved) ... ok
RDFa TC #79: @resource and @href in completing incomplete triples (approved) ... ok
RDFa TC #80: @about overrides @resource in incomplete triples (approved) ... ok
RDFa TC #81: multiple ways of handling incomplete triples (with @rev) (approved) ... ok
RDFa TC #82: multiple ways of handling incomplete triples (with @rel and @rev) (approved) ... ok
RDFa TC #83: multiple ways of handling incomplete triples (merged) (approved) ... ok
RDFa TC #84: multiple ways of handling incomplete triples, this time with both @rel and @rev (approved) ... ok
RDFa TC #85: @resource and @href in completing incomplete triples (approved) ... ok
RDFa TC #86: NO triple for a non-reserved @rel value (approved) ... ok
RDFa TC #87: All reserved XHTML @rel values (with :xxx) (approved) ... ok
RDFa TC #88: Interpretation of the CURIE "_:" (approved) ... ok
RDFa TC #89: @src sets a new subject (@typeof) (approved) ... ok
RDFa TC #90: @src sets a new subject (@rel/@href) (approved) ... ok
RDFa TC #91: Non-reserved, un-prefixed CURIE in @property (approved) ... ok
RDFa TC #93: Tests XMLLiteral content with explicit @datatype (user-data-typed literal) (approved) ... ok
RDFa TC #99: Preservation of white space in literals (approved) ... ok
RDFa TC #104: rdf:value (approved) ... ok
RDFa TC #107: no garbage collecting bnodes (approved) ... ok
RDFa TC #108: plain literal with datatype="" and xml:lang preservation (approved) ... ok
RDFa TC #109: Tests to ensure @xml:base is ignored (approved) ... ok
RDFa TC #110: bNode generated even though no nested @about exists (approved) ... ok
RDFa TC #111: two bNodes generated after three levels of nesting (approved) ... ok
RDFa TC #112: plain literal with datatype="" (approved) ... ok
RDFa TC #113: element with @property and no child nodes generates empty plain literal (approved) ... ok
RDFa TC #115: XML Entities must be supported by RDFa parser (approved) ... ok
RDFa TC #116: Reserved word used in @property should not generate triple (approved) ... ok
RDFa TC #117: Fragment identifiers stripped from BASE (approved) ... ok
RDFa TC #118: empty string "" is not equivalent to NULL - @about (approved) ... ok
RDFa TC #119: "[prefix:]" CURIE format is valid (approved) ... ok
RDFa TC #120: "[:]" CURIE format is valid (approved) ... ok
RDFa TC #121: "[]" is a valid safe CURIE (approved) ... ok
RDFa TC #1001: Vevent using @typeof (approved) ... ok
testAggregateRaw (test.test_aggregate_graphs.GraphAggregates1) ... ok
testA (test.test_comparison.IdentifierEquality) ... ok
testB (test.test_comparison.IdentifierEquality) ... ok
testC (test.test_comparison.IdentifierEquality) ... ok
testD (test.test_comparison.IdentifierEquality) ... ok
testE (test.test_comparison.IdentifierEquality) ... ok
testF (test.test_comparison.IdentifierEquality) ... ok
testG (test.test_comparison.IdentifierEquality) ... ok
testH (test.test_comparison.IdentifierEquality) ... ok
testI (test.test_comparison.IdentifierEquality) ... ok
testAdd (test.test_context.ContextTestCase) ... ok
testConjunction (test.test_context.ContextTestCase) ... ok
testContexts (test.test_context.ContextTestCase) ... ok
testLenInMultipleContexts (test.test_context.ContextTestCase) ... ok
testLenInOneContext (test.test_context.ContextTestCase) ... ok
testRemove (test.test_context.ContextTestCase) ... ok
testRemoveAny (test.test_context.ContextTestCase) ... ok
testRemoveContext (test.test_context.ContextTestCase) ... ok
testRemoveInMultipleContexts (test.test_context.ContextTestCase) ... ok
testTriples (test.test_context.ContextTestCase) ... ok
test_module_names (test.test_conventions.A) ... ok
test_equality (test.test_datetime.TestRelativeBase) ... ok
test_microseconds (test.test_datetime.TestRelativeBase) ... ok
test_timezone (test.test_datetime.TestRelativeBase) ... ok
with bnode ... ok
Curiously, this one passes, even before the fix in issue 151 ... ok
test_base_ref (test.test_empty_xml_base.TestEmptyBase) ... ok
test_base_ref (test.test_empty_xml_base.TestRelativeBase) ... ok
testEvents (test.test_events.EventTestCase) ... ok
testAdd (test.test_graph.GraphTestCase) ... ok
testConNeg (test.test_graph.GraphTestCase) ... ok
testConnected (test.test_graph.GraphTestCase) ... ok
http://code.google.com/p/rdflib/issues/detail?id=5 ... ok
testGraphAdd (test.test_graph.GraphTestCase) ... ok
testGraphIntersection (test.test_graph.GraphTestCase) ... ok
testGraphValue (test.test_graph.GraphTestCase) ... ok
testRemove (test.test_graph.GraphTestCase) ... ok
testStatementNode (test.test_graph.GraphTestCase) ... ok
testSub (test.test_graph.GraphTestCase) ... ok
testTriples (test.test_graph.GraphTestCase) ... ok
Test reading N3 from a unicode objects as data ... ok
Test reading N3 from a utf8 encoded string as data ... ok
Test reading N3 from a codecs.StreamReader, outputting unicode ... ok
Test reading N3 from a StringIO over the unicode object ... ok
Test reading N3 from a StringIO over the string object ... ok
Test reading XML from a unicode object as data ... ok
Test reading XML from a utf8 encoded string object as data ... ok
Test reading XML from a StringIO created from utf8 encoded string ... ok
test_backslash (test.test_literal.TestLiteral) ... ok
test_literal_from_bool (test.test_literal.TestLiteral) ... ok
test_repr_apostrophe (test.test_literal.TestLiteral) ... ok
test_repr_quote (test.test_literal.TestLiteral) ... ok
testMd5 (test.test_literal.TestMd5) ... ok
testCantPassLangAndDatatype (test.test_literal.TestNew) ... ok
testDatatypeGetsAutoURIRefConversion (test.test_literal.TestNew) ... ok
testOmitsMissingDatatype (test.test_literal.TestRepr) ... ok
testOmitsMissingDatatypeAndLang (test.test_literal.TestRepr) ... ok
testOmitsMissingLang (test.test_literal.TestRepr) ... ok
testSubclassNameAppearsInRepr (test.test_literal.TestRepr) ... ok
Test that the n3 parser supports base declarations ... ok
Test that the n3 parser throws an Exception when using the identifier ... ok
Make sure n3 parser does not choke on UTF-8 BOM ... ok
testIssue23 (test.test_n3.TestN3Case) ... ok
testIssue29 (test.test_n3.TestN3Case) ... ok
testIssue68 (test.test_n3.TestN3Case) ... ok
testModel (test.test_n3.TestN3Case) ... ok
testParse (test.test_n3.TestN3Case) ... ok
test_quoting (test.test_n3.TestN3Quoting) ... ok
test.test_n3_2.testN3Store ... ok
test.test_n3test.test_all_n3_serialize('test/n3/example-just_a_class.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/example-lots_of_graphs.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/example-misc.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/example-ontology.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/issue156.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/listTest.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/longString.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/longString.rdf', 'xml') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-01.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-03.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-04.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-05.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-06.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-07.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-08.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-09.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-10.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-11.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-12.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-13.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-14.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-15.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-16.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-17.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-18.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-19.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-20.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-21.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-22.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-23.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-24.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-26.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-28.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/n3-writer-test-29.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-02.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-03.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-04.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-05.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-06.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-07.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-09.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-11.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-12.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-13.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-14.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-15.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-16.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-17.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-18.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-19.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-20.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-21.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-22.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-23.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-26.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-27.n3', 'n3') ... ok
test.test_n3test.test_all_n3_serialize('test/n3/rdf-test-28.n3', 'n3') ... ok
Test sequential assignment of unknown prefixes ... ok
test_n3 (test.test_namespace.NamespacePrefixTest) ... ok
test_n32 (test.test_namespace.NamespacePrefixTest) ... ok
testIssue146 (test.test_nt.NTTestCase) ... ok
testIssue78 (test.test_nt.NTTestCase) ... ok
test.test_nttest.test_all_nt_serialize('test/nt/rdflibtest01.nt', 'nt') ... ok
testNoPathWithHash (test.test_parser.ParserTestCase) ... ok
test (test.test_prefixTypes.PrefixTypesTest) ... ok
Repeats ``test_serialize`` ``self.repeats`` times, to reduce sucess based on in-memory ordering. ... ok
test.test_prettyxml.TestPrettyXmlSerializer.test_result_fragments ... ok
test.test_prettyxml.TestPrettyXmlSerializer.test_result_fragments_with_base ... ok
test.test_prettyxml.TestPrettyXmlSerializer.test_serialize_and_reparse ... ok
test.test_prettyxml.TestPrettyXmlSerializer.test_subClassOf_objects ... ok
testRDFXML (test.test_rdf.RDFTestCase) ... ok
test.test_rdf.test_suite ... ok
testCollectionRDFXML (test.test_rdf_lists.OWLCollectionTest) ... ok
testNegative (test.test_rdfxml.ParserTestCase) ... ok
testPositive (test.test_rdfxml.ParserTestCase) ... ok
testSeq (test.test_seq.SeqTestCase) ... ok
test.test_seq.test_suite ... ok
Repeats ``test_serialize`` ``self.repeats`` times, to reduce sucess based on in-memory ordering. ... ok
test.test_serializexml.TestXMLSerializer.test_result_fragments ... ok
test.test_serializexml.TestXMLSerializer.test_result_fragments_with_base ... ok
test.test_serializexml.TestXMLSerializer.test_serialize_and_reparse ... ok
test.test_serializexml.TestXMLSerializer.test_subClassOf_objects ... ok
testAdd (test.test_sleepycat.SleepycatGraphTestCase) ... ok
testConNeg (test.test_sleepycat.SleepycatGraphTestCase) ... ok
testConnected (test.test_sleepycat.SleepycatGraphTestCase) ... ok
http://code.google.com/p/rdflib/issues/detail?id=5 ... ok
testGraphAdd (test.test_sleepycat.SleepycatGraphTestCase) ... ok
testGraphIntersection (test.test_sleepycat.SleepycatGraphTestCase) ... ok
testGraphValue (test.test_sleepycat.SleepycatGraphTestCase) ... ok
testRemove (test.test_sleepycat.SleepycatGraphTestCase) ... ok
testStatementNode (test.test_sleepycat.SleepycatGraphTestCase) ... ok
testSub (test.test_sleepycat.SleepycatGraphTestCase) ... ok
testTriples (test.test_sleepycat.SleepycatGraphTestCase) ... ok
testAdd (test.test_sleepycat.SleepycatStoreTestCase) ... ok
testConjunction (test.test_sleepycat.SleepycatStoreTestCase) ... ok
testContexts (test.test_sleepycat.SleepycatStoreTestCase) ... ok
testLenInMultipleContexts (test.test_sleepycat.SleepycatStoreTestCase) ... ok
testLenInOneContext (test.test_sleepycat.SleepycatStoreTestCase) ... ok
testRemove (test.test_sleepycat.SleepycatStoreTestCase) ... ok
testRemoveAny (test.test_sleepycat.SleepycatStoreTestCase) ... ok
testRemoveContext (test.test_sleepycat.SleepycatStoreTestCase) ... ok
testRemoveInMultipleContexts (test.test_sleepycat.SleepycatStoreTestCase) ... ok
testTriples (test.test_sleepycat.SleepycatStoreTestCase) ... ok
test_default_namespaces_method (test.test_store.UtilTestCase) ... ok
test_to_bits_from_bits_round_trip (test.test_store.UtilTestCase) ... ok
testSubclassNameAppearsInRepr (test.test_term.TestBNodeRepr) ... ok
testSubclassNameAppearsInRepr (test.test_term.TestURIRefRepr) ... ok
testSerialize (test.test_trix_serialize.TestTrixSerialize) ... ok
Doctest: rdflib.collection.Collection ... ok
Doctest: rdflib.collection.Collection.__delitem__ ... ok
Doctest: rdflib.collection.Collection.append ... ok
Doctest: rdflib.collection.Collection.n3 ... ok
Doctest: rdflib.compare ... ok
Doctest: rdflib.compare.isomorphic ... ok
Doctest: rdflib.events ... ok
Doctest: rdflib.graph ... ok
Doctest: rdflib.graph.Graph.parse ... ok
Doctest: rdflib.graph.Graph.transitiveClosure ... ok
Doctest: rdflib.plugins.parsers.notation3.canonical ... ok
Doctest: rdflib.plugins.parsers.notation3.hexify ... ok
Doctest: rdflib.plugins.parsers.notation3.join ... ok
Doctest: rdflib.plugins.parsers.notation3.refTo ... ok
Doctest: rdflib.plugins.parsers.notation3.splitFrag ... ok
Doctest: rdflib.plugins.parsers.notation3.splitFragP ... ok
Doctest: rdflib.term.BNode.__eq__ ... ok
Doctest: rdflib.term.Literal ... ok
Doctest: rdflib.term.Literal.__add__ ... ok
Doctest: rdflib.term.Literal.__eq__ ... ok
Doctest: rdflib.term.Literal.__hash__ ... ok
Doctest: rdflib.term.Literal.__le__ ... ok
Doctest: rdflib.term.Literal.__lt__ ... ok
Doctest: rdflib.term.Literal.__ne__ ... ok
Doctest: rdflib.term.Literal._literal_n3 ... ok
Doctest: rdflib.term.Literal.n3 ... ok
Doctest: rdflib.util.date_time ... ok
Doctest: rdflib.util.parse_date_time ... ok
Doctest: rdflib ... ok

----------------------------------------------------------------------
Ran 303 tests in 103.856s

OK
]]

Comment 1 by gjhigg...@gmail.com
That's odd. I applied the patch to my "staging" clone but I'm now seeing a test failure (on Ubuntu natty).

In an effort to assist diagnosis, I have tweaked the test assertion so that it outputs the value of rdfXml. The CI build failure log has the details -

Python2.6: http://bel-epa.com/hudson/job/rdflib-test/TOXENV=py26/lastCompletedBuild/testReport/test.test_serializexml/TestXMLSerializer/test_result_fragments_with_base/

Python2.7: http://bel-epa.com/hudson/job/rdflib-test/TOXENV=py27/lastCompletedBuild/testReport/test.test_serializexml/TestXMLSerializer/test_result_fragments_with_base/

and I've included the relevant fragment of the error log in an attached file.

Comment 2 by gklyn...@gmail.com
Thanks for the feedback detail.

Hmmm... I wonder if my patch generation went wrong (I'm a bit new to this aspect of Mercurial). It appears that the XMLSerializer is NOT adding the xml:base statement. ( Is it possible to browse code in the staging repository?)

Looking at the patch source, it looks as if there may be 2 lines missing in the update to serialize for XMLSerializer. I think I should try and regenerate the patch against the current repository tip.

Comment 3 by gklyn...@gmail.com
OK, I'm now fairly sure it was my patch: as far as I can tell, there were two commits making up my changes, but my patch file only covered one of them. Apologies for the inconvenience caused.

I've generated a new patch file (attached) covering both the commits. I've tested the patch file by:
(1) creating a new clone of the main code repo (hg clone ...)
(2) running the original testsuite 297 tests all pass (python run_tests.py)
(3) applying the new patch to my new working copy (hg import ...)
(4) re-running the test suite. 303 tests all pass: (python run_tests.py)

Ran 303 tests in 103.897s

Is there more I can do to validate the patch?

Comment 4 by gjhigg...@gmail.com
++ Is it possible to browse code in the staging repository?

Ach, that would have been useful to you, sorry for the omission.

++ I've tested the patch file by ...
++ [ ... ]
++ Is there more I can do to validate the patch?

Your approach is impeccable. I was able to replicate it
successfully and confirm the test success. Job done,
revision 4abe48469431 committed.

http://code.google.com/p/rdflib/source/detail?r=4abe48469431fb6a3598dfb447477675e52b553e

(http://bel-epa.com/hudson/job/rdflib/37/)

Thank you for the contribution.

I've been caught out a number of times with Mercurial (and
friends) --- I now habitually arrange matters so that stuff
is pushed through the Hudson CI as a matter of course so
that I get an independent confirmation from a different
machine. It's overkill to a degree but I'm still feeling
around for an approach that compensates for my rather loose
working style but which also keeps the busywork to a minimum.