dracor-org / dracor-frontend

Frontend for the DraCor API
https://dracor.org
MIT License
4 stars 6 forks source link

YASGUI: add predefined prefixes #42

Open ingoboerner opened 5 years ago

ingoboerner commented 5 years ago

YASGUI was implemented in #40 Some features would be very helpful for users:

Add predefined prefixes: Could be implemented by changing the settings object, as stated in the documentation https://yasqe.yasgui.org/doc/

yasqe.addPrefixes(prefixes: object) Add prefixes to the query. The prefixes are defined as {"rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"}

We could predefine:


PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dracon: <http://dracor.org/ontology#> ```
cmil commented 5 years ago

In 4e63793 I added the prefixes mentioned above to the default query that's shown when you initially load YASGUI or when you open above. The yasqe.addPrefixes method seems to do exactly that programatically for an individual query editor, while I added it to the YASQE.defaults.value in the initial configuration. @ingoboerner: is that what you had in mind?

PS: make sure to clear your localStorage to be able to see this change on https://dracor.org/sparql.