-
Notifications
You must be signed in to change notification settings - Fork 17
Dictionary: Drugs
Creating Dictionary using SPARQL query
- Run SPARQL query using following command:
SELECT ?moleculeLabel ?formule ?picture ?molecule ?moleculeAltLabel ?moleculeDescription ?wikipedia WHERE { ?molecule wdt:P31 wd:Q12140; wdt:P274 ?formule; wdt:P117 ?picture. SERVICE wikibase:label { bd:serviceParam wikibase:language "en, de". } OPTIONAL { ?wikipedia schema:about ?molecule . ?wikipedia schema:inLanguage "en" . ?wikipedia schema:isPartOf <https://en.wikipedia.org/> . } } ORDER BY (?moleculeLabel) LIMIT 10000
-
Downloaded the results from SPARQL endpoint.
-
Open the SPARQL results in notepad.
-
Use amidict for SPARQL mapping. Command for SPARQL mapping as follows:
amidict -vv --dictionary drug --directory dict --input drugs.sparql.xml create --informat=wikisparqlxml --sparqlmap wikidata=molecule,term=moleculeLabel,name=moleculeLabel,description=moleculeDescription,wikipedia=wikipedia,_picture=picture,_formula=formule --synonyms=moleculeAltLabel
- Commit all these results in Github
Dictionary contains:
- Wikidata Id
- Molecular name
- Molecular formula
- Compound picture
- Molecular Alt Label
- Molecular description
- Wikipedia link