Skip to content

Instantly share code, notes, and snippets.

@kwijibo
Created November 27, 2010 21:51
Show Gist options
  • Save kwijibo/718313 to your computer and use it in GitHub Desktop.
Save kwijibo/718313 to your computer and use it in GitHub Desktop.
Add missing prefixes to SPARQL query in active textarea
(function(){
var mappings = {
"foaf": "http:\/\/xmlns.com\/foaf\/0.1\/",
"dc": "http:\/\/purl.org\/dc\/terms\/",
"rdf": "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#",
"rdfs": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#",
"owl": "http:\/\/www.w3.org\/2002\/07\/owl#",
"geonames": "http:\/\/www.geonames.org\/ontology#",
"geo": "http:\/\/www.w3.org\/2003\/01\/geo\/wgs84_pos#",
"skos": "http:\/\/www.w3.org\/2004\/02\/skos\/core#",
"dbp": "http:\/\/dbpedia.org\/property\/",
"xsd": "http:\/\/www.w3.org\/2001\/XMLSchema#",
"sioc": "http:\/\/rdfs.org\/sioc\/ns#",
"swrc": "http:\/\/swrc.ontoware.org\/ontology#",
"dbo": "http:\/\/dbpedia.org\/ontology\/",
"content": "http:\/\/purl.org\/rss\/1.0\/modules\/content\/",
"dbpprop": "http:\/\/dbpedia.org\/property\/",
"d2rq": "http:\/\/www.wiwiss.fu-berlin.de\/suhl\/bizer\/D2RQ\/0.1#",
"rss": "http:\/\/purl.org\/rss\/1.0\/",
"gen": "http:\/\/www.w3.org\/2006\/gen\/ont#",
"test2": "http:\/\/this.invalid\/test2#",
"dbpedia": "http:\/\/dbpedia.org\/resource\/",
"dc11": "http:\/\/purl.org\/dc\/elements\/1.1\/",
"nie": "http:\/\/www.semanticdesktop.org\/ontologies\/2007\/01\/19\/nie#",
"xhtml": "http:\/\/www.w3.org\/1999\/xhtml#",
"dcterms": "http:\/\/purl.org\/dc\/terms\/",
"wot": "http:\/\/xmlns.com\/wot\/0.1\/",
"akt": "http:\/\/www.aktors.org\/ontology\/portal#",
"org": "http:\/\/www.w3.org\/ns\/org#",
"doap": "http:\/\/usefulinc.com\/ns\/doap#",
"dct": "http:\/\/purl.org\/dc\/terms\/",
"vcard": "http:\/\/www.w3.org\/2006\/vcard\/ns#",
"owlim": "http:\/\/www.ontotext.com\/trree\/owlim#",
"xf": "http:\/\/www.w3.org\/2002\/xforms\/",
"media": "http:\/\/purl.org\/microformat\/hmedia\/",
"cfp": "http:\/\/sw.deri.org\/2005\/08\/conf\/cfp.owl#",
"reco": "http:\/\/ontologies.ezweb.morfeo-project.org\/reco\/ns#",
"sism": "http:\/\/purl.oclc.org\/NET\/sism\/0.1\/",
"fb": "http:\/\/rdf.freebase.com\/ns\/",
"ical": "http:\/\/www.w3.org\/2002\/12\/cal\/ical#",
"earl": "http:\/\/www.w3.org\/ns\/earl#",
"fn": "http:\/\/www.w3.org\/2005\/xpath-functions#",
"cc": "http:\/\/creativecommons.org\/ns#",
"musim": "http:\/\/purl.org\/ontology\/similarity\/",
"dcmit": "http:\/\/purl.org\/dc\/dcmitype\/",
"void": "http:\/\/rdfs.org\/ns\/void#",
"air": "http:\/\/dig.csail.mit.edu\/TAMI\/2007\/amord\/air#",
"mu": "http:\/\/www.kanzaki.com\/ns\/music#",
"afn": "http:\/\/jena.hpl.hp.com\/ARQ\/function#",
"swande": "http:\/\/purl.org\/swan\/1.2\/discourse-elements\/",
"cld": "http:\/\/purl.org\/cld\/terms\/",
"gr": "http:\/\/purl.org\/goodrelations\/v1#",
"bio": "http:\/\/purl.org\/vocab\/bio\/0.1\/",
"cal": "http:\/\/www.w3.org\/2002\/12\/cal\/ical#",
"http": "http:\/\/www.w3.org\/2006\/http#",
"xfn": "http:\/\/vocab.sindice.com\/xfn#",
"sd": "http:\/\/www.w3.org\/ns\/sparql-service-description#",
"days": "http:\/\/ontologi.es\/days#",
"factbook": "http:\/\/www4.wiwiss.fu-berlin.de\/factbook\/ns#",
"botany": "http:\/\/purl.org\/NET\/biol\/botany#",
"osag": "http:\/\/www.ordnancesurvey.co.uk\/ontology\/AdministrativeGeography\/v2.0\/AdministrativeGeography.rdf#",
"vann": "http:\/\/purl.org\/vocab\/vann\/",
"cs": "http:\/\/purl.org\/vocab\/changeset\/schema#",
"log": "http:\/\/www.w3.org\/2000\/10\/swap\/log#",
"event": "http:\/\/purl.org\/NET\/c4dm\/event.owl#",
"dir": "http:\/\/schemas.talis.com\/2005\/dir\/schema#",
"giving": "http:\/\/ontologi.es\/giving#",
"rev": "http:\/\/purl.org\/stuff\/rev#",
"ok": "http:\/\/okkam.org\/terms#",
"bibo": "http:\/\/purl.org\/ontology\/bibo\/",
"rel": "http:\/\/purl.org\/vocab\/relationship\/",
"memo": "http:\/\/ontologies.smile.deri.ie\/2009\/02\/27\/memo#",
"af": "http:\/\/purl.org\/ontology\/af\/",
"daia": "http:\/\/purl.org\/ontology\/daia\/",
"biblio": "http:\/\/purl.org\/net\/biblio#",
"money": "http:\/\/purl.org\/net\/rdf-money\/",
"ad": "http:\/\/schemas.talis.com\/2005\/address\/schema#",
"ir": "http:\/\/www.ontologydesignpatterns.org\/cp\/owl\/informationrealization.owl#",
"ome": "http:\/\/purl.org\/ontomedia\/core\/expression#",
"dcq": "http:\/\/purl.org\/dc\/terms\/",
"dbr": "http:\/\/dbpedia.org\/resource\/",
"swc": "http:\/\/data.semanticweb.org\/ns\/swc\/ontology#",
"bill": "http:\/\/www.rdfabout.com\/rdf\/schema\/usbill\/",
"xs": "http:\/\/www.w3.org\/2001\/XMLSchema#",
"ore": "http:\/\/www.openarchives.org\/ore\/terms\/",
"tag": "http:\/\/www.holygoat.co.uk\/owl\/redwood\/0.1\/tags\/",
"math": "http:\/\/www.w3.org\/2000\/10\/swap\/math#",
"rdfg": "http:\/\/www.w3.org\/2004\/03\/trix\/rdfg-1\/",
"xhv": "http:\/\/www.w3.org\/1999\/xhtml\/vocab#",
"space": "http:\/\/purl.org\/net\/schemas\/space\/",
"sr": "http:\/\/www.openrdf.org\/config\/repository\/sail#",
"dcn": "http:\/\/www.w3.org\/2007\/uwa\/context\/deliverycontext.owl#",
"pmlj": "http:\/\/inference-web.org\/2.0\/pml-justification.owl#",
"book": "http:\/\/purl.org\/NET\/book\/vocab#",
"co": "http:\/\/purl.org\/ontology\/co\/core#",
"tdb": "http:\/\/jena.hpl.hp.com\/2008\/tdb#",
"wn": "http:\/\/xmlns.com\/wordnet\/1.6\/",
"bio2rdf": "http:\/\/bio2rdf.org\/",
"myspace": "http:\/\/purl.org\/ontology\/myspace#",
"powder": "http:\/\/www.w3.org\/2007\/05\/powder#",
"wordmap": "http:\/\/purl.org\/net\/ns\/wordmap#",
"cmp": "http:\/\/www.ontologydesignpatterns.org\/cp\/owl\/componency.owl#",
"kwijibo": "http:\/\/kwijibo.talis.com\/",
"irrl": "http:\/\/www.ontologydesignpatterns.org\/cp\/owl\/informationobjectsandrepresentationlanguages.owl#",
"ne": "http:\/\/umbel.org\/umbel\/ne\/",
"os": "http:\/\/www.w3.org\/2000\/10\/swap\/os#",
"coref": "http:\/\/www.rkbexplorer.com\/ontologies\/coref#",
"atomix": "http:\/\/buzzword.org.uk\/rdf\/atomix#",
"akts": "http:\/\/www.aktors.org\/ontology\/support#",
"eztag": "http:\/\/ontologies.ezweb.morfeo-project.org\/eztag\/ns#",
"po": "http:\/\/purl.org\/ontology\/po\/",
"dctype": "http:\/\/purl.org\/dc\/dcmitype\/",
"swanq": "http:\/\/purl.org\/swan\/1.2\/qualifiers\/",
"wisski": "http:\/\/wiss-ki.eu\/",
"myspo": "http:\/\/purl.org\/ontology\/myspace#",
"imm": "http:\/\/schemas.microsoft.com\/imm\/",
"hard": "http:\/\/www.w3.org\/2007\/uwa\/context\/hardware.owl#",
"aiiso": "http:\/\/purl.org\/vocab\/aiiso\/schema#",
"jdbc": "http:\/\/d2rq.org\/terms\/jdbc\/",
"ex": "http:\/\/example.org\/",
"lang": "http:\/\/ontologi.es\/lang\/core#",
"dcam": "http:\/\/purl.org\/dc\/dcam\/",
"tzont": "http:\/\/www.w3.org\/2006\/timezone#",
"ctag": "http:\/\/commontag.org\/ns#",
"rep": "http:\/\/www.openrdf.org\/config\/repository#",
"bibtex": "http:\/\/purl.oclc.org\/NET\/nknouf\/ns\/bibtex#",
"umbel": "http:\/\/umbel.org\/umbel#",
"con": "http:\/\/www.w3.org\/2000\/10\/swap\/pim\/contact#",
"usgov": "http:\/\/www.rdfabout.com\/rdf\/schema\/usgovt\/",
"nfo": "http:\/\/www.semanticdesktop.org\/ontologies\/2007\/03\/22\/nfo#",
"lx": "http:\/\/purl.org\/NET\/lx#",
"lomvoc": "http:\/\/ltsc.ieee.org\/rdf\/lomv1p0\/vocabulary#",
"vs": "http:\/\/www.w3.org\/2003\/06\/sw-vocab-status\/ns#",
"spin": "http:\/\/spinrdf.org\/spin#",
"swrlb": "http:\/\/www.w3.org\/2003\/11\/swrlb#",
"video": "http:\/\/purl.org\/media\/video#",
"ti": "http:\/\/www.ontologydesignpatterns.org\/cp\/owl\/timeinterval.owl#",
"sioct": "http:\/\/rdfs.org\/sioc\/types#",
"sail": "http:\/\/www.openrdf.org\/config\/sail#",
"spc": "http:\/\/purl.org\/ontomedia\/core\/space#",
"ibis": "http:\/\/purl.org\/ibis#",
"nao": "http:\/\/www.semanticdesktop.org\/ontologies\/2007\/08\/15\/nao#",
"fec": "http:\/\/www.rdfabout.com\/rdf\/schema\/usfec\/",
"sit": "http:\/\/www.ontologydesignpatterns.org\/cp\/owl\/situation.owl#",
"wdr": "http:\/\/www.w3.org\/2007\/05\/powder#",
"test": "http:\/\/test2.example.com\/",
"swrl": "http:\/\/www.w3.org\/2003\/11\/swrl#",
"wv": "http:\/\/vocab.org\/waiver\/terms\/",
"fresnel": "http:\/\/www.w3.org\/2004\/09\/fresnel#",
"swandr": "http:\/\/purl.org\/swan\/1.2\/discourse-relationships\/",
"tmo": "http:\/\/www.semanticdesktop.org\/ontologies\/2008\/05\/20\/tmo#",
"chord": "http:\/\/purl.org\/ontology\/chord\/",
"user": "http:\/\/schemas.talis.com\/2005\/user\/schema#",
"ncal": "http:\/\/www.semanticdesktop.org\/ontologies\/2007\/04\/02\/ncal#",
"h5": "http:\/\/buzzword.org.uk\/rdf\/h5#",
"doac": "http:\/\/ramonantonio.net\/doac\/0.1\/#",
"frbr": "http:\/\/purl.org\/vocab\/frbr\/core#",
"omb": "http:\/\/purl.org\/ontomedia\/ext\/common\/being#",
"rif": "http:\/\/www.w3.org\/2007\/rif#",
"lgd": "http:\/\/linkedgeodata.org\/vocabulary#",
"iswc": "http:\/\/annotation.semanticweb.org\/2004\/iswc#",
"meta": "http:\/\/www.openrdf.org\/rdf\/2009\/metadata#",
"sc": "http:\/\/umbel.org\/umbel\/sc\/",
"zoology": "http:\/\/purl.org\/NET\/biol\/zoology#",
"mit": "http:\/\/purl.org\/ontology\/mo\/mit#",
"es": "http:\/\/eulersharp.sourceforge.net\/2003\/03swap\/log-rules#",
"cyc": "http:\/\/sw.opencyc.org\/concept\/",
"scovo": "http:\/\/purl.org\/NET\/scovo#",
"lingvoj": "http:\/\/www.lingvoj.org\/ontology#",
"nrl": "http:\/\/www.semanticdesktop.org\/ontologies\/2007\/08\/15\/nrl#",
"xhe": "http:\/\/buzzword.org.uk\/rdf\/xhtml-elements#",
"rsa": "http:\/\/www.w3.org\/ns\/auth\/rsa#",
"ptr": "http:\/\/www.w3.org\/2009\/pointers#",
"irw": "http:\/\/www.ontologydesignpatterns.org\/ont\/web\/irw.owl#",
"cv": "http:\/\/rdfs.org\/resume-rdf\/",
"wnschema": "http:\/\/www.cogsci.princeton.edu\/~wn\/schema\/",
"code": "http:\/\/telegraphis.net\/ontology\/measurement\/code#",
"sl": "http:\/\/www.semanlink.net\/2001\/00\/semanlink-schema#",
"qdoslf": "http:\/\/foaf.qdos.com\/lastfm\/schema\/",
"osoc": "http:\/\/web-semantics.org\/ns\/opensocial#",
"taxo": "http:\/\/purl.org\/rss\/1.0\/modules\/taxonomy\/",
"lt": "http:\/\/diplomski.nelakolundzija.org\/LTontology.rdf#",
"mo": "http:\/\/purl.org\/ontology\/mo\/",
"resex": "http:\/\/resex.rkbexplorer.com\/ontologies\/resex#",
"phss": "http:\/\/ns.poundhill.com\/phss\/1.0\/",
"conserv": "http:\/\/conserv.deri.ie\/ontology#",
"rei": "http:\/\/www.w3.org\/2004\/06\/rei#",
"frbre": "http:\/\/purl.org\/vocab\/frbr\/extended#",
"ac": "http:\/\/umbel.org\/umbel\/ac\/",
"politico": "http:\/\/www.rdfabout.com\/rdf\/schema\/politico\/",
"prj": "http:\/\/purl.org\/stuff\/project\/",
"acl": "http:\/\/www.w3.org\/ns\/auth\/acl#",
"abc": "http:\/\/www.metadata.net\/harmony\/ABCSchemaV5Commented.rdf#",
"wgs84": "http:\/\/www.w3.org\/2003\/01\/geo\/wgs84_pos#",
"hlisting": "http:\/\/sindice.com\/hlisting\/0.1\/",
"am": "http:\/\/vocab.deri.ie\/am#",
"cycann": "http:\/\/sw.cyc.com\/CycAnnotations_v1#",
"crypto": "http:\/\/www.w3.org\/2000\/10\/swap\/crypto#",
"swanqs": "http:\/\/purl.org\/swan\/1.2\/qualifiers\/",
"loc": "http:\/\/www.w3.org\/2007\/uwa\/context\/location.owl#",
"prv": "http:\/\/purl.org\/net\/provenance\/ns#",
"spl": "http:\/\/spinrdf.org\/spl#",
"doc": "http:\/\/www.w3.org\/2000\/10\/swap\/pim\/doc#",
"evset": "http:\/\/dsnotify.org\/vocab\/eventset\/0.1\/",
"sv": "http:\/\/schemas.talis.com\/2005\/service\/schema#",
"doclist": "http:\/\/www.junkwork.net\/xml\/DocumentList#",
"unit": "http:\/\/data.nasa.gov\/qudt\/owl\/unit#",
"urn": "http:\/\/fliqz.com\/",
"lom": "http:\/\/ltsc.ieee.org\/rdf\/lomv1p0\/lom#",
"xl": "http:\/\/langegger.at\/xlwrap\/vocab#",
"wdrs": "http:\/\/www.w3.org\/2007\/05\/powder-s#",
"swp": "http:\/\/www.w3.org\/2004\/03\/trix\/swp-2\/",
"p3p": "http:\/\/www.w3.org\/2002\/01\/p3prdfv1#",
"tl": "http:\/\/purl.org\/NET\/c4dm\/timeline.owl#",
"profiling": "http:\/\/ontologi.es\/profiling#",
"nmo": "http:\/\/www.semanticdesktop.org\/ontologies\/2007\/03\/22\/nmo#",
"sdl": "http:\/\/purl.org\/vocab\/riro\/sdl#",
"swanag": "http:\/\/purl.org\/swan\/1.2\/agents\/",
"dady": "http:\/\/purl.org\/NET\/dady#",
"java": "http:\/\/www.w3.org\/2007\/uwa\/context\/java.owl#",
"omt": "http:\/\/purl.org\/ontomedia\/ext\/common\/trait#",
"airport": "http:\/\/www.daml.org\/2001\/10\/html\/airport-ont#",
"ecs": "http:\/\/rdf.ecs.soton.ac.uk\/ontology\/ecs#",
"ov": "http:\/\/open.vocab.org\/terms\/",
"link": "http:\/\/www.w3.org\/2006\/link#",
"courseware": "http:\/\/courseware.rkbexplorer.com\/ontologies\/courseware#",
"lastfm": "http:\/\/purl.org\/ontology\/last-fm\/",
"dcmitype": "http:\/\/purl.org\/dc\/dcmitype\/",
"cnt": "http:\/\/www.w3.org\/2008\/content#",
"formats": "http:\/\/www.w3.org\/ns\/formats\/",
"lifecycle": "http:\/\/purl.org\/vocab\/lifecycle\/schema#",
"swanci": "http:\/\/purl.org\/swan\/1.2\/citations\/",
"commerce": "http:\/\/purl.org\/commerce#",
"string": "http:\/\/www.w3.org\/2000\/10\/swap\/string#",
"ddc": "http:\/\/purl.org\/NET\/decimalised#",
"acm": "http:\/\/www.rkbexplorer.com\/ontologies\/acm#",
"pmt": "http:\/\/tipsy.googlecode.com\/svn\/trunk\/vocab\/pmt#",
"xen": "http:\/\/buzzword.org.uk\/rdf\/xen#",
"omc": "http:\/\/purl.org\/ontomedia\/ext\/common\/bestiary#",
"dcterm": "http:\/\/purl.org\/dc\/terms\/",
"pmlr": "http:\/\/inference-web.org\/2.0\/pml-relation.owl#",
"sim": "http:\/\/purl.org\/ontology\/similarity\/",
"acc": "http:\/\/purl.org\/NET\/acc#",
"biol": "http:\/\/purl.org\/NET\/biol\/ns#",
"grddl": "http:\/\/www.w3.org\/2003\/g\/data-view#",
"smiley": "http:\/\/www.smileyontology.com\/ns#",
"cert": "http:\/\/www.w3.org\/ns\/auth\/cert#",
"custom": "http:\/\/www.openrdf.org\/config\/sail\/custom#",
"list": "http:\/\/www.w3.org\/2000\/10\/swap\/list#",
"affy": "http:\/\/www.affymetrix.com\/community\/publications\/affymetrix\/tmsplice#",
"web": "http:\/\/www.w3.org\/2007\/uwa\/context\/web.owl#",
"contact": "http:\/\/www.w3.org\/2000\/10\/swap\/pim\/contact#",
"sp": "http:\/\/spinrdf.org\/sp#",
"oauth": "http:\/\/demiblog.org\/vocab\/oauth#",
"c4n": "http:\/\/vocab.deri.ie\/c4n#",
"resist": "http:\/\/www.rkbexplorer.com\/ontologies\/resist#",
"wairole": "http:\/\/www.w3.org\/2005\/01\/wai-rdf\/GUIRoleTaxonomy#",
"states": "http:\/\/www.w3.org\/2005\/07\/aaa#",
"osgb": "http:\/\/data.ordnancesurvey.co.uk\/id\/",
"ire": "http:\/\/www.ontologydesignpatterns.org\/cpont\/ire.owl#",
"sm": "http:\/\/topbraid.org\/sparqlmotion#",
"swh": "http:\/\/plugin.org.uk\/swh-plugins\/",
"swanpav": "http:\/\/purl.org\/swan\/1.2\/pav\/",
"skosxl": "http:\/\/www.w3.org\/2008\/05\/skos-xl#",
"lode": "http:\/\/linkedevents.org\/ontology\/",
"pimo": "http:\/\/www.semanticdesktop.org\/ontologies\/2007\/11\/01\/pimo#",
"exif": "http:\/\/www.w3.org\/2003\/12\/exif\/ns#",
"sede": "http:\/\/eventography.org\/sede\/0.1\/",
"gpt": "http:\/\/purl.org\/vocab\/riro\/gpt#",
"xesam": "http:\/\/freedesktop.org\/standards\/xesam\/1.0\/core#",
"like": "http:\/\/ontologi.es\/like#",
"sesame": "http:\/\/www.openrdf.org\/schema\/sesame#",
"audio": "http:\/\/purl.org\/media\/audio#",
"tags": "http:\/\/www.holygoat.co.uk\/owl\/redwood\/0.1\/tags\/",
"common": "http:\/\/www.w3.org\/2007\/uwa\/context\/common.owl#",
"xhtmlvocab": "http:\/\/www.w3.org\/1999\/xhtml\/vocab\/",
"admin": "http:\/\/webns.net\/mvcb\/",
"atom": "http:\/\/www.w3.org\/2005\/Atom\/",
"yago": "http:\/\/dbpedia.org\/class\/yago\/",
"vote": "http:\/\/www.rdfabout.com\/rdf\/schema\/vote\/",
"trackback": "http:\/\/madskills.com\/public\/xml\/rss\/module\/trackback\/",
"uri": "http:\/\/purl.org\/NET\/uri#",
"okkam": "http:\/\/models.okkam.org\/ENS-core-vocabulary#",
"lfn": "http:\/\/www.dotnetrdf.org\/leviathan#",
"ddl": "http:\/\/purl.org\/vocab\/riro\/ddl#",
"ping": "http:\/\/purl.org\/net\/pingback\/",
"climb": "http:\/\/climb.dataincubator.org\/vocabs\/climb\/",
"xforms": "http:\/\/www.w3.org\/2002\/xforms\/",
"rdfa": "http:\/\/www.w3.org\/ns\/rdfa#",
"dbpediaowl": "http:\/\/dbpedia.org\/ontology\/",
"protege": "http:\/\/protege.stanford.edu\/system#",
"pr": "http:\/\/ontologi.es\/profiling#",
"psych": "http:\/\/purl.org\/vocab\/psychometric-profile\/",
"fed": "http:\/\/www.openrdf.org\/config\/sail\/federation#",
"daml": "http:\/\/www.daml.org\/2001\/03\/daml+oil#",
"smf": "http:\/\/topbraid.org\/sparqlmotionfunctions#",
"omp": "http:\/\/purl.org\/ontomedia\/ext\/common\/profession#",
"ldap": "http:\/\/purl.org\/net\/ldap\/",
"plink": "http:\/\/buzzword.org.uk\/rdf\/personal-link-types#",
"scv": "http:\/\/purl.org\/NET\/scovo#",
"bsbm": "http:\/\/www4.wiwiss.fu-berlin.de\/bizer\/bsbm\/v01\/vocabulary\/",
"swanco": "http:\/\/purl.org\/swan\/1.2\/swan-commons\/",
"gob": "http:\/\/purl.org\/ontology\/last-fm\/",
"scot": "http:\/\/scot-project.org\/scot\/ns#",
"puc": "http:\/\/purl.org\/NET\/puc#",
"nexif": "http:\/\/www.semanticdesktop.org\/ontologies\/2007\/05\/10\/nexif#",
"movie": "http:\/\/data.linkedmdb.org\/resource\/movie\/",
"opm": "http:\/\/openprovenance.org\/ontology#",
"lfm": "http:\/\/purl.org\/ontology\/last-fm\/",
"nco": "http:\/\/www.semanticdesktop.org\/ontologies\/2007\/03\/22\/nco#",
"resource": "http:\/\/purl.org\/vocab\/resourcelist\/schema#",
"push": "http:\/\/www.w3.org\/2007\/uwa\/context\/push.owl#",
"so": "http:\/\/purl.org\/ontology\/symbolic-music\/",
"sysont": "http:\/\/ns.ontowiki.net\/SysOnt\/",
"sml": "http:\/\/topbraid.org\/sparqlmotionlib#",
"dbpp": "http:\/\/dbpedia.org\/property\/",
"dailymed": "http:\/\/www4.wiwiss.fu-berlin.de\/dailymed\/resource\/dailymed\/",
"dummy": "http:\/\/hello.com\/",
"og": "http:\/\/opengraphprotocol.org\/schema\/",
"play": "http:\/\/uriplay.org\/spec\/ontology\/#",
"status": "http:\/\/ontologi.es\/status#",
"moat": "http:\/\/moat-project.org\/ns#",
"imreg": "http:\/\/www.w3.org\/2004\/02\/image-regions#",
"product": "http:\/\/purl.org\/commerce\/product#",
"label": "http:\/\/purl.org\/net\/vocab\/2004\/03\/label#",
"omm": "http:\/\/purl.org\/ontomedia\/core\/media#",
"mysql": "http:\/\/web-semantics.org\/ns\/mysql\/",
"opensearch": "http:\/\/a9.com\/-\/spec\/opensearch\/1.1\/",
"obj": "http:\/\/www.openrdf.org\/rdf\/2009\/object#",
"music": "http:\/\/musicontology.com\/",
"soft": "http:\/\/www.w3.org\/2007\/uwa\/context\/software.owl#",
"meetup": "http:\/\/www.lotico.com\/meetup\/",
"nid3": "http:\/\/www.semanticdesktop.org\/ontologies\/2007\/05\/10\/nid3#",
"ezcontext": "http:\/\/ontologies.ezweb.morfeo-project.org\/ezcontext\/ns#",
"lib": "http:\/\/schemas.talis.com\/2005\/library\/schema#",
"net": "http:\/\/www.w3.org\/2007\/uwa\/context\/network.owl#",
"coin": "http:\/\/purl.org\/court\/def\/2009\/coin#",
"timeline": "http:\/\/purl.org\/NET\/c4dm\/timeline.owl#",
"time": "http:\/\/www.w3.org\/2006\/time#",
"wgspos": "http:\/\/www.w3.org\/2003\/01\/geo\/wgs84_pos#",
"gold": "http:\/\/purl.org\/linguistics\/gold\/",
"wgs": "http:\/\/www.w3.org\/2003\/01\/geo\/wgs84_pos#",
"oat": "http:\/\/openlinksw.com\/schemas\/oat\/",
"drugbank": "http:\/\/www4.wiwiss.fu-berlin.de\/drugbank\/resource\/drugbank\/",
"geographis": "http:\/\/telegraphis.net\/ontology\/geography\/geography#",
"rooms": "http:\/\/vocab.deri.ie\/rooms#",
"ttl": "http:\/\/www.w3.org\/2008\/turtle#",
"bib": "http:\/\/zeitkunst.org\/bibtex\/0.1\/bibtex.owl#",
"sparql": "http:\/\/www.openrdf.org\/config\/repository\/sparql#",
"opo": "http:\/\/online-presence.net\/opo\/ns#",
"sioca": "http:\/\/rdfs.org\/sioc\/actions#",
"pmlp": "http:\/\/inference-web.org\/2.0\/pml-provenance.owl#",
"dcat": "http:\/\/vocab.deri.ie\/dcat#",
"wn20schema": "http:\/\/www.w3.org\/2006\/03\/wn\/wn20\/schema\/",
"pmlt": "http:\/\/inference-web.org\/2.0\/pml-trust.owl#",
"lotico": "http:\/\/www.lotico.com\/meetup\/",
"tripfs": "http:\/\/purl.org\/tripfs\/2010\/02#",
"ufmedia": "http:\/\/purl.org\/microformat\/hmedia\/",
"meteo": "http:\/\/purl.org\/ns\/meteo#",
"txn": "http:\/\/lod.taxonconcept.org\/ontology\/txn.owl#",
"awol": "http:\/\/bblfish.net\/work\/atom-owl\/2006-06-06\/#",
"sawsdl": "http:\/\/www.w3.org\/ns\/sawsdl#",
"aifb": "http:\/\/www.aifb.kit.edu\/id\/",
"mf": "http:\/\/poshrdf.org\/ns\/mf#",
"copyright": "http:\/\/rhizomik.net\/ontologies\/2008\/05\/copyrightonto.owl#",
"whois": "http:\/\/www.kanzaki.com\/ns\/whois#",
"pdo": "http:\/\/ontologies.smile.deri.ie\/pdo#",
"derecho": "http:\/\/purl.org\/derecho#",
"rulz": "http:\/\/purl.org\/NET\/rulz#",
"ean": "http:\/\/openean.kaufkauf.net\/id\/",
"xbrli": "http:\/\/www.xbrl.org\/2003\/instance#",
"ya": "http:\/\/blogs.yandex.ru\/schema\/foaf\/",
"rec": "http:\/\/purl.org\/ontology\/rec\/core#",
"act": "http:\/\/www.w3.org\/2007\/rif-builtin-action#",
"evopat": "http:\/\/ns.aksw.org\/Evolution\/",
"yoda": "http:\/\/purl.org\/NET\/yoda#",
"swivt": "http:\/\/semantic-mediawiki.org\/swivt\/1.0#",
"cos": "http:\/\/www.inria.fr\/acacia\/corese#",
"sdmx": "http:\/\/purl.org\/linked-data\/sdmx#",
"isi": "http:\/\/purl.org\/ontology\/is\/inst\/",
"ist": "http:\/\/purl.org\/ontology\/is\/types\/",
"posh": "http:\/\/poshrdf.org\/ns\/posh\/",
"qb": "http:\/\/purl.org\/linked-data\/cube#",
"remus": "http:\/\/www.semanticweb.org\/ontologies\/2010\/6\/Ontology1279614123500.owl#",
"ref": "http:\/\/purl.org\/vocab\/relationship\/",
"hcterms": "http:\/\/purl.org\/uF\/hCard\/terms\/",
"olo": "http:\/\/purl.org\/ontology\/olo\/core#",
"isq": "http:\/\/purl.org\/ontology\/is\/quality\/",
"game": "http:\/\/data.totl.net\/game\/",
"wlp": "http:\/\/weblab-project.org\/core\/model\/property\/processing\/",
"dayta": "http:\/\/dayta.me\/resource#",
"dgfoaf": "http:\/\/west.uni-koblenz.de\/ontologies\/2010\/07\/dgfoaf.owl#",
"anca": "http:\/\/www.semanticweb.org\/ontologies\/2010\/6\/Ontology1279614123500.owl#",
"gv": "http:\/\/rdf.data-vocabulary.org\/#",
"is": "http:\/\/purl.org\/ontology\/is\/core#",
"conv": "http:\/\/purl.org\/twc\/vocab\/conversion\/",
"geoes": "http:\/\/geo.linkeddata.es\/page\/ontology\/",
"lark1": "http:\/\/users.utcluj.ro\/~raluca\/ontology\/Ontology1279614123500.owl#",
"loticoowl": "http:\/\/www.lotico.com\/ontology\/",
"uniprot": "http:\/\/purl.uniprot.org\/core\/",
"tarot": "http:\/\/data.totl.net\/tarot\/card\/",
"tripfs2": "http:\/\/purl.org\/tripfs\/2010\/06#",
"dnr": "http:\/\/www.dotnetrdf.org\/configuration#",
"opus": "http:\/\/lsdis.cs.uga.edu\/projects\/semdis\/opus#",
"ao": "http:\/\/purl.org\/ontology\/ao\/core#",
"oc": "http:\/\/opencoinage.org\/rdf\/",
"nt": "http:\/\/ns.inria.fr\/nicetag\/2010\/09\/09\/voc#",
"session": "http:\/\/redfoot.net\/2005\/session#",
"geospecies": "http:\/\/rdf.geospecies.org\/ont\/geospecies#",
"opmv": "http:\/\/purl.org\/net\/opmv\/ns#",
"r2r": "http:\/\/www4.wiwiss.fu-berlin.de\/bizer\/r2r\/",
"wo": "http:\/\/purl.org\/ontology\/wo\/core#",
"search": "http:\/\/sindice.com\/vocab\/search#",
"protons": "http:\/\/proton.semanticweb.org\/2005\/04\/protons#",
"prot": "http:\/\/www.proteinontology.info\/po.owl#",
"cco": "http:\/\/purl.org\/ontology\/cco\/core#",
"w3p": "http:\/\/prov4j.org\/w3p\/",
"ct": "http:\/\/data.linkedct.org\/resource\/linkedct\/",
"toby": "http:\/\/tobyinkster.co.uk\/#",
"gridworks": "http:\/\/purl.org\/net\/opmv\/types\/gridworks#",
"ma": "http:\/\/www.w3.org\/ns\/ma-ont#",
"httph": "http:\/\/www.w3.org\/2007\/ont\/httph#",
"oo": "http:\/\/purl.org\/openorg\/",
"lp": "http:\/\/launchpad.net\/rdf\/launchpad#",
"openlinks": "http:\/\/www.openlinksw.com\/schemas\/virtrdf#",
"linkedct": "http:\/\/data.linkedct.org\/resource\/linkedct\/",
"rr": "http:\/\/www.w3.org\/ns\/r2rml#",
"sindice": "http:\/\/vocab.sindice.net\/",
"postcode": "http:\/\/data.ordnancesurvey.co.uk\/id\/postcodeunit\/",
"lvont": "http:\/\/lexvo.org\/ontology#",
"odp": "http:\/\/ontologydesignpatterns.org\/",
"nsa": "http:\/\/multimedialab.elis.ugent.be\/organon\/ontologies\/ninsuna#",
"crm": "http:\/\/purl.org\/NET\/cidoc-crm\/core#",
"cito": "http:\/\/purl.org\/spar\/cito\/",
"compass": "http:\/\/purl.org\/net\/compass#",
"rail": "http:\/\/ontologi.es\/rail\/vocab#",
"c4o": "http:\/\/purl.org\/spar\/c4o\/",
"umbelrc": "http:\/\/umbel.org\/umbel\/rc\/",
"m": "http:\/\/www.kanzaki.com\/ns\/music#",
};
var textareas = document.getElementsByTagName('textarea');
for (var i = textareas.length - 1; i >= 0; i--){
if(textareas[i].name='query'){
addMissingPrefixes(textareas[i]);
}
};
function addMissingPrefixes(el){
var sparqlQuery = el.value;
var prefixSparql = '';
var usedPrefixes = [];
var curieMatches = sparqlQuery.match(/PREFIX [a-z]+:/g);
for( var u in sparqlQuery.match(/PREFIX [a-z]+:/g)){
var t = curieMatches[u];
var prefix = t.substring(7,t.length-1);
usedPrefixes.push(prefix);
}
var curieMatches = sparqlQuery.match(/[a-z]+:[^/]/g);
for( var m in curieMatches){
var t = curieMatches[m];
var prefix = t.substring(0,t.length-2);
var ns = '';
if(mappings[prefix]){
ns = mappings[prefix];
}
if(usedPrefixes.indexOf(prefix)==-1){
usedPrefixes.push(prefix);
prefixSparql+= "PREFIX "+prefix+": <"+ns+">\n";
}
}
el.value = prefixSparql+sparqlQuery
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment