From 002b579fdc5f652c042151749d4fe9b5b31a3274 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Wed, 6 Sep 2023 10:31:44 -0500 Subject: [PATCH] Prefix with numbers so we can keep sort order --- src/edrn.rdf/edrn/rdf/multipipepredicatehandler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/edrn.rdf/edrn/rdf/multipipepredicatehandler.py b/src/edrn.rdf/edrn/rdf/multipipepredicatehandler.py index 39dcbd6..4d5158f 100644 --- a/src/edrn.rdf/edrn/rdf/multipipepredicatehandler.py +++ b/src/edrn.rdf/edrn/rdf/multipipepredicatehandler.py @@ -19,5 +19,9 @@ def __init__(self, context): self.context = context def characterize(self, obj): context = aq_inner(self.context) - rc = [(rdflib.URIRef(context.predicateURI), rdflib.Literal(i.strip())) for i in obj.split('|')] + rc, count = [], 0 + for i in obj.split('|'): + literal = rdflib.Literal(f'{count:04} {i.strip()}') + rc.append((rdflib.URIRef(context.predicateURI), literal)) + count += 1 return rc