Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
Konrad Abicht edited this page Feb 22, 2015 · 11 revisions

Saft.store.http

Setup Virtuoso as SPARQL endpoint for HTTP requests

Setup

1. Virtuoso 6.1.8+

Only Virtuoso 6.1.8 and higher supports SPARQL UPDATE queries via HTTP. Have no Ubuntu package? Have a look here

2. User account for WebDAV

Create a new user via Conductor with the following configuration:

  • Set username and password (remember it and set it in the config.ini of the test environment!)
  • Check by User Enabled
  • User Type: SQL/ODBC and WebDAV
  • Primary Role: SPARQL_SELECT
  • Account Roles Selected: SPARQL_SELECT

This user will be used for Digest Authentication.

3. Role adaption for SPARQL user

Edit the existing SPARQL user and add SPARQL_UPDATE under Account Roles Selected.

Getting Datatype and language information about the object in triple (restrictions for usage)

Datatype

If you send a query via HTTP such as

select ?s ?p ?o (DATATYPE(?o)) as ?otype (LANG(?o)) as ?olang WHERE {<". $resourceUri ."> ?p ?o.}

to add datatype and language information, with Virtuoso 6.1.8, you will run into the following error:

"Virtuoso 22023 Error SR544: Function __xsd_type() can not find XML Schema datatype that matches SQL datatype UNAME (217)

It seems they fixed that bug for Virtuoso 7.1+. For more information look into this issue.

Language

Basically, if you just send a query to Virtuoso you will only receive values for your variables. But in case you need further language information, you can add (LANG(?o)) as ?olang to the prologue part of your query.

HTTP store adapter is doing this (uses ?saftLang) to emulate the feature of language information, which you can see for instance in the Virtuoso store adapter. But, it really depends on the endpoint and its feature set whether it supports LANG-function in SPARQL queries or not.

Troubleshooting

  • If you get Virtuoso 42000 Error SR186: No permission to execute procedure DB.DBA.SPARUL_DROP with user ID 106, group ID 106 you probably missed 3. Role adaption for SPARQL user, didn't you?

  • If you get HTTP status code 406 in a response, try using GET instead of POST. Furthermore, check value of Accept header, maybe it could not be understand by the Virtuoso server.

Clone this wiki locally