TransforMap / transformap-viewer

https://viewer.transformap.co/
Do What The F*ck You Want To Public License
10 stars 16 forks source link

taxonomy.json is static #38

Closed almereyda closed 7 years ago

almereyda commented 7 years ago

Since the TransforMap Base Query Service is running now, we can get taxonomy.json dynamically from there. Requests can be tested at https://query.base.transformap.co/bigdata/#query

prefix bd: <http://www.bigdata.com/rdf#>
prefix wikibase: <http://wikiba.se/ontology#>
prefix wdt: <http://base.transformap.co/prop/direct/>
prefix wd: <http://base.transformap.co/entity/>

SELECT ?item ?itemLabel ?instance_of ?subclass_of
WHERE { ?item wdt:P8* wd:Q8 .
        ?item wdt:P4 ?instance_of .
        ?item wdt:P8 ?subclass_of
        SERVICE wikibase:label {bd:serviceParam wikibase:language "en" }
}

and then have to be urlencoded for the appropriate query:

curl -H "Accept: application/json" -XGET https://query.base.transformap.co/bigdata/namespce/transformap/sparql?query=prefix%20bd%3A%20%3Chttp%3A%2F%2Fwww.bigdata.com%2Frdf%23%3E%0Aprefix%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0Aprefix%20wdt%3A%20%3Chttp%3A%2F%2Fbase.transformap.co%2Fprop%2Fdirect%2F%3E%0Aprefix%20wd%3A%20%3Chttp%3A%2F%2Fbase.transformap.co%2Fentity%2F%3E%0A%0ASELECT%20%3Fitem%20%3FitemLabel%20%3Finstance_of%20%3Fsubclass_of%0AWHERE%20%7B%20%3Fitem%20wdt%3AP8*%20wd%3AQ8%20.%0A%20%20%20%20%20%20%20%20%3Fitem%20wdt%3AP4%20%3Finstance_of%20.%0A%20%20%20%20%20%20%20%20%3Fitem%20wdt%3AP8%20%3Fsubclass_of%0A%20%20%20%20%20%20%20%20SERVICE%20wikibase%3Alabel%20%7Bbd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%7D%0A%7D%0A
species commented 7 years ago

Fixed with 37501b459f8fceb952dac1bb8f01a6564f0a48ad.

matt-wallis commented 7 years ago

There's a typo in that curl query. You need to s/namespce/namespace/