CLARIAH / COW

Integrated CSV to RDF converter, using CSVW and nanopublications
MIT License
46 stars 9 forks source link

Variables not skipped when included to specify null in list #98

Closed RubenSchalk closed 4 years ago

RubenSchalk commented 4 years ago

If variable x should not be included as a separate triple, but variable x is used in a @listto specify a null field for another variable, triples for x are still generated.

Example:

{
    "virtual": "true",
    "datatype": "date",
    "propertyUrl": "schema:birthDate",
    "dc:description": "Date of birth",
    "null": {"@list": [{"name": "Month_Birth", "null": "0"},
      {"name": "Day_Birth", "null": "0"}]},
    "csvw:value": "{{['%04d'| format(Year_Birth|int),'-','%02d' | format(Month_Birth|int),'-','%02d'|format(Day_Birth|int)]|join}}"
  }

This will still produce triples for both Month_Birth and Day_Birth, even when they are specified nowhere else in the metadata json.

RubenSchalk commented 4 years ago

Note: this also happens with Python 2

melvinroest commented 4 years ago

I see, so in this case, while Month_Birth and _Day_Birth are in the csv file, you don't want them converted to linked data. You want the combination of YYYY-MM-DD.

So a MVE CSV would be:

Year_Birth,Month_Birth,Day_Birth
1980,0,0
1970,6,29
melvinroest commented 4 years ago

Closing this issue for now, if the patch in the 2020 branch doesn't work, then let's reopen it.