CINXE.COM
OpenLink Virtuoso SPARQL Query Editor
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <meta name="Copyright" content="Copyright © 2024 OpenLink Software" /> <meta name="Keywords" content="OpenLink Virtuoso Sparql" /> <title>OpenLink Virtuoso SPARQL Query Editor</title> <link rel="icon" href="/favicon.ico?v=1" sizes="any" /> <link rel="icon" href="/favicon/favicon.svg?v=1" type="image/svg+xml" /> <link rel="apple-touch-icon" href="/favicon/apple-touch-icon-180x180.png?v=1" /> <link rel="manifest" href="/favicon/manifest.webmanifest?v=1" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css" integrity="sha512-SbiR/eusphKoMVVXysTKG/7VseWii+Y3FdHrt0EpKgpToZeemhqHeZeLWLhJutz/2ut2Vw1uQEj2MbRF+TVBUA==" crossorigin="anonymous" /> </head> <body onload="sparql_endpoint_init()"> <div class="container-lg"> <nav class="navbar navbar-expand-md sticky-top bg-light"> <div class="container-lg"> <a class="navbar-brand" href="/sparql">SPARQL Query Editor</a> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav me-auto"> <li class="nav-item"><a class="nav-link" href="/sparql/?help=intro">About</a></li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Tables</a> <ul class="dropdown-menu" aria-labelledby="navbarDropdown"> <li><a class="dropdown-item" href="/sparql/?help=nsdecl">Namespace Prefixes</a></li> <li><a class="dropdown-item" href="/sparql/?help=rdfinf">Inference Rules</a></li> <li><a class="dropdown-item" href="/sparql/?help=macrolibs">Macros</a></li> <li><a class="dropdown-item" href="/sparql/?help=views">RDF Views</a></li> </ul> </li> </ul> <ul class="navbar-nav ms-auto"> <li class="nav-item"><a class="nav-item nav-link" href="/conductor">Conductor</a></li> <li class="nav-item"><a class="nav-item nav-link" href="/fct">Facet Browser</a></li> <li class="nav-item"> <a class="nav-item nav-link" onclick="javascript:sparqlCopyPermalinkToClipboard()" href="#" title="Copy Permalink to Clipboard">Permalink</a> </li> </ul> </div> </div> </nav> <div id="alert"></div><div class="d-flex justify-content-end"> <span class="badge text-dark">Extensions:</span>  <a href="/sparql/?help=enable_cxml" class="badge rounded-pill bg-light text-secondary text-decoration-none" role="button">cxml</a>  <a href="/sparql/?help=enable_det" class="badge rounded-pill bg-light text-secondary text-decoration-none" role="button">save to dav</a>  <a href="/sparql/?help=enable_sponge" class="badge rounded-pill bg-light text-secondary text-decoration-none" role="button">sponge</a>  <span class="badge bg-light text-dark"> User: <b>SPARQL</b></span> </div> <main id="main"> <form id="sparql_form" method="get" onreset="javascript:format_select(this.elements.query)"> <fieldset class=""> <div class="mb-3"> <label for="default-graph-uri">Default Data Set Name (Graph IRI)</label> <input class="form-control form-control-sm" type="url" name="default-graph-uri" id="default-graph-uri" value="http://dbpedia.org"/> </div> <div class="mb-3"> <label for="query">Query Text</label> <textarea class="form-control" rows="10" name="query" id="query" onchange="javascript:do_format_select(this)" onkeyup="javascript:format_select(this)"> select distinct ?Concept where {[] a ?Concept} LIMIT 100 </textarea> </div> <div class="mb-3 row"> <label class="col-lg-2 col-form-label" for="format">Results Format</label> <div class="col-lg-10"> <select class="form-select form-select-sm" name="format" id="format" onchange="javascript:format_change(this)"> <option value="auto" >Auto</option> <option value="text/html" selected="selected">HTML</option> <option value="text/x-html+tr" >HTML (Faceted Browsing Links)</option> <option value="application/vnd.ms-excel" >Spreadsheet</option> <option value="application/sparql-results+xml" >XML</option> <option value="application/sparql-results+json" >JSON</option> <option value="application/javascript" >Javascript</option> <option value="text/turtle" >Turtle</option> <option value="application/rdf+xml" >RDF/XML</option> <option value="text/plain" >N-Triples</option> <option value="text/csv" >CSV</option> <option value="text/tab-separated-values" >TSV</option> </select> </div> </div> <div> <input class="btn btn-primary" type="submit" onclick="javascript:sparqlSubmitForm()" id="run" value="Execute Query"/> <input class="btn btn-light" type="reset" value="Reset" id="reset"/> </div> </fieldset> <hr /> <fieldset class="" id="options"> <div class="input-group mb-3 row"> <label for="timeout" class="col-lg-2 col-form-label">Execution timeout</label> <div class="col-lg-10"> <div class="input-group input-group-sm"> <input class="form-control" name="timeout" id="timeout" type="number" value="30000" min="0" max="120000" /> <span class="input-group-text">milliseconds</span> </div> </div> </div> <div class="input-group mb-3 row"> <div class="col-form-label col-lg-2 pt-0">Options</div> <div class="col-lg-10"> <div class="form-check"> <input class="form-check-input" name="signal_void" id="signal_void" type="checkbox" checked="checked" /> <label for="signal_void" class="form-check-label">Strict checking of void variables</label> </div> <div class="form-check"> <input class="form-check-input" name="signal_unconnected" id="signal_unconnected" type="checkbox" checked="checked" /> <label for="signal_unconnected" class="form-check-label">Strict checking of variable names used in multiple clauses but not logically connected to each other</label> </div> <div class="form-check"> <input class="form-check-input" name="quiet_geo" id="quiet_geo" type="checkbox" /> <label for="quiet_geo" class="form-check-label">Suppress errors on wrong geometries and errors on geometrical operators (failed operations will return NULL)</label> </div> <div class="form-check"> <input class="form-check-input" name="log_debug_info" id="log_debug_info" type="checkbox" /> <label for="log_debug_info" class="form-check-label">Log debug info at the end of output (has no effect on some queries and output formats)</label> </div> <div class="form-check"> <input class="form-check-input" name="explain" id="explain" onclick="javascript:change_run_button(this)" type="checkbox" /> <label for="explain" class="form-check-label">Generate SPARQL compilation report (instead of executing the query)</label> </div> </div> </div> </fieldset> </form> </main> <div style="display:none"> <div class="description" about="#service" typeof="sd:Service"> <div rel="sd:endpoint" resource="https://dbpedia.org/sparql"></div> <div rel="sd:feature" resource="http://www.w3.org/ns/sparql-service-description#UnionDefaultGraph"></div> <div rel="sd:feature" resource="http://www.w3.org/ns/sparql-service-description#DereferencesURIs"></div> <div rel="sd:resultFormat" resource="http://www.w3.org/ns/formats/RDF_XML"></div> <div rel="sd:resultFormat" resource="http://www.w3.org/ns/formats/Turtle"></div> <div rel="sd:resultFormat" resource="http://www.w3.org/ns/formats/SPARQL_Results_CSV"></div> <div rel="sd:resultFormat" resource="http://www.w3.org/ns/formats/N-Triples"></div> <div rel="sd:resultFormat" resource="http://www.w3.org/ns/formats/N3"></div> <div rel="sd:resultFormat" resource="http://www.w3.org/ns/formats/SPARQL_Results_JSON"></div> <div rel="sd:resultFormat" resource="http://www.w3.org/ns/formats/RDFa"></div> <div rel="sd:resultFormat" resource="http://www.w3.org/ns/formats/SPARQL_Results_XML"></div> <div rel="sd:supportedLanguage" resource="http://www.w3.org/ns/sparql-service-description#SPARQL10Query"></div> <div rel="sd:url" resource="https://dbpedia.org/sparql"></div> </div> </div> <footer id="footer" class="small text-muted"> <div class="text-center"> Copyright © 2024 <a href="https://www.openlinksw.com/">OpenLink Software</a> <br/> <a href="https://virtuoso.openlinksw.com/">Virtuoso</a> version 08.03.3331 (9e66fac92f) on Linux (x86_64-generic-linux-glibc212) Single Server Edition (61 GB total memory, 39 GB memory in use) </div> </footer> <div id="sparql-scripts"> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/js/bootstrap.bundle.min.js" integrity="sha512-i9cEfJwUwViEPFKdC1enz4ZRGBj8YQo6QByFTF92YXHi7waCqyexvRD75S5NVTsSiTv7rKWqG9Y5eFxmRsOn0A==" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.slim.min.js" integrity="sha512-yBpuflZmP5lwMzZ03hiCLzA94N0K2vgBtJgqQ2E1meJzmIBfjbb7k4Y23k2i2c/rIeSUGc7jojyIY5waK3ZxCQ==" crossorigin="anonymous"></script> <script> /*<![CDATA[*/ var timer = 0; var curr_format = 0; var can_cxml = 0; var can_qrcode = 1; var can_fct = 1; var max_url = 0; var using_IE = /edge|msie\s|trident\//i.test(window.navigator.userAgent || ''); if (using_IE && (max_url == 0 || max_url > 2000)) { max_url = 2000; } function format_select (query_obg) { clearTimeout (timer); timer = setTimeout (function delay_format_select () { do_format_select (query_obg); }, 1000); } function do_format_select (query_obg) { var query = query_obg.value; var format = query_obg.form.format; var prev_value = 0; var prev_format = curr_format; var ctr = 0; var query_is_construct = (query.match(/\bconstruct\b\s/i) || query.match(/\bdescribe\b\s/i)); if (format.selectedIndex >= 0) prev_value = format.options[format.selectedIndex].value; if (query_is_construct && curr_format != 2) { for (ctr = format.options.length - 1; ctr >= 0; ctr = ctr - 1) format.remove(ctr); ctr = 0; format.options[ctr++] = new Option('Turtle', 'text/turtle'); format.options[ctr++] = new Option('Turtle (beautified)', 'application/x-nice-turtle'); format.options[ctr++] = new Option('RDF/JSON', 'application/rdf+json'); format.options[ctr++] = new Option('RDF/XML', 'application/rdf+xml'); format.options[ctr++] = new Option('N-Triples', 'text/plain'); format.options[ctr++] = new Option('XHTML+RDFa', 'application/xhtml+xml'); format.options[ctr++] = new Option('ATOM+XML', 'application/atom+xml'); format.options[ctr++] = new Option('ODATA/JSON', 'application/odata+json'); format.options[ctr++] = new Option('JSON-LD (plain)', 'application/x-ld+json'); format.options[ctr++] = new Option('JSON-LD (with context)', 'application/ld+json'); format.options[ctr++] = new Option('HTML (list)', 'text/x-html+ul'); format.options[ctr++] = new Option('HTML (table)', 'text/x-html+tr'); format.options[ctr++] = new Option('HTML+Microdata (basic)', 'text/html'); format.options[ctr++] = new Option('HTML+Microdata (table)', 'application/x-nice-microdata'); format.options[ctr++] = new Option('HTML+JSON-LD (basic)', 'text/x-html-script-ld+json'); format.options[ctr++] = new Option('HTML+Turtle (basic)', 'text/x-html-script-turtle'); format.options[ctr++] = new Option('Turtle (beautified - browsing oriented)', 'text/x-html-nice-turtle'); format.options[ctr++] = new Option('Microdata/JSON', 'application/microdata+json'); format.options[ctr++] = new Option('CSV', 'text/csv'); format.options[ctr++] = new Option('TSV', 'text/tab-separated-values'); format.options[ctr++] = new Option('TriG', 'application/x-trig'); curr_format = 2; } if (!query_is_construct && curr_format != 1) { for (ctr = format.options.length - 1; ctr >= 0; ctr = ctr - 1) format.remove(ctr); ctr = 0; format.options[ctr++] = new Option('Auto', 'auto'); format.options[ctr++] = new Option('HTML', 'text/html'); if (can_fct) format.options[ctr++] = new Option('HTML (Faceted Browsing Links)','text/x-html+tr'); else format.options[ctr++] = new Option('HTML (Basic Browsing Links)','text/x-html+tr'); format.options[ctr++] = new Option('Spreadsheet', 'application/vnd.ms-excel'); format.options[ctr++] = new Option('XML', 'application/sparql-results+xml'); format.options[ctr++] = new Option('JSON', 'application/sparql-results+json'); format.options[ctr++] = new Option('Javascript', 'application/javascript'); format.options[ctr++] = new Option('Turtle', 'text/turtle'); format.options[ctr++] = new Option('RDF/XML', 'application/rdf+xml'); format.options[ctr++] = new Option('N-Triples', 'text/plain'); format.options[ctr++] = new Option('CSV', 'text/csv'); format.options[ctr++] = new Option('TSV', 'text/tab-separated-values'); curr_format = 1; } if (prev_format != curr_format) { if (can_cxml) { format.options[ctr++] = new Option('CXML (Pivot Collection)', 'text/cxml'); if (can_qrcode) format.options[ctr++] = new Option('CXML (Pivot Collection with QRcodes)', 'text/cxml+qrcode'); } for (ctr = format.options.length - 1, format.selectedIndex = 0; ctr >= 0; ctr = ctr - 1) if (format.options[ctr].value == prev_value) format.selectedIndex = ctr; } } function format_change (e) { var format = e.value; var cxml = document.getElementById ("cxml"); var cxml_subj = document.getElementById ("CXML_redir_for_subjs"); var cxml_href = document.getElementById ("CXML_redir_for_hrefs"); if (!cxml) return; if ((format.match (/\bCXML\b/i))) { if (cxml_subj) cxml_subj.removeAttribute ("disabled"); if (cxml_href) cxml_href.removeAttribute ("disabled"); cxml.style.display = "block"; } else { if (cxml_subj) cxml_subj.setAttribute ("disabled", "disabled"); if (cxml_href) cxml_href.setAttribute ("disabled", "disabled"); cxml.style.display = "none"; } } function savedav_change (e) { var savefs = document.getElementById ("savefs"); if (!savefs) return; if (e.checked) { savefs.style.display = "block"; } else { savefs.style.display = "none"; } } function change_run_button (e) { var button = document.getElementById ("run"); var lbl; if (!button) return; if (e.checked) { lbl = " Explain Query "; } else { lbl = " Execute Query "; } if (button) { if (button.childNodes[0]) { button.childNodes[0].nodeValue = lbl; } else if (button.value) { button.value = lbl; } else { //if (button.innerHTML) button.innerHTML = lbl; } } } function sparqlGenerateLink (edit) { var link; var first = true; if (typeof location.origin === "undefined") location.origin = location.protocol + "//" + location.host; link = location.origin + location.pathname; $("form input[type!=checkbox],input[type=checkbox]:checked,select,textarea").each (function () { if (this.name.length > 0 && this.name != "sid" && !this.disabled) { var name = this.name; if (edit === 1 && name == "query") name = "qtxt"; if (first) link += "?"; else link += "&" link += (name + "=" + encodeURIComponent (this.value)); first = false; } }); return link; } function sparqlCopyPermalinkToClipboard () { var link = sparqlGenerateLink(1); var el = document.createElement ('textarea'); el.value = link; el.setAttribute ('readonly', ''); el.style = { position: 'absolute', left: '-9999px' }; document.body.appendChild (el); el.select (); document.execCommand ('copy'); document.body.removeChild (el); sparqlShowAlert ({ message: 'Copied permalink to clipboard', class: 'success', timeout: 5000 }); return link; } function sparqlSubmitForm () { var link = sparqlGenerateLink(1); if (link.length > 14000 || (max_url > 0 && max_url < link.length)) { $('#sparql_form').attr('method', 'post'); } document.forms['sparql_form'].submit(); } function sparqlSubmitFormWithCtrlEnter () { $('form').keydown (function (event) { if (event.ctrlKey && event.keyCode === 13) { sparqlSubmitForm(); } }) } function sparqlAlertTimeout (wait) { setTimeout (function () { $('#alert').children ('.alert:first-child').remove (); }, wait); } function sparqlShowAlert (obj) { var html = '<div class="alert alert-' + obj.class + ' alert-dismissible" role="alert">' + '<div><strong>' + obj.message + '</strong></div>' + '<button class="btn-close" type="button" data-bs-dismiss="alert" aria-label="Close"></button>' + '</div>'; $('#alert').append (html); if (obj.timeout > 0) sparqlAlertTimeout (obj.timeout); } function sparql_endpoint_init () { var format = document.getElementById ("format"); if (format) format_change (format); var savefs = document.getElementById ("savefs"); if (savefs) { var save = document.getElementById ("save"); if (save) savedav_change (save); } var b = document.getElementById ("explain"); if (b) change_run_button (b); var q = document.getElementById ("query"); if (q) do_format_select (q); sparqlSubmitFormWithCtrlEnter (); } /*]]>*/ </script> </div> </div></body> </html>