Downloading Greasemonkey
// ==UserScript==
| // @name | General SPARQL tester |
| // @author | Put your name here |
| // @date | Put date here |
| // @namespace | Enter a namespace here |
| // @include | Enter a page URL here |
| // @exclude | Enter a page URL here |
// ==/UserScript==
(function()
{
try {
var endpoint;
var query;
var rawQuery;
//////////////////////////////////////////////////////////////////////////////////////
// Uncomment one of these SPARQL endpoints
//endpoint = "http://www.dbpedia.org/sparql"; //dbpedia
//endpoint = "http://data.linkedmdb.org/sparql"; //movie database
//endpoint = "http://dbtune.org/jamendo/sparql/"; //jamendo
//endpoint = "http://www4.wiwiss.fu-berlin.de/dblp/sparql"; //dblp
//endpoint = "http://go.bio2rdf.org/sparql"; //gene ontology
//endpoint = "http://geneid.bio2rdf.org/sparql"; //gene id
//endpoint = "http://uniprot.bio2rdf.org/sparql"; //UniProt
//endpoint = "http://mesh.bio2rdf.org/sparql"; //MESH
//endpoint = "http://www4.wiwiss.fu-berlin.de/dailymed/sparql"; //dailymed
//endpoint = "http://www4.wiwiss.fu-berlin.de/diseasome/sparql"; //diseasome
//endpoint = "http://data.linkedct.org/sparql"; //linkedct
//endpoint = "http://mesh.bio2rdf.org/sparql"; //mesh
//endpoint = "http://taxonomy.bio2rdf.org/sparql"; //NEWT
//////////////////// Query variable /////////////////////////////////////////////////////////
rawQuery = "select distinct ?concept where { [] a ?concept } limit 50";
////////////////////////////////////////////////////////////////////////////////////////////////////
// HTTPRequest code with MIME type 'text/html'
query = encodeURIComponent(rawQuery);
GM_xmlhttpRequest({
method: 'GET',
url: endpoint + '?query=' + query,
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'text/html',
},
onload: function(responseDetails) {
////////////////////////////////////////////////////////////////////////////////
// Shows results in alert()
alert(responseDetails.responseText);
}
});
} catch (eErr) {
alert ("Greasemonkey error: " + eErr);
}
return;
}) ();