Skip to content

Commit

Permalink
Prefix with numbers so we can keep sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
nutjob4life committed Sep 6, 2023
1 parent be88783 commit 002b579
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/edrn.rdf/edrn/rdf/multipipepredicatehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 002b579

Please sign in to comment.