Simple CSV loaded with `apoc.load.csv` does not make all columns available as property keys

Hi, new to Neo4j/Cypher/Apoc, not sure why this isn't working.

#1. I successfully import the following CSV (saved as subjects-with-wikidata.csv):

name,category,wikidataURL,wikipediaURL
New York City,city,https://www.wikidata.org/wiki/Q60,https://en.wikipedia.org/wiki/New_York_City
Washington DC,city,https://www.wikidata.org/wiki/Q61,https://en.wikipedia.org/wiki/Washington_D.C.

#2. I run the following Cypher query:

CALL apoc.load.csv('/subjects-with-wikidata.csv') yield map as row
CREATE (s:Subject) SET s = row
RETURN s, s.name LIMIT 10

#3. The following is returned:

My question: why is s.name null, even though a string (like "New York City") clearly exists as a property? This remains true regardless of the syntax, even though other properties are available:

Here is the full warning, but I don't understand why the property key is not in the database.

The provided property key is not in the database

One of the property names in your query is not available in the database, make sure you didn't misspell it or that the label is available when you run this statement in your application (the missing property name is: name)

Hello @cekohlbrenner :slight_smile:

I tried on Neo4j Database 4.3.1 and everything worked:

CALL apoc.load.csv('subjects-with-wikidata.csv') YIELD map
CREATE (s:Subject) SET s = map
RETURN s, s.name LIMIT 10
MATCH (s:Subject)
RETURN s.category, s.name, s.wikidataURL, s.wikipediaURL

Regards,
Cobra

Thanks @cobra . I guess it's good to know I'm not missing anything in my syntax.

Any ideas why I'm getting a different result?

I'm on version 4.2.1. I guess I can try starting a new project or DB and see if I can reproduce in all cases.

call dbms.components() yield name, versions unwind versions as version return name, version;
╒══════════════╤═════════╕
│"name"        │"version"│
╞══════════════╪═════════╡
│"Neo4j Kernel"│"4.2.1"  │
└──────────────┴─────────┘

Try to install the latest version of Neo4j :slight_smile:

I've tried with latest version (4.3.2), but still have the same issue...seems like the first column of the CSV always has this issue.

My workaround is to put unneeded values in the first column, which makes it possible to return values for all the necessary properties. Storing extra unnecessary properties isn't ideal, but works for now.