CINXE.COM
OpenLink Virtuoso SPARQL Query Editor
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> <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="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css" integrity="sha512-P5MgMn1jBN01asBgU0z60Qk4QxiXo86+wlFahKrsQf37c9cro517WzVSPPV1tDKzhku2iJ2FVgL67wG03SGnNA==" crossorigin="anonymous" /> </head> <body onload="sparql_endpoint_init()"> <div class="container"> SPARQL Query Editor <div id="alert"></div> <div class="d-flex justify-content-end small"> <span class="badge">Extensions:</span> <a href="/sparql/?help=enable_cxml" class="badge badge-pill badge-light">cxml</a> <a href="/sparql/?help=enable_det" class="badge badge-pill badge-light">save to dav</a> <a href="/sparql/?help=enable_sponge" class="badge badge-pill badge-light">sponge</a> <span class="badge"> User: <b>SPARQL</b></span> </div> <main id="main"> <form id="sparql_form" action="/sparql" method="get"> <fieldset class=""> <div class="form-group"> <label for="default-graph-uri">Default Data Set Name (Graph IRI)</label> <br /> <input class="form-control form-control-sm" type="url" name="default-graph-uri" id="default-graph-uri" value="" /> </div> <div class="form-group"> <label for="query">Query Text</label> <br /> <textarea class="form-control" rows="10" name="query" id="query" onchange="javascript:format_select(this)" onkeyup="javascript:format_select(this)">select distinct ?Concept where {[] a ?Concept} LIMIT 100</textarea> </div> <div class="form-group row"> <label class="col-lg-2 col-form-label" for="format">Results Format</label> <div class="col-lg-10"> <select class="form-control form-control-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 (Basic 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" 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="form-group 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="0" /> <div class="input-group-append"> <span class="input-group-text">milliseconds</span> </div> </div> </div> </div> <div class="form-group 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="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="" typeof="sd:Service"> <div rel="sd:endpoint" resource="https://data.cervantesvirtual.com/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://data.cervantesvirtual.com/sparql"></div> </div> </div> <footer id="footer" class="page-footer small"> <div class="footer-copyright text-center"> Copyright 漏 2024 <a href="https://virtuoso.openlinksw.com/">OpenLink Software</a> <br /> Virtuoso version 07.20.3233 on Linux (x86_64-pc-linux-gnu) Single Server Edition (15 GB total memory) </div> </footer> <div id="sparql-scripts"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.bundle.min.js" integrity="sha512-wV7Yj1alIZDqZFCUQJy85VN+qvEIly93fIQAN7iqDFCPEucLCeNFz4r35FCo9s6WrpdDQPi80xbljXB8Bjtvcg==" crossorigin="anonymous"></script> <script> /**/ var timer = 0; var curr_format = 0; var can_cxml = 0; var can_qrcode = 0; var can_fct = 0; 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 = format.options[format.selectedIndex].value; 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 (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 (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">' + ' <strong>' + obj.message + '</strong>' + ' <button class="close" type="button" data-dismiss="alert" aria-label="Close">' + ' <span aria-hidden="true">脳</span>' + ' </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); sparqlSubmitFormWithCtrlEnter (); } /**/ </script> </div> </div> </body> </html> <!--SPARQL Endpoint XSLT applied-->