Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to insert rdf data #8

Open
fahadmhd opened this issue Dec 13, 2022 · 2 comments
Open

how to insert rdf data #8

fahadmhd opened this issue Dec 13, 2022 · 2 comments

Comments

@fahadmhd
Copy link

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
Copy link
Collaborator

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants