PeteY
(Peter Youngs)
May 17, 2018, 9:46am
1
I'd really appreciate some help with this please. I'm trying to load a CSV into a Virtual Graph, and failing with this error message: Invalid variable: "ID"
My CSV, named Person.csv, is:
Type,ID,Title,First Name,Last Name,Job Title,Organization
Person,121627870,Mr,Tony,McTony,Data Scientist,
Person,155342734,,John,Smith,Data architect,
My mapping file, named person_csv_VG.ttl, is:
@prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# .
@prefix xsd: http://www.w3.org/2001/XMLSchema# .
@prefix person: http://example.com/person/ .
@prefix sm: tag:stardog:api:mapping: .
person:{"ID"} a person:Person ;
person:title "{"Title"}" ;
person:firstName "{"First Name"}" ;
person:lastName "{"Last Name"}" ;
person:jobTitle "{"Job Title"}" ;
person:organization "{"Organization"}" ;
sm:map [
sm:table "Person" ;
] .
My run command is:
stardog-admin virtual import py_VG1_DB C:\stardog-5.3.0\person_csv_VG.ttl C:\stardog-5.3.0\Person.csv
Many thanks for any guidance on what I'm doing wrong.
stephen
(stephen)
May 17, 2018, 1:43pm
2
Hi,
For CSV imports I do not believe you need to quote your headings (unless the heading in the CSV itself is quoted), so your mapping file would look like:
person:{ID} a person:Person ;
person:title "{Title}" ;
...
1 Like
PeteY
(Peter Youngs)
May 18, 2018, 8:08am
3
Bang on. Thanks very much indeed. My mapping file now looks like this and it works:
@prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# .
@prefix xsd: http://www.w3.org/2001/XMLSchema# .
@prefix person: http://example.com/person/ .
@prefix sm: tag:stardog:api:mapping: .
person:{ID} a person:Person ;
person:title "{Title}" ;
person:firstName "{First Name}" ;
person:lastName "{Last Name}" ;
person:jobTitle "{Job Title}" ;
person:organization "{Organization}" ;
sm:map [
sm:table "Person" ;
] .
Thanks Stephen.
system
(system)
Closed
June 1, 2018, 8:08am
4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.