Sending SPARQL update query to Graphdb from Angular The 2019 Stack Overflow Developer Survey Results Are InInsert a Sparql Query Into Ontotext GraphDBAngular 4: Unknown error after POST request to REST api on localhostSending POST request via Observable from angular to nodejsTurn off reasoner from Sparql Query in GraphDbGraphDB queries fail silently (OutOfMemoryError)Select repository via the REST APIGraphDB - very slow sparql query with two connectionsSpeeding up SPARQL query on GraphDBcustom sparql filter GraphdbError 405 when sending post request from Angular to Asp.net

What is the steepest angle that a canal can be traversable without locks?

Does a dangling wire really electrocute me if I'm standing in water?

What is the best strategy for white in this position?

Unbreakable Formation vs. Cry of the Carnarium

In microwave frequencies, do you use a circulator when you need a (near) perfect diode?

Protecting Dualbooting Windows from dangerous code (like rm -rf)

"To split hairs" vs "To be pedantic"

How to reverse every other sublist of a list?

Is "plugging out" electronic devices an American expression?

Why is my p-value correlated to difference between means in two sample tests?

Understanding the implication of what "well-defined" means for the operation in quotient group

How to answer pointed "are you quitting" questioning when I don't want them to suspect

What tool would a Roman-age civilization have to grind silver and other metals into dust?

Why do some words that are not inflected have an umlaut?

Which Sci-Fi work first showed weapon of galactic-scale mass destruction?

What is the motivation for a law requiring 2 parties to consent for recording a conversation

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

Spanish for "widget"

How come people say “Would of”?

How to deal with fear of taking dependencies

Is an up-to-date browser secure on an out-of-date OS?

What can other administrators access on my machine?

Patience, young "Padovan"

Where does the "burst of radiance" from Holy Weapon originate?



Sending SPARQL update query to Graphdb from Angular



The 2019 Stack Overflow Developer Survey Results Are InInsert a Sparql Query Into Ontotext GraphDBAngular 4: Unknown error after POST request to REST api on localhostSending POST request via Observable from angular to nodejsTurn off reasoner from Sparql Query in GraphDbGraphDB queries fail silently (OutOfMemoryError)Select repository via the REST APIGraphDB - very slow sparql query with two connectionsSpeeding up SPARQL query on GraphDBcustom sparql filter GraphdbError 405 when sending post request from Angular to Asp.net



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am trying to send an UPDATE (insert) to a Graphdb instance, starting from an ANGULAR web-application (typescript). Therefore i would need to create a HTTP GET request but I cannot work out how to correctly format that http request inside the ANGULAR application. Most tutorials online work with .JSON files to get/post data, not with RDF graphs.



I was hoping to do this through 'curl' and somehow start a curl-command from within angular, but i cannot even get the curl command to work inside my own console. I have followed this Guide and sifted through stackoverflow answers until i came to the following command for SPARQL UPDATE for graphDB:



curl -G -H "Accept:application/x-trig" 
-d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F3aan%3E+dc%3Atitle+%22pullnaam%22%7D+
http://localhost:7200/repositories/myrepository/statements


When i execute this command, the console returns all resources/nodes inside the graph, but doesn't actually execute the Update inside the curl command.



Any help would be greatly appreciated and I apologise in advance if I've forgotten to add something crucial. I'm testing out some more variations on the curl command and hope to edit this question soon.



Thanks in advance!



Edit: working curl command is:



curl -X POST -G -H "Accept:application/x-trig" -d
update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+
http://localhost:7200/repositories/myrepository/statements


Edit: working POST command inside typescript/angular is:



function(event)
const body = "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2Ftesteroo%3E+dc%3Atitle+%22pullnaam%22%7D+";
const headers = new HttpHeaders().set('Accept', 'application/x-trig').set('Content-Type','application/x-www-form-urlencoded');
let options = headers:HttpHeaders;
var url = "http://128.199.58.129:7200/repositories/repo/statements";
return this.http.post(url,body,headers:headers).toPromise().then(function(response) console.log(response.toString()));










share|improve this question



















  • 1





    I thought you have to use a POST request for SPARQL Update or not? See the SPARQL specs

    – AKSW
    Mar 21 at 20:53







  • 1





    If that doesn't solve the problem please add the updated CURL request to the question.

    – AKSW
    Mar 21 at 21:02

















0















I am trying to send an UPDATE (insert) to a Graphdb instance, starting from an ANGULAR web-application (typescript). Therefore i would need to create a HTTP GET request but I cannot work out how to correctly format that http request inside the ANGULAR application. Most tutorials online work with .JSON files to get/post data, not with RDF graphs.



I was hoping to do this through 'curl' and somehow start a curl-command from within angular, but i cannot even get the curl command to work inside my own console. I have followed this Guide and sifted through stackoverflow answers until i came to the following command for SPARQL UPDATE for graphDB:



curl -G -H "Accept:application/x-trig" 
-d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F3aan%3E+dc%3Atitle+%22pullnaam%22%7D+
http://localhost:7200/repositories/myrepository/statements


When i execute this command, the console returns all resources/nodes inside the graph, but doesn't actually execute the Update inside the curl command.



Any help would be greatly appreciated and I apologise in advance if I've forgotten to add something crucial. I'm testing out some more variations on the curl command and hope to edit this question soon.



Thanks in advance!



Edit: working curl command is:



curl -X POST -G -H "Accept:application/x-trig" -d
update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+
http://localhost:7200/repositories/myrepository/statements


Edit: working POST command inside typescript/angular is:



function(event)
const body = "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2Ftesteroo%3E+dc%3Atitle+%22pullnaam%22%7D+";
const headers = new HttpHeaders().set('Accept', 'application/x-trig').set('Content-Type','application/x-www-form-urlencoded');
let options = headers:HttpHeaders;
var url = "http://128.199.58.129:7200/repositories/repo/statements";
return this.http.post(url,body,headers:headers).toPromise().then(function(response) console.log(response.toString()));










share|improve this question



















  • 1





    I thought you have to use a POST request for SPARQL Update or not? See the SPARQL specs

    – AKSW
    Mar 21 at 20:53







  • 1





    If that doesn't solve the problem please add the updated CURL request to the question.

    – AKSW
    Mar 21 at 21:02













0












0








0








I am trying to send an UPDATE (insert) to a Graphdb instance, starting from an ANGULAR web-application (typescript). Therefore i would need to create a HTTP GET request but I cannot work out how to correctly format that http request inside the ANGULAR application. Most tutorials online work with .JSON files to get/post data, not with RDF graphs.



I was hoping to do this through 'curl' and somehow start a curl-command from within angular, but i cannot even get the curl command to work inside my own console. I have followed this Guide and sifted through stackoverflow answers until i came to the following command for SPARQL UPDATE for graphDB:



curl -G -H "Accept:application/x-trig" 
-d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F3aan%3E+dc%3Atitle+%22pullnaam%22%7D+
http://localhost:7200/repositories/myrepository/statements


When i execute this command, the console returns all resources/nodes inside the graph, but doesn't actually execute the Update inside the curl command.



Any help would be greatly appreciated and I apologise in advance if I've forgotten to add something crucial. I'm testing out some more variations on the curl command and hope to edit this question soon.



Thanks in advance!



Edit: working curl command is:



curl -X POST -G -H "Accept:application/x-trig" -d
update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+
http://localhost:7200/repositories/myrepository/statements


Edit: working POST command inside typescript/angular is:



function(event)
const body = "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2Ftesteroo%3E+dc%3Atitle+%22pullnaam%22%7D+";
const headers = new HttpHeaders().set('Accept', 'application/x-trig').set('Content-Type','application/x-www-form-urlencoded');
let options = headers:HttpHeaders;
var url = "http://128.199.58.129:7200/repositories/repo/statements";
return this.http.post(url,body,headers:headers).toPromise().then(function(response) console.log(response.toString()));










share|improve this question
















I am trying to send an UPDATE (insert) to a Graphdb instance, starting from an ANGULAR web-application (typescript). Therefore i would need to create a HTTP GET request but I cannot work out how to correctly format that http request inside the ANGULAR application. Most tutorials online work with .JSON files to get/post data, not with RDF graphs.



I was hoping to do this through 'curl' and somehow start a curl-command from within angular, but i cannot even get the curl command to work inside my own console. I have followed this Guide and sifted through stackoverflow answers until i came to the following command for SPARQL UPDATE for graphDB:



curl -G -H "Accept:application/x-trig" 
-d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F3aan%3E+dc%3Atitle+%22pullnaam%22%7D+
http://localhost:7200/repositories/myrepository/statements


When i execute this command, the console returns all resources/nodes inside the graph, but doesn't actually execute the Update inside the curl command.



Any help would be greatly appreciated and I apologise in advance if I've forgotten to add something crucial. I'm testing out some more variations on the curl command and hope to edit this question soon.



Thanks in advance!



Edit: working curl command is:



curl -X POST -G -H "Accept:application/x-trig" -d
update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+
http://localhost:7200/repositories/myrepository/statements


Edit: working POST command inside typescript/angular is:



function(event)
const body = "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2Ftesteroo%3E+dc%3Atitle+%22pullnaam%22%7D+";
const headers = new HttpHeaders().set('Accept', 'application/x-trig').set('Content-Type','application/x-www-form-urlencoded');
let options = headers:HttpHeaders;
var url = "http://128.199.58.129:7200/repositories/repo/statements";
return this.http.post(url,body,headers:headers).toPromise().then(function(response) console.log(response.toString()));







angular curl insert sparql graphdb






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 19:13







Andrew Malcolm

















asked Mar 21 at 19:38









Andrew MalcolmAndrew Malcolm

224




224







  • 1





    I thought you have to use a POST request for SPARQL Update or not? See the SPARQL specs

    – AKSW
    Mar 21 at 20:53







  • 1





    If that doesn't solve the problem please add the updated CURL request to the question.

    – AKSW
    Mar 21 at 21:02












  • 1





    I thought you have to use a POST request for SPARQL Update or not? See the SPARQL specs

    – AKSW
    Mar 21 at 20:53







  • 1





    If that doesn't solve the problem please add the updated CURL request to the question.

    – AKSW
    Mar 21 at 21:02







1




1





I thought you have to use a POST request for SPARQL Update or not? See the SPARQL specs

– AKSW
Mar 21 at 20:53






I thought you have to use a POST request for SPARQL Update or not? See the SPARQL specs

– AKSW
Mar 21 at 20:53





1




1





If that doesn't solve the problem please add the updated CURL request to the question.

– AKSW
Mar 21 at 21:02





If that doesn't solve the problem please add the updated CURL request to the question.

– AKSW
Mar 21 at 21:02












1 Answer
1






active

oldest

votes


















2














You're getting back statements because you are doing a GET request against the /statements resource. A SPARQL update is a POST request. You need to add -X POST to your curl request.






share|improve this answer























  • Thanks it's indeed as simple as that. I have tried using the POST command as written inside the graphDB guide, which didn't work. The working curl command is now: curl -X POST -G -H "Accept:application/x-trig" -d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+ localhost:7200/repositories/myrepository/statements Now i need to simply find a way to make such a POST command starting from angular, but i'm sure i can find that on my own. Thank you very much!

    – Andrew Malcolm
    Mar 22 at 15:51







  • 1





    @AndrewMalcolm isn't it already part of the Http class? There should be a method Http.post()

    – AKSW
    Mar 23 at 4:22












  • @AKSW yes, but i need to format that command as well. This is what i have right now, but it doesn't seem to be working: var body= "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F6aan%3E+dc%3Atitle+%22pullnaam%22%7D+"; let headers = new HttpHeaders().set('Accept', 'application/x-trig'); let options = headers:HttpHeaders; var url = "http://localhost:7200/repositories/DBtestclean/statements"; this.http.post(url,body,headers);

    – Andrew Malcolm
    Mar 23 at 8:30







  • 1





    Hm, why do you use this Accept MIME type? This is just for GET requests. Don't copy and paste things, try to understand the concept and start from scratch. Did you read the docs I referred to earlier? Check everything there, especially the request content type. It's clearly not Trig

    – AKSW
    Mar 23 at 16:32







  • 1





    @AKSW I got it to work thanks to those docs and browsing overflow, thanks again. just needed a bit longer to understand some things because i have no programming background. The 'accept :x-trig' header was necessary though, probably a GraphDB thing. (the working typescript can be found in the question)

    – Andrew Malcolm
    Mar 23 at 19:11











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55288130%2fsending-sparql-update-query-to-graphdb-from-angular%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














You're getting back statements because you are doing a GET request against the /statements resource. A SPARQL update is a POST request. You need to add -X POST to your curl request.






share|improve this answer























  • Thanks it's indeed as simple as that. I have tried using the POST command as written inside the graphDB guide, which didn't work. The working curl command is now: curl -X POST -G -H "Accept:application/x-trig" -d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+ localhost:7200/repositories/myrepository/statements Now i need to simply find a way to make such a POST command starting from angular, but i'm sure i can find that on my own. Thank you very much!

    – Andrew Malcolm
    Mar 22 at 15:51







  • 1





    @AndrewMalcolm isn't it already part of the Http class? There should be a method Http.post()

    – AKSW
    Mar 23 at 4:22












  • @AKSW yes, but i need to format that command as well. This is what i have right now, but it doesn't seem to be working: var body= "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F6aan%3E+dc%3Atitle+%22pullnaam%22%7D+"; let headers = new HttpHeaders().set('Accept', 'application/x-trig'); let options = headers:HttpHeaders; var url = "http://localhost:7200/repositories/DBtestclean/statements"; this.http.post(url,body,headers);

    – Andrew Malcolm
    Mar 23 at 8:30







  • 1





    Hm, why do you use this Accept MIME type? This is just for GET requests. Don't copy and paste things, try to understand the concept and start from scratch. Did you read the docs I referred to earlier? Check everything there, especially the request content type. It's clearly not Trig

    – AKSW
    Mar 23 at 16:32







  • 1





    @AKSW I got it to work thanks to those docs and browsing overflow, thanks again. just needed a bit longer to understand some things because i have no programming background. The 'accept :x-trig' header was necessary though, probably a GraphDB thing. (the working typescript can be found in the question)

    – Andrew Malcolm
    Mar 23 at 19:11















2














You're getting back statements because you are doing a GET request against the /statements resource. A SPARQL update is a POST request. You need to add -X POST to your curl request.






share|improve this answer























  • Thanks it's indeed as simple as that. I have tried using the POST command as written inside the graphDB guide, which didn't work. The working curl command is now: curl -X POST -G -H "Accept:application/x-trig" -d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+ localhost:7200/repositories/myrepository/statements Now i need to simply find a way to make such a POST command starting from angular, but i'm sure i can find that on my own. Thank you very much!

    – Andrew Malcolm
    Mar 22 at 15:51







  • 1





    @AndrewMalcolm isn't it already part of the Http class? There should be a method Http.post()

    – AKSW
    Mar 23 at 4:22












  • @AKSW yes, but i need to format that command as well. This is what i have right now, but it doesn't seem to be working: var body= "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F6aan%3E+dc%3Atitle+%22pullnaam%22%7D+"; let headers = new HttpHeaders().set('Accept', 'application/x-trig'); let options = headers:HttpHeaders; var url = "http://localhost:7200/repositories/DBtestclean/statements"; this.http.post(url,body,headers);

    – Andrew Malcolm
    Mar 23 at 8:30







  • 1





    Hm, why do you use this Accept MIME type? This is just for GET requests. Don't copy and paste things, try to understand the concept and start from scratch. Did you read the docs I referred to earlier? Check everything there, especially the request content type. It's clearly not Trig

    – AKSW
    Mar 23 at 16:32







  • 1





    @AKSW I got it to work thanks to those docs and browsing overflow, thanks again. just needed a bit longer to understand some things because i have no programming background. The 'accept :x-trig' header was necessary though, probably a GraphDB thing. (the working typescript can be found in the question)

    – Andrew Malcolm
    Mar 23 at 19:11













2












2








2







You're getting back statements because you are doing a GET request against the /statements resource. A SPARQL update is a POST request. You need to add -X POST to your curl request.






share|improve this answer













You're getting back statements because you are doing a GET request against the /statements resource. A SPARQL update is a POST request. You need to add -X POST to your curl request.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 22 at 2:39









Jeen BroekstraJeen Broekstra

16.6k43761




16.6k43761












  • Thanks it's indeed as simple as that. I have tried using the POST command as written inside the graphDB guide, which didn't work. The working curl command is now: curl -X POST -G -H "Accept:application/x-trig" -d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+ localhost:7200/repositories/myrepository/statements Now i need to simply find a way to make such a POST command starting from angular, but i'm sure i can find that on my own. Thank you very much!

    – Andrew Malcolm
    Mar 22 at 15:51







  • 1





    @AndrewMalcolm isn't it already part of the Http class? There should be a method Http.post()

    – AKSW
    Mar 23 at 4:22












  • @AKSW yes, but i need to format that command as well. This is what i have right now, but it doesn't seem to be working: var body= "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F6aan%3E+dc%3Atitle+%22pullnaam%22%7D+"; let headers = new HttpHeaders().set('Accept', 'application/x-trig'); let options = headers:HttpHeaders; var url = "http://localhost:7200/repositories/DBtestclean/statements"; this.http.post(url,body,headers);

    – Andrew Malcolm
    Mar 23 at 8:30







  • 1





    Hm, why do you use this Accept MIME type? This is just for GET requests. Don't copy and paste things, try to understand the concept and start from scratch. Did you read the docs I referred to earlier? Check everything there, especially the request content type. It's clearly not Trig

    – AKSW
    Mar 23 at 16:32







  • 1





    @AKSW I got it to work thanks to those docs and browsing overflow, thanks again. just needed a bit longer to understand some things because i have no programming background. The 'accept :x-trig' header was necessary though, probably a GraphDB thing. (the working typescript can be found in the question)

    – Andrew Malcolm
    Mar 23 at 19:11

















  • Thanks it's indeed as simple as that. I have tried using the POST command as written inside the graphDB guide, which didn't work. The working curl command is now: curl -X POST -G -H "Accept:application/x-trig" -d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+ localhost:7200/repositories/myrepository/statements Now i need to simply find a way to make such a POST command starting from angular, but i'm sure i can find that on my own. Thank you very much!

    – Andrew Malcolm
    Mar 22 at 15:51







  • 1





    @AndrewMalcolm isn't it already part of the Http class? There should be a method Http.post()

    – AKSW
    Mar 23 at 4:22












  • @AKSW yes, but i need to format that command as well. This is what i have right now, but it doesn't seem to be working: var body= "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F6aan%3E+dc%3Atitle+%22pullnaam%22%7D+"; let headers = new HttpHeaders().set('Accept', 'application/x-trig'); let options = headers:HttpHeaders; var url = "http://localhost:7200/repositories/DBtestclean/statements"; this.http.post(url,body,headers);

    – Andrew Malcolm
    Mar 23 at 8:30







  • 1





    Hm, why do you use this Accept MIME type? This is just for GET requests. Don't copy and paste things, try to understand the concept and start from scratch. Did you read the docs I referred to earlier? Check everything there, especially the request content type. It's clearly not Trig

    – AKSW
    Mar 23 at 16:32







  • 1





    @AKSW I got it to work thanks to those docs and browsing overflow, thanks again. just needed a bit longer to understand some things because i have no programming background. The 'accept :x-trig' header was necessary though, probably a GraphDB thing. (the working typescript can be found in the question)

    – Andrew Malcolm
    Mar 23 at 19:11
















Thanks it's indeed as simple as that. I have tried using the POST command as written inside the graphDB guide, which didn't work. The working curl command is now: curl -X POST -G -H "Accept:application/x-trig" -d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+ localhost:7200/repositories/myrepository/statements Now i need to simply find a way to make such a POST command starting from angular, but i'm sure i can find that on my own. Thank you very much!

– Andrew Malcolm
Mar 22 at 15:51






Thanks it's indeed as simple as that. I have tried using the POST command as written inside the graphDB guide, which didn't work. The working curl command is now: curl -X POST -G -H "Accept:application/x-trig" -d update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F4aan%3E+dc%3Atitle+%22pullnaam%22%7D+ localhost:7200/repositories/myrepository/statements Now i need to simply find a way to make such a POST command starting from angular, but i'm sure i can find that on my own. Thank you very much!

– Andrew Malcolm
Mar 22 at 15:51





1




1





@AndrewMalcolm isn't it already part of the Http class? There should be a method Http.post()

– AKSW
Mar 23 at 4:22






@AndrewMalcolm isn't it already part of the Http class? There should be a method Http.post()

– AKSW
Mar 23 at 4:22














@AKSW yes, but i need to format that command as well. This is what i have right now, but it doesn't seem to be working: var body= "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F6aan%3E+dc%3Atitle+%22pullnaam%22%7D+"; let headers = new HttpHeaders().set('Accept', 'application/x-trig'); let options = headers:HttpHeaders; var url = "http://localhost:7200/repositories/DBtestclean/statements"; this.http.post(url,body,headers);

– Andrew Malcolm
Mar 23 at 8:30






@AKSW yes, but i need to format that command as well. This is what i have right now, but it doesn't seem to be working: var body= "update=INSERT+DATA+%7B%3Chttp%3A%2F%2Fexample%2F6aan%3E+dc%3Atitle+%22pullnaam%22%7D+"; let headers = new HttpHeaders().set('Accept', 'application/x-trig'); let options = headers:HttpHeaders; var url = "http://localhost:7200/repositories/DBtestclean/statements"; this.http.post(url,body,headers);

– Andrew Malcolm
Mar 23 at 8:30





1




1





Hm, why do you use this Accept MIME type? This is just for GET requests. Don't copy and paste things, try to understand the concept and start from scratch. Did you read the docs I referred to earlier? Check everything there, especially the request content type. It's clearly not Trig

– AKSW
Mar 23 at 16:32






Hm, why do you use this Accept MIME type? This is just for GET requests. Don't copy and paste things, try to understand the concept and start from scratch. Did you read the docs I referred to earlier? Check everything there, especially the request content type. It's clearly not Trig

– AKSW
Mar 23 at 16:32





1




1





@AKSW I got it to work thanks to those docs and browsing overflow, thanks again. just needed a bit longer to understand some things because i have no programming background. The 'accept :x-trig' header was necessary though, probably a GraphDB thing. (the working typescript can be found in the question)

– Andrew Malcolm
Mar 23 at 19:11





@AKSW I got it to work thanks to those docs and browsing overflow, thanks again. just needed a bit longer to understand some things because i have no programming background. The 'accept :x-trig' header was necessary though, probably a GraphDB thing. (the working typescript can be found in the question)

– Andrew Malcolm
Mar 23 at 19:11



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55288130%2fsending-sparql-update-query-to-graphdb-from-angular%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript