I am trying to create graph using csv data .
It is showing that import is successful however no data comes into the DB.
Steps I followed is as below:
Created a csv file
Created a call.sms file
PREFIX person: <http://stardog.com/person/>
MAPPING
FROM CSV {
"Src" : "?src"
}
TO {
?person1 a person:Person ;
person:name ?src.
}
WHERE {
BIND (template("http://stardog.com/person/{src}") AS ?person1)
}
Ran the import command and details is
C:\stardog\bin>stardog-admin virtual import --format sms2 call call.sms Zac.csv
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 (file:/C:/stardog/client/api/guice-4.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Import completed successfully
The text between the braces after "CSV" is ignored. You will need to use variable names which cases matching the field headers, eg. person:name ?Src. and BIND (template("http://stardog.com/person/{Src}") AS ?person1).
Thanks a lot Jess, It worked. Although It is given in the tutorial however i was confused then how to map csv column header with a variable name.
Now with below sms I am able to create relationship
MAPPING
FROM CSV {
}
TO {
?person1 a person:Person ;
person:name ?Src.
?person2 a person:Person ;
person:name ?Tgt.
?person1:called ?person2.
}
WHERE {
BIND (template("http://stardog.com/person/{Src}") AS ?person1)
BIND (template("http://stardog.com/person/{Tgt}") AS ?person2)
}
Please let me know if this is good?
Also I need to associate time of the call. screenshot attached in my previous post of the same issue.
As I come from LPG background , could you please help me to design this.
You can create an IRI for the call record using the row number, eg BIND(template("my_prefix:call:{ROW_NUMBER}") as ?call). Then you can use the call to associate all related pieces of data:
?call :from ?person1 ; :to ?person2 ; :at ?date
The date strings shown in your example are not valid ISO 8601 date strings are not compatible with the xsd:dateTime type. If you would prefer to treat them as timestamps in Stardog, it will be necessary to perform some additional formatting manipulation.