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 @@ -144,20 +144,21 @@ class TableSchema {
144
144
return undefined
145
145
}
146
146
147
- if ( column . valueUrl ) {
148
- return this . factory . namedNode ( column . valueUrl . fill ( row ) )
149
- }
150
-
151
147
let value = column . titles . reduce ( ( value , title ) => {
152
148
return value || row [ title ]
153
149
} , '' )
154
150
155
- if ( value === '' ) {
156
- value = column . defaultValue
151
+ if ( ! column . virtual ) {
152
+ if ( value === '' ) {
153
+ value = column . defaultValue
154
+ }
155
+ if ( typeof value === 'undefined' || value === column . nullValue ) {
156
+ return undefined
157
+ }
157
158
}
158
159
159
- if ( typeof value === 'undefined' || value === column . nullValue ) {
160
- return undefined
160
+ if ( column . valueUrl ) {
161
+ return this . factory . namedNode ( column . valueUrl . fill ( row ) )
161
162
}
162
163
163
164
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