<commit_before># test for https://github.com/RDFLib/rdflib/issues/523

import rdflib

g = rdflib.Graph()
r = g.query("SELECT (<../baz> as ?test) WHERE {}",
            base=rdflib.URIRef("http://example.org/foo/bar"))
res = r.serialize(format="csv")
assert res == 'test\r\nhttp://example.org/baz\r\n', repr(res)

# expected result:
#test
#http://example.org/baz

# actual result;
#test
#http://example.org/foo/bar../baz<commit_msg>py3 unicode/bytestring bugger<commit_after># test for https://github.com/RDFLib/rdflib/issues/523

import rdflib

g = rdflib.Graph()
r = g.query("SELECT (<../baz> as ?test) WHERE {}",
            base=rdflib.URIRef("http://example.org/foo/bar"))
res = r.serialize(format="csv")
assert res == b'test\r\nhttp://example.org/baz\r\n', repr(res)

# expected result:
#test
#http://example.org/baz

# actual result;
#test
#http://example.org/foo/bar../baz
{'fraction_non_alphanumeric': 0.20591581342434584, 'fraction_numerical': 0.007963594994311717, 'mean_word_length': 3.782608695652174, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5864177', 'n_tokens_mistral': 351, 'n_tokens_neox': 333, 'n_words': 59}