|
21 | 21 | from rdflib.term import URIRef, BNode
|
22 | 22 | from rdflib.term import Literal as RDFLiteral
|
23 | 23 | from rdflib.graph import ConjunctiveGraph, Graph
|
24 |
| - from rdflib.namespace import RDF |
| 24 | + from rdflib.namespace import RDF, RDFS |
25 | 25 | except ImportError:
|
26 | 26 | pass
|
27 | 27 |
|
@@ -760,7 +760,12 @@ def rdf(self, graph=None, subj=None):
|
760 | 760 | graph.add((subj, pred, obj))
|
761 | 761 | if self._extra_attributes:
|
762 | 762 | 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() |
764 | 769 | try:
|
765 | 770 | # try if there is a RDF representation defined
|
766 | 771 | obj = value.rdf_representation()
|
@@ -825,7 +830,12 @@ def rdf(self, graph=None):
|
825 | 830 | for (attr, value) in self._extra_attributes:
|
826 | 831 | if not value:
|
827 | 832 | 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() |
829 | 839 | try:
|
830 | 840 | # try if there is a RDF representation defined
|
831 | 841 | otherobj = value.rdf_representation()
|
|
0 commit comments