-
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 ?wikidata ?wikidataLabel ?wikipedia ?wikidataAltLabel ?wikidataDescription ?wikidataformule ?wikidatapicture ?hindi ?hindiLabel ?hindialtlabel ?hindiwikipedia ?tamil ?tamilLabel ?tamilaltlabel ?tamilwikipedia ?sanskrit ?sanskritLabel ?sanskritaltLabel ?sanskritwikipedia ?spanish ?spanishLabel ?spanishaltLabel ?spanishwikipedia ?urdu ?urduLabel ?urdualtLabel ?urduwikipedia WHERE { ?wikidata wdt:P31 wd:Q12140; wdt:P274 ?wikidataformule; wdt:P117 ?wikidatapicture. OPTIONAL { ?wikipedia schema:about ?wikidata; schema:isPartOf https://en.wikipedia.org/ } OPTIONAL { ?hindiwikipedia schema:about ?wikidata; schema:isPartOf https://hi.wikipedia.org/ } OPTIONAL { ?tamilwikipedia schema:about ?wikidata; schema:isPartOf https://ta.wikipedia.org/ } OPTIONAL { ?sanskritwikipedia schema:about ?wikidata; schema:isPartOf https://sa.wikipedia.org/ } OPTIONAL { ?spanishwikipedia schema:about ?wikidata; schema:isPartOf https://es.wikipedia.org/ } OPTIONAL { ?urduwikipedia schema:about ?wikidata; schema:isPartOf https://ur.wikipedia.org/ } SERVICE wikibase:label { bd:serviceParam wikibase:language "en".
?wikidata skos:altLabel ?wikidataAltLabel ; rdfs:label ?wikidataLabel; schema:description ?wikidataDescription
} SERVICE wikibase:label { bd:serviceParam wikibase:language "hi".
?wikidata skos:altLabel ?hindialtlabel .
?wikidata rdfs:label ?hindiLabel .
?wikidata schema:description ?hindi ;
} SERVICE wikibase:label { bd:serviceParam wikibase:language "ta".
?wikidata skos:altLabel ?tamilaltlabel .
?wikidata rdfs:label ?tamilLabel .
?wikidata schema:description ?tamil ;
} SERVICE wikibase:label { bd:serviceParam wikibase:language "sa".
?wikidata skos:altLabel ?sanskritaltlabel .
?wikidata rdfs:label ?sanskritLabel .
?wikidata schema:description ?sanskrit ;
} SERVICE wikibase:label { bd:serviceParam wikibase:language "es".
?wikidata skos:altLabel ?spanishaltlabel .
?wikidata rdfs:label ?spanishLabel .
?wikidata schema:description ?spanish ;
} SERVICE wikibase:label { bd:serviceParam wikibase:language "ur".
?wikidata skos:altLabel ?urdualtlabel .
?wikidata rdfs:label ?urduLabel .
?wikidata schema:description ?urdu ;
} }
-
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
- Language : English,தமிழ்,हिन्दी,اردو,spanish,sanskrit