Skip to content

Commit 0e78196

Browse files
committed
fix: merge rdfs:label export from upstream
1 parent f450b72 commit 0e78196

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

nipype/external/provcopy.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from rdflib.term import URIRef, BNode
2222
from rdflib.term import Literal as RDFLiteral
2323
from rdflib.graph import ConjunctiveGraph, Graph
24-
from rdflib.namespace import RDF
24+
from rdflib.namespace import RDF, RDFS
2525
except ImportError:
2626
pass
2727

@@ -760,7 +760,12 @@ def rdf(self, graph=None, subj=None):
760760
graph.add((subj, pred, obj))
761761
if self._extra_attributes:
762762
for (attr, value) in self._extra_attributes:
763-
pred = attr.rdf_representation() if attr != PROV['type'] else RDF.type
763+
if attr == PROV['type']:
764+
pred = RDF.type
765+
elif attr == PROV['label']:
766+
pred = RDFS.label
767+
else:
768+
pred = attr.rdf_representation()
764769
try:
765770
# try if there is a RDF representation defined
766771
obj = value.rdf_representation()
@@ -825,7 +830,12 @@ def rdf(self, graph=None):
825830
for (attr, value) in self._extra_attributes:
826831
if not value:
827832
continue
828-
pred = attr.rdf_representation() if attr != PROV['type'] else RDF.type
833+
if attr == PROV['type']:
834+
pred = RDF.type
835+
elif attr == PROV['label']:
836+
pred = RDFS.label
837+
else:
838+
pred = attr.rdf_representation()
829839
try:
830840
# try if there is a RDF representation defined
831841
otherobj = value.rdf_representation()

0 commit comments

Comments
 (0)