File tree Expand file tree Collapse file tree 4 files changed +49
-8
lines changed Expand file tree Collapse file tree 4 files changed +49
-8
lines changed Original file line number Diff line number Diff line change @@ -146,20 +146,21 @@ class TableSchema {
146
146
return undefined
147
147
}
148
148
149
- if ( column . valueUrl ) {
150
- return this . factory . namedNode ( column . valueUrl . fill ( row ) )
151
- }
152
-
153
149
let value = column . titles . reduce ( ( value , title ) => {
154
150
return value || row [ title ]
155
151
} , '' )
156
152
157
- if ( value === '' ) {
158
- value = column . defaultValue
153
+ if ( ! column . virtual ) {
154
+ if ( value === '' ) {
155
+ value = column . defaultValue
156
+ }
157
+ if ( typeof value === 'undefined' || value === column . nullValue ) {
158
+ return undefined
159
+ }
159
160
}
160
161
161
- if ( typeof value === 'undefined' || value === column . nullValue ) {
162
- return undefined
162
+ if ( column . valueUrl ) {
163
+ return this . factory . namedNode ( column . valueUrl . fill ( row ) )
163
164
}
164
165
165
166
if ( column . datatype . base . value === this . ns . dateTime . value ) {
Original file line number Diff line number Diff line change
1
+ a,b
2
+ 100,200
3
+ 300,
Original file line number Diff line number Diff line change
1
+ {
2
+ "@context" : " http://www.w3.org/ns/csvw" ,
3
+ "url" : " nulls.csv" ,
4
+ "tableSchema" : {
5
+ "columns" : [
6
+ {
7
+ "titles" : " a" ,
8
+ "name" : " a" ,
9
+ "propertyUrl" : " http://example.org/a" ,
10
+ "valueUrl" : " http://example.org/{a}"
11
+ },
12
+ {
13
+ "titles" : " b" ,
14
+ "name" : " b" ,
15
+ "propertyUrl" : " http://example.org/b" ,
16
+ "valueUrl" : " http://example.org/{b}"
17
+ }
18
+ ]
19
+ }
20
+ }
Original file line number Diff line number Diff line change
1
+ _:c14n0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/csvw#Row> .
2
+ _:c14n0 <http://www.w3.org/ns/csvw#describes> _:c14n3 .
3
+ _:c14n0 <http://www.w3.org/ns/csvw#rownum> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
4
+ _:c14n0 <http://www.w3.org/ns/csvw#url> <test031-null-cell.csv#row=2> .
5
+ _:c14n1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/csvw#Table> .
6
+ _:c14n1 <http://www.w3.org/ns/csvw#row> _:c14n0 .
7
+ _:c14n1 <http://www.w3.org/ns/csvw#row> _:c14n5 .
8
+ _:c14n1 <http://www.w3.org/ns/csvw#url> <test031-null-cell.csv> .
9
+ _:c14n2 <http://example.org/a> <http://example.org/300> .
10
+ _:c14n3 <http://example.org/a> <http://example.org/100> .
11
+ _:c14n3 <http://example.org/b> <http://example.org/200> .
12
+ _:c14n4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/csvw#TableGroup> .
13
+ _:c14n4 <http://www.w3.org/ns/csvw#table> _:c14n1 .
14
+ _:c14n5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/csvw#Row> .
15
+ _:c14n5 <http://www.w3.org/ns/csvw#describes> _:c14n2 .
16
+ _:c14n5 <http://www.w3.org/ns/csvw#rownum> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
17
+ _:c14n5 <http://www.w3.org/ns/csvw#url> <test031-null-cell.csv#row=3> .
You can’t perform that action at this time.
0 commit comments