Connecting directly to virtuoso

Virtuoso ships with an executable called isql-vt. Just running that executable should connect you to virtuoso.

If you distribution does not provide the corresponding executable or if it doesn't work for you. Try this script -

filename=`ps aux | grep virtuoso-t | grep -v grep | sed -e 's/.*\/tmp\///;s/ini.*/ini/'`
port=$(grep ServerPort /tmp/$filename | sed -e 's/.*=//')
exec isql-vt -S $port

Running queries directly

If for some reason you want to run queries directly on virtuoso, you'll need to connect to virtuoso via isql-vt and then type in the query. Make sure the query has the required prefixes and starts with the keyword sparql if it is a sparql query.

I've attached a list of common prefixes for convenience -

prefix nao:     <> .
prefix nfo:     <> .
prefix nie:     <> .
prefix ncal:    <> .
prefix nco:     <> .
prefix rdfs:    <> .
prefix pimo:    <> .
prefix nmo:     <> .
prefix nmm:     <> .
prefix nrl:     <> .
prefix rdf:     <> .
prefix xsd:     <> .


$ sparql prefix nco: <> . select ?r ?name where { ?r nco:fullname ?name . };

List of tables

is a relational database and what not

All the tables in Virtuoso start with the DB.DBA. prefix.

  • RDF_QUAD -- The main table which contains all the statements. It contains four rows "S", "P", "O" and "G" for the subject, predicate, object and graph.

Default Indexes

Common Commands

Apart from directly running SQL and SPARQL queries, virtuoso also provides some additional commands, which are listed over here.



The sparql_to_sql_text() function can be used to convert a SPARQL query directly to the SQL it would be executed as.

varchar sparql_to_sql_text
( in squery varchar );

It's very useful in debugging why many sparql queries are taking so long.

This page was last edited on 9 February 2018, at 12:32. Content is available under Creative Commons License SA 4.0 unless otherwise noted.