Online Access
Contents
Access entry points
You may access the data online using:
- SPARQL a specialised query language for RDF data,
- facetted browsing a simple interface to query/browse linked data,
- Linked Data resolution to query some data. It’s as easy as typing an URL in your browser (e.g.: http://kaiko.getalp.org/dbnary/eng/cat or http://kaiko.getalp.org/dbnary/fra/chat)
Use a simple form that generate SPARQL
Sina Ahmadi has build an easy to use form that can query DBnary and WikiData. Feel free to use it to generate (and run) SPARQL Queries if you are not familiar with SPARQL and Linked Data.
Which data is available online ?
All the DBnary data is loaded in the online database, however, as DBnary evolves with wiktionary data, a new version is available for download every month. The online data may be older.
To know which version is currently online, you may :
- Just query metadata associated to a particular lexicon (e.g. http://kaiko.getalp.org/dbnary/fra/___fr_dbnary_dataset)
- Look for every lexica available online with the sparql query:
select distinct ?lexicon where {?lexicon a lime:Lexicon}
Querying data using SPARQL
SPARQL is a standard language for querying linked data. We give some sample queries that may be used to query existing data. Note that this public service is limited and queries that are too long to process will be canceled automatically.
Count the number of non English lexical entries extracted from the English language edition (exolex data)
SELECT COUNT DISTINCT ?le FROM <http://kaiko.getalp.org/dbnary/eng_exolex/> where { ?le a ontolex:LexicalEntry }
Getting all German translations of the English lexical entry cat__noun__1
SELECT DISTINCT ?t, ?f, ?o WHERE { ?t dbnary:isTranslationOf dbnary-eng:cat__Noun__1 ; dbnary:targetLanguage lexvo:deu ; dbnary:writtenForm ?f . OPTIONAL { ?t dbnary:gloss ?o } }
Counting all available translations to French
PREFIX lexvo: <http://lexvo.org/id/iso639-3/> PREFIX dbnary: <http://kaiko.getalp.org/dbnary#> SELECT count(?t) WHERE { ?t dbnary:targetLanguage lexvo:fra . }
Counting translations to Bambara by source language
SELECT count(?t) , ?l WHERE { ?t dbnary:targetLanguage lexvo:bam ; dbnary:isTranslationOf ?e . ?e lime:language ?l }
Getting a flat list of all “nym” relations
This query will likely time out on the kaiko server if you do not use the limit argument. It may be easily used on a mirror server that you can set up using the current dumps.
SELECT distinct ?f ?rel ?t WHERE { ?f dbnary:describes ?lf. { ?lf ?rel ?t. ?t a dbnary:Page } UNION { ?lf ontolex:sense ?sf. ?sf ?rel ?t. ?t a dbnary:Page. } ?lf lime:language "fr". } LIMIT 100
Get statistics on number of relations per graphs
This query will give you a stat that is the same as the http://downloads.dbpedia.org/wiktionary/ stats….csv file.
Select ?g ?p count(?p) as ?count where { Graph ?g { ?s ?p ?o } } group by ?p ?g order by desc (?g) desc(?count)
Counting the number of russian/turkish translation pairs that are connected through an English Lemma or sense
SELECT count DISTINCT ?r, ?t WHERE { ?trans1 dbnary:isTranslationOf ?e ; dbnary:targetLanguage lexvo:rus ; dbnary:writtenForm ?r . ?trans2 dbnary:isTranslationOf ?e ; dbnary:targetLanguage lexvo:tur ; dbnary:writtenForm ?t . }
Getting all translations to Wolof
SELECT ?source, ?l, ?target WHERE { ?t dbnary:targetLanguage lexvo:wol ; dbnary:isTranslationOf ?e ; dbnary:writtenForm ?target. ?e lime:language ?l ; ontolex:canonicalForm ?f. ?f ontolex:writtenRep ?source }
Getting all verbal locution, along with several info
PREFIX dbnary: <http://kaiko.getalp.org/dbnary#> PREFIX eng: <http://kaiko.getalp.org/dbnary/eng/> PREFIX lexvo: <http://lexvo.org/id/iso639-3/> select distinct ?w, ?syn, ?ant, ?sn, ?ds, ?sew where { ?l a ontolex:MultiWordExpression; lime:language "fr" ; ontolex:canonicalForm ?f ; lexinfo:partOfSpeech lexinfo:verb ; ontolex:sense ?s . ?f ontolex:writtenRep ?w . ?s skos:definition ?d ; dbnary:senseNumber ?sn . ?d rdf:value ?ds . OPTIONAL { ?s skos:example ?se . ?se rdf:value ?sew . } OPTIONAL { ?l dbnary:synonym ?syn ; dbnary:antonym ?ant . } }
Counting the number of English senses with a translation in French
SELECT COUNT(DISTINCT ?es) WHERE { ?t dbnary:isTranslationOf ?es ; dbnary:targetLanguage lexvo:fra ; dbnary:writtenForm ?f . ?es a ontolex:LexicalSense . }
Select pages and lexical entries that are homonyms for a given partOfSpeech
SELECT ?page, ?le, ?partOfSpeech where { ?page dbnary:describes ?le . ?le lexinfo:partOfSpeech ?partOfSpeech . { SELECT distinct ?page , ?partOfSpeech where { ?page dbnary:describes ?le1 ; dbnary:describes ?le2 . ?le1 lexinfo:partOfSpeech ?partOfSpeech. ?le2 lexinfo:partOfSpeech ?partOfSpeech. FILTER (?le1 != ?le2) } } } group by ?partOfSpeech order by ?page
Select the number of pages with homonyms, along with total number of pages, per language
select ?lg, ?nbHomonyms, ?nbPages where { { select ?lg, count(distinct ?page) as ?nbHomonyms where { ?page dbnary:describes ?le . ?le dct:language ?lg . { SELECT distinct ?page , ?partOfSpeech where { ?page dbnary:describes ?le1 ; dbnary:describes ?le2 . ?le1 lexinfo:partOfSpeech ?partOfSpeech. ?le2 lexinfo:partOfSpeech ?partOfSpeech. FILTER (?le1 != ?le2) } } } group by ?lg } { SELECT ?lg, count (distinct ?p) as ?nbPages where { ?p dbnary:describes ?l . ?l dct:language ?lg . } group by ?lg } } group by ?lg
Some simple stats on the whole database
SELECT (count(?e) as ?ce) (count(?p) as ?cp) (count(?t) as ?ct) WHERE { { ?e a ontolex:LexicalEntry . } UNION { ?p a dbnary:Page . } UNION { ?t a dbnary:Translation .} }