bug fixes on custom language and date rdf handling
@@ -752,9 +752,8 @@ class Date(AbstractMetaDataElement):
def rdf_triples(self, subject, graph):
date_node = BNode()
graph.add((subject, DC.date, date_node))
- type_node = BNode()
graph.add((date_node, RDF.type, getattr(DC, self.type)))
- graph.add((type_node, RDF.value, Literal(self.start_date.isoformat())))
+ graph.add((date_node, RDF.value, Literal(self.start_date.isoformat())))
@classmethod
def ingest_rdf(self, graph, content_object):
@@ -763,7 +762,7 @@ class Date(AbstractMetaDataElement):
type = graph.value(subject=date_node, predicate=RDF.type)
value = graph.value(subject=date_node, predicate=RDF.value)
if type and value:
- type = type.split('#')[-1]
+ type = type.split('/')[-1]
start_date = parser.parse(str(value))
Date.create(type=type, start_date=start_date, content_object=content_object)
@@ -1199,7 +1198,7 @@ class Language(AbstractMetaDataElement):
subject = content_object.rdf_subject()
code = graph.value(subject=subject, predicate=DC.language)
if code:
- Language.create(code=code, content_object=content_object)
+ Language.create(code=code.value, content_object=content_object)
class Coverage(AbstractMetaDataElement):
