Skip to content
Snippets Groups Projects
Commit b762c48a authored by Eliott Sammier's avatar Eliott Sammier
Browse files

Add resource name to Protege display name

parent 6abe48a5
No related branches found
No related tags found
No related merge requests found
...@@ -20,10 +20,11 @@ def add_index(g: Graph, subject: URIRef, index: int): ...@@ -20,10 +20,11 @@ def add_index(g: Graph, subject: URIRef, index: int):
## Generate Protégé display name if a title is set ## Generate Protégé display name if a title is set
title = g.value(subject, NS["titre"]) title = g.value(subject, NS["titre"])
if isinstance(title, Literal): if isinstance(title, Literal):
name = str(subject).split("/")[-1] # Last path component of subject URI
g.add( g.add(
( (
subject, subject,
NS["__protege_display_name"], NS["__protege_display_name"],
Literal("{:02} | ".format(index)) + title, Literal(f"{index:02} | {name} | ") + title,
) )
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment