Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions csvwlib/converter/ToRDFConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ def parse_virtual_columns(self, row_node, atdm_row, table_metadata):
continue
subject = URIRef(UriTemplateUtils.insert_value(virtual_column['aboutUrl'], atdm_row, '',
table_metadata['url']))

predicate = Namespaces.get_term(virtual_column['propertyUrl'])
obj = UriTemplateUtils.insert_value(virtual_column['valueUrl'], atdm_row, '', table_metadata['url'])
obj = CommonProperties.expand_property_if_possible(obj)
self.graph.add((subject, predicate, URIRef(obj)))
if self.mode == CONST_STANDARD_MODE:
self.graph.add((row_node, CSVW.describes, subject))
if predicate:
obj = UriTemplateUtils.insert_value(virtual_column['valueUrl'], atdm_row, '', table_metadata['url'])
obj = CommonProperties.expand_property_if_possible(obj)
self.graph.add((subject, predicate, URIRef(obj)))
if self.mode == CONST_STANDARD_MODE:
self.graph.add((row_node, CSVW.describes, subject))
else:
print(f"term {virtual_column['propertyUrl']} not in namespaces")

def _add_file_metadata(self, metadata, node):
language = JSONLDUtils.language(self.metadata['@context'])
Expand Down
1 change: 1 addition & 0 deletions csvwlib/utils/rdf/Namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def all():
'org': Namespace('http://www.w3.org/ns/org#'),
'owl': Namespace('http://www.w3.org/2002/07/owl#'),
'prov': Namespace('http://www.w3.org/ns/prov#'),
'qudt': Namespace('http://qudt.org/1.1/schema/qudt#'),
'qb': Namespace('http://purl.org/linked-data/cube#'),
'rdf': Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#'),
'rdfa': Namespace('http://www.w3.org/ns/rdfa#'),
Expand Down