This HTML5 document contains 43 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
dctermshttp://purl.org/dc/terms/
atomhttp://atomowl.org/ontologies/atomrdf#
foafhttp://xmlns.com/foaf/0.1/
n21http://host:port/mydemo:
n15http://vos.openlinksw.com/dataspace/services/wiki/
n11http://vos.openlinksw.com/wiki/main/VOS/VirtTipsAndTricksDigestAuthAJAX/dauth8.
oplhttp://www.openlinksw.com/schema/attribution#
n24http://host:port/
n2http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/
n9http://vos.openlinksw.com/wiki/main/VOS/VirtTipsAndTricksDigestAuthAJAX/dauth7.
n12http://docs.openlinksw.com/virtuoso/rdfsparql.
dchttp://purl.org/dc/elements/1.1/
n19http://vos.openlinksw.com/dataspace/dav#
n26http://vos.openlinksw.com/wiki/main/VOS/VirtTipsAndTricksDigestAuthAJAX/dauth6.
rdfshttp://www.w3.org/2000/01/rdf-schema#
n16http://rdfs.org/sioc/services#
siocthttp://rdfs.org/sioc/types#
n7http://vos.openlinksw.com/dataspace/person/dav#
n25http://vos.openlinksw.com/wiki/main/VOS/VirtTipsAndTricksDigestAuthAJAX/dauth5.
n4http://vos.openlinksw.com/dataspace/owiki/wiki/
n28http://vos.openlinksw.com/wiki/main/VOS/VirtTipsAndTricksDigestAuthAJAX/dauth4.
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n27http://vos.openlinksw.com/wiki/main/VOS/VirtTipsAndTricksDigestAuthAJAX/dauth3.
n17http://vos.openlinksw.com/dataspace/owiki#
n14http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/VirtTipsAndTricksDigestAuthAJAX/sioc.
n30http://vos.openlinksw.com/wiki/main/VOS/VirtTipsAndTricksDigestAuthAJAX/dauth2.
xsdhhttp://www.w3.org/2001/XMLSchema#
n29http://vos.openlinksw.com/wiki/main/VOS/VirtTipsAndTricksDigestAuthAJAX/dauth1.
n6http://vos.openlinksw.com/wiki/main/VOS/VirtTipsAndTricksDigestAuthAJAX/demo.
n20http://vos.openlinksw.com/dataspace/person/owiki#
siochttp://rdfs.org/sioc/ns#
Subject Item
n7:this
foaf:made
n2:VirtTipsAndTricksDigestAuthAJAX
Subject Item
n19:this
sioc:creator_of
n2:VirtTipsAndTricksDigestAuthAJAX
Subject Item
n15:item
n16:services_of
n2:VirtTipsAndTricksDigestAuthAJAX
Subject Item
n17:this
sioc:creator_of
n2:VirtTipsAndTricksDigestAuthAJAX
Subject Item
n4:VOS
sioc:container_of
n2:VirtTipsAndTricksDigestAuthAJAX
atom:entry
n2:VirtTipsAndTricksDigestAuthAJAX
atom:contains
n2:VirtTipsAndTricksDigestAuthAJAX
Subject Item
n2:VirtTipsAndTricksDigestAuthAJAX
rdf:type
sioct:Comment atom:Entry
dcterms:created
2017-06-13T05:48:57.232478
dcterms:modified
2017-06-29T07:41:30.185352
rdfs:label
VirtTipsAndTricksDigestAuthAJAX
foaf:maker
n7:this n20:this
dc:title
VirtTipsAndTricksDigestAuthAJAX
opl:isDescribedUsing
n14:rdf
sioc:has_creator
n19:this n17:this
sioc:attachment
n6:html n9:png n11:png n25:png n26:png n27:png n28:png n29:png n30:png
sioc:content
%META:TOPICPARENT{name="VirtTipsAndTricksGuide"}% ---+Using Digest Authentication to Insert Triples ---++What Insert triples using Digest Authentication against the Virtuoso /sparql-auth endpoint. ---++Why To simplify data management by using HTTP digest authentication. ---++How Here is a sample example showcasing how to insert triples in Virtuoso Quad store using Digest Authentication in a simple HTML 5 form with embedded AJAX: ---+++Example This example demonstrates how Virtuoso user can insert triples into the Virtuoso Quad Store using Digest authentication against the Virtuoso "/sparql-auth" endpoint. The implementation is done on the base of simple html form using HTML 5 and AJAX: <verbatim> <html lang="en"> ... <script type="text/javascript"> function authenticate() { vgraphuri = document.demo.graphuri.value ; vsubject = document.demo.subject.value ; vpredicate = document.demo.predicate.value ; vobject = document.demo.object.value ; vuser = document.demo.username.value ; vpassword = document.demo.userpassword.value ; var q = "INSERT INTO GRAPH " + vgraphuri + " { " + vsubject + " " + vpredicate + " " + vobject + " . } " ; var xhr = new XMLHttpRequest(); xhr.onreadystatechange=function() { if (xhr.readyState==4 && xhr.status==200) { alert(xhr.responseText); } if (xhr.readyState==4 && xhr.status==401) { alert("Error: Invalid credentials or insufficient rights to perform the operation."); } if (xhr.readyState==4 && xhr.status==500) { alert(xhr.responseText); } if (xhr.readyState==4 && xhr.status==400) { alert(xhr.responseText); } } xhr.open("POST", "/sparql-auth/", false, vuser, vpassword); xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); xhr.send("query=" + encodeURIComponent (q)); }; </script> ... </verbatim> <b>Steps</b>: 1 To be able to perform updates to the Quad Store, a Virtuoso user account should have specific settings done: 1 Go to http://host:port/conductor %BR%%BR%<a href="%ATTACHURLPATH%/dauth1.png" target="_blank"><img src="%ATTACHURLPATH%/dauth1.png" width="600px" /></a>%BR%%BR% 1 Enter admin credentials 1 Go to "System Admin" -> "Users" %BR%%BR%<a href="%ATTACHURLPATH%/dauth2.png" target="_blank"><img src="%ATTACHURLPATH%/dauth2.png" width="600px" /></a>%BR%%BR% 1 Click "Create New Account". Optionally, you can apply the settings to existing user too. 1 In the presented form: * enter "Account name", for ex. demo * enter "Password", * change "User type" to "SQL/ODBC and WebDAV", * for "DAV Home Path" hatch the "create" check-box, * change "Quata" to 5, * Select from "Account Roles" the role "SPARQL_UPDATE" and move to "Selected" list %BR%%BR%<a href="%ATTACHURLPATH%/dauth3.png" target="_blank"><img src="%ATTACHURLPATH%/dauth3.png" width="600px" /></a>%BR%%BR% 1 Click "Save" 1 The new user "demo" should be created and displayed in the users list: %BR%%BR%<a href="%ATTACHURLPATH%/dauth4.png" target="_blank"><img src="%ATTACHURLPATH%/dauth4.png" width="600px" /></a>%BR%%BR% 1 Now when we have an user that can update the Quad Store data, we will demonstrate how this user will insert a triple. Place the following <a href="%ATTACHURLPATH%/demo.html" style="wikiautogen">demo.html</a> file at your server, so for ex. it to be accessible from http://host:port/mydemo: %BR%%BR%<a href="%ATTACHURLPATH%/dauth5.png" target="_blank"><img src="%ATTACHURLPATH%/dauth5.png" width="600px" /></a>%BR%%BR% 1 The presented form offers 4 fields -- one for graph URI, respectively one for subject, object and predicate values. Each of these fields has predefined values that can be changed to other preferable. Enter for the created user from above its credentials and click "Insert". 1 On a successful insert, a message as below will be presented: %BR%%BR%<a href="%ATTACHURLPATH%/dauth6.png" target="_blank"><img src="%ATTACHURLPATH%/dauth6.png" width="600px" /></a>%BR%%BR% 1 In case some of the fields graphuri, subject, object or predicate are invalid, an error handler message will be presented: %BR%%BR%<a href="%ATTACHURLPATH%/dauth7.png" target="_blank"><img src="%ATTACHURLPATH%/dauth7.png" width="600px" /></a>%BR%%BR% 1 In case the user has provided wrong credentials or has no rights to update the Quad Store, a message as per bellow will be presented: %BR%%BR%<a href="%ATTACHURLPATH%/dauth8.png" target="_blank"><img src="%ATTACHURLPATH%/dauth8.png" width="600px" /></a>%BR%%BR% ---++Related * [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]] * [[VOSSparqlProtocol][Virtuoso SPARQL Query Service]] * [[http://docs.openlinksw.com/virtuoso/rdfsparql.html][Virtuoso Documentation]]
sioc:id
dbbab55ddff48b6cd4d474be5bfa249d
sioc:link
n2:VirtTipsAndTricksDigestAuthAJAX
sioc:has_container
n4:VOS
n16:has_services
n15:item
atom:title
VirtTipsAndTricksDigestAuthAJAX
sioc:links_to
n12:html n21: n2:WebDAV n24:conductor n2:VOSSparqlProtocol
atom:source
n4:VOS
atom:author
n7:this
atom:published
2017-06-13T05:48:57Z
atom:updated
2017-06-29T07:41:30Z
sioc:topic
n4:VOS