innotrade / enapso-graphdb-client

ENAPSO Graph Database Client for Node.js
Apache License 2.0
8 stars 0 forks source link

how to insert rdf data #8

Open fahadmhd opened 1 year ago

fahadmhd commented 1 year ago

I have using your code for inserting classes in graphdb via nodejs. It enapso-graphdb-client worked fine, thanks I want to insert data now in classes, for example an individual with name and age datatype properties. Can you please show ? //insert a triple graphDBEndpoint .update( insert data { graph <${GRAPHDB_CONTEXT_TEST}> { entest:Individual1 rdf:type owl:NamedIndividual} } ) .then((result) => { console.log("inserted a individual :\n" + JSON.stringify(result, null, 2)); }) .catch((err) => { console.log(err); }); this code will not work

asheshgoplani commented 1 year ago

Hello fahadmhd, The issue seems to be in the variable "GRAPHDB_CONTEXT_TEST", As this may not be defined.

You can try to remove the variable and insert your named graph directly.

'insert data { graph { entest:Individual1 rdf:type owl:NamedIndividual} }'

Do not remove < > these characters

Looking forward to your response

fahadmhd commented 1 year ago

thanks, it worked.

Now I would like to know is it possible to insert many triples at the same insert block like 'insert data { graph { triple1 , triple2, triple3} }' For an example :collab1 rdf:type :CBI_Collaborator , owl:NamedIndividual ;
:name "alexandre" ; :interest2 "business intelligence" ; :level "Data Scientist";

OR we should do insert separately each of the triple ? thanks alot for your help