Post form to remote Rdf endpoint

5 views
Skip to first unread message

scenar...@gmail.com

unread,
Jun 12, 2016, 5:58:20 AM6/12/16
to Polymer
Hi,
I'm new to Polymer, and want to build a form element that could post a request to a Rdf / Fuseki endpoint : http://rdf-smag0.rhcloud.com .

First, I just need a form with one input field : name .

The method must be "post".

The remote url where to post data is :
var endpoint = "http://rdf-smag0.rhcloud.com/ds/update";

and the data to post is something like :

var update = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n";
update += "PREFIX rbb: <http://smag0.blogspot.fr/NS/RobotBase#> \n";
update += " INSERT DATA {";
update += " GRAPH <http://example/bookStore> { ";
update += " rbb:"+name+" rdf:type rbb:Robot .";


scenar...@gmail.com

unread,
Jun 12, 2016, 6:13:12 AM6/12/16
to Polymer
Oups i forgotten then end of the update var :

update += " } } ";

to manually check the result you can go to use the query

select * where {
?s
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://smag0.blogspot.fr/NS/RobotBase#Robot> }

or ditectly go to http://rdf-smag0.rhcloud.com/ds/query?query=select+*+where+%7B+%0D%0A%3Fs%0D%0A+<http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23type>++<http%3A%2F%2Fsmag0.blogspot.fr%2FNS%2FRobotBase%23Robot>+%7D&output=xml&stylesheet=%2Fxml-to-html.xsl

or to the complete proto https://freesmag.firebaseapp.com


Does anyone have an idea to build this 'simple' element ?

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages