{"id":13553796,"url":"https://github.com/nichtich/wikidata-taxonomy","last_synced_at":"2026-03-07T14:02:21.728Z","repository":{"id":138804288,"uuid":"64503375","full_name":"nichtich/wikidata-taxonomy","owner":"nichtich","description":"command-line tool to extract taxonomies from Wikidata","archived":false,"fork":false,"pushed_at":"2019-06-19T18:44:56.000Z","size":299,"stargazers_count":130,"open_issues_count":24,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-02-25T03:43:07.011Z","etag":null,"topics":["cli","coli-conc","jskos","library","wikidata"],"latest_commit_sha":null,"homepage":"https://www.npmjs.org/package/wikidata-taxonomy","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nichtich.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-07-29T18:48:09.000Z","updated_at":"2026-02-21T15:10:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d857b62-b34f-41dd-a1b5-8d8ded3fb2c6","html_url":"https://github.com/nichtich/wikidata-taxonomy","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/nichtich/wikidata-taxonomy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichtich%2Fwikidata-taxonomy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichtich%2Fwikidata-taxonomy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichtich%2Fwikidata-taxonomy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichtich%2Fwikidata-taxonomy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nichtich","download_url":"https://codeload.github.com/nichtich/wikidata-taxonomy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichtich%2Fwikidata-taxonomy/sbom","scorecard":{"id":684717,"data":{"date":"2025-08-11","repo":{"name":"github.com/nichtich/wikidata-taxonomy","commit":"97abd4158b3c4ba9cd2c53503ca6b8b2ca29bc2a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T00:24:32.241Z","repository_id":138804288,"created_at":"2025-08-22T00:24:32.245Z","updated_at":"2025-08-22T00:24:32.245Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30216494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T13:35:13.914Z","status":"ssl_error","status_checked_at":"2026-03-07T13:35:13.569Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","coli-conc","jskos","library","wikidata"],"created_at":"2024-08-01T12:02:33.503Z","updated_at":"2026-03-07T14:02:21.691Z","avatar_url":"https://github.com/nichtich.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","cli"],"sub_categories":[],"readme":"# Wikidata-Taxonomy\n\nCommand-line tool and library to extract taxonomies from [Wikidata](https://wikidata.org).\n\n![](https://github.com/nichtich/wikidata-taxonomy/raw/master/img/wdtaxonomy-example.png)\n\n## Installation\n\nwikidata-taxonomy requires at least [NodeJs](https://nodejs.org) version 6.\n\nInstall globally to make command `wdtaxonomy` accessible from your shell `$PATH`:\n\n```sh\n$ npm install -g wikidata-taxonomy\n```\n\nInstallation and usage [as module](#usage-as-module) and [in web applications](#usage-in-web-applications) is described below.\n\n## Usage\n\nThis module provides the command `wdtaxonomy`. By default, a usage help is printed:\n\n```\n$ wdtaxonomy\n\n\n  Usage: wdtaxonomy [options] \u003cid\u003e\n\n  extract taxonomies from Wikidata\n\n\n  Options:\n\n    -V, --version                           output the version number\n    -b, --brief                             omit counting instances and sites\n    -c, --children                          get direct subclasses only\n    -C, --color                             enforce color output\n    -d, --descr                             include item descriptions\n    -e, --sparql-endpoint \u003curl\u003e             customize the SPARQL endpoint\n    -f, --format \u003ctxt|csv|tsv|json|ndjson\u003e  output format\n    -i, --instances                         include instances\n    -I, --no-instancecount                  omit counting instances\n    -j, --json                              use JSON output format\n    -l, --lang \u003clang\u003e                       specify the language to use\n    -L, --no-labels                         omit all labels\n    -m, --mappings \u003cids\u003e                    mapping properties (e.g. P1709)\n    -n, --no-colors                         disable color output\n    -o, --output \u003cfile\u003e                     write result to a file\n    -P, --property \u003cid\u003e                     hierarchy property (e.g. P279)\n    -R, --prune \u003ccriteria\u003e                  prune hierarchies (e.g. mappings)\n    -p, --post                              use HTTP POST to disable caching\n    -r, --reverse                           get superclasses instead\n    -s, --sparql                            print SPARQL query and exit\n    -S, --no-sitecount                      omit counting sites\n    -t, --total                             count total number of instances\n    -u, --user \u003cname\u003e                       user to the SPARQL endpoint\n    -U, --uris                              show full URIs in output formats\n    -v, --verbose                           make the output more verbose\n    -w, --password \u003cstring\u003e                 password to the SPARQL endpoint\n    -h, --help                              output usage information\n```\n\nThe first arguments needs to be a Wikidata identifier to be used as root of the taxonomy. For instance extract a taxonomy of planets ([Q634]):\n\n```sh\n$ wdtaxonomy Q634\n```\n\nTo look up by label, use [wikidata-cli] (e.g `wd id planet` or `wd f planet`).\n\nThe extracted taxonomy by default is based on statements using the property \"subclass of\" ([P279]) or \"subproperty of\" ([P1647]). Taxonomy extraction and output can be controlled by several [options](#options). Option `--sparql` (or `-s`) prints the underlying SPARQL queries instead of executing them.\n\n### Examples\n\n**Direct subclasses of planet ([Q634]) with description and mappings:**\n\n    $ wdtaxonomy Q634 -c -d -m =\n\nThe hierarchy properties [P279] (\"subclass of\") and [P31] (\"instance of\") to build taxonomies from can be changed with option `property` (`-P`).\n\n**Members of ([P463]) the European Union ([Q458]):**\n\n    $ wdtaxonomy Q458 -P P463\n\n**Members of ([P463]) the European Union ([Q458]) and number of its citizens in Wikidata ([P27]):**\n\n    $ wdtaxonomy Q458 -P 463/27\n\n**Wikiversity ([Q370]) editions mapped to their homepage URL ([P856]):**\n\n    $ wdtaxonomy Q370 -i -m P856\n\n**Biological taxonomy of mammals ([Q7377]):**\n\n    $ wdtaxonomy Q7377 -P P171 --brief\n\n**Property constraints ([Q21502402]) with number of properties that have each constraint:**\n\n    $ wdtaxonomy Q21502402 -P 279,2302 \n\nAs Wikidata is no strict ontology, subproperties are not factored in. For instance this query does not include members of the European Union although [P463] is a subproperty of [P361].\n\n**Parts of ([P361]) the European Union ([Q458]):**\n\n    $ wdtaxonomy Q458 -P P361\n\nA taxonomy of subproperties can be queried like taxonomies of items. The hierarchy property is set to [P1647] (\"subproperty of\") by default:\n\n    $ wdtaxonomy P361\n    $ wdtaxonomy P361 -P P1647  # equivalent\n\n**Subproperties of \"part of\" ([P361]) and which of them have an inverse property ([P1696]):**\n\n    $ wdtaxonomy P361 -P P1647/P1696\n\nInverse properties are neither factored in so queries like these do not necessarily return the same results:\n\n**What hand ([Q33767]) is part of ([P361]):**\n\n    $ wdtaxonomy Q33767 -P 361 -r\n\n**What parts the hand ([Q33767]) has ([P527]):**\n\n    $ wdtaxonomy Q33767 -P 527\n\n## Options\n\n### Query options\n\n#### brief (`-b`)\n\nDon't count instance and sites. Same as `-S/--no-sitecount` and `-I/--no-instancecount`.\n\n#### children (`-c`)\n\nGet direct subclasses only\n\n#### descr (`-d`)\n\nInclude item descriptions\n\n#### sparql-endpoint (`-e`)\n\nSPARQL endpoint to query (default: \u003chttps://query.wikidata.org/sparql\u003e)\n\n#### instances (`-i`)\n\nInclude instances\n\n#### no-instancecount (`-I`)\n\nDon't count number of instances\n\n#### lang (`-l`)\n\nLanguage to get labels in (default: `en`)\n\n#### no-labels (`-L`)\n\nOmit all labels. This allows for querying larger taxonomies (several thousands of classes), especially if combined with option `--brief`.\n\n#### mappings (`-m`)\n\nLookup mappings based on given comma-separated properties such as [P1709] (equivalent class). The following keywords can be used as shortcuts:\n\n* `equal` or `=`: equivalent property ([P1628]), equivalent class ([P1709]), and exact match ([P2888])\n* `broader`: external superproperty ([P2235])\n* `narrower`: narrower external class ([P3950]), external subproperty ([P2236])\n* `class`: properties for mapping classes\n* `property`: properties for mapping properties\n* `all` all properties for ontology mapping (instances of [Q30249126])\n\n#### reverse (`-r`)\n\nGet superclasses instead of subclasses up to the root\n\n#### no-sitecount (`-I`)\n\nDon't count number of sites\n\n#### total (`-t`)\n\nCount total (transitive) number of instances, including instances of subclasses\n\n#### post (`-p`)\n\nUse HTTP POST to disable caching\n\n#### sparql (`-s`)\n\nDon't actually perform a query but print SPARQL query and exit\n\n#### user (`-u`)\n\nUser to the SPARQL endpoint\n\n#### password (`-w`)\n\nPassword to the SPARQL endpoint\n\n### Output options\n\n#### color (`-C`)\n\nenable color output if it's disabled (e.g. when output is piped or written to a file)\n\n#### format (`-f`)\n\nOutput format\n\n#### json (`-j`)\n\nUse JSON output format. Same as `--format json` but shorter.\n\n#### no-colors (`-n`)\n\ndisable color output\n\n#### output (`-o`)\n\nwrite result to a file given by name\n\n#### prune (`-R`)\n\nprune hierarchy to all entries with any of a given criteria plus their broader\nconcepts and all top concepts:\n\n* `mappings`:  has mappings\n* `sites`: has sites\n* `instances`: has instances\n* `occurences` : has sites or instances\n\nMultiple criteria can be combined as alternatives with comma.\n\n#### uris (`-U`)\n\nShow full URIs in output formats, e.g. \u003chttp://www.wikidata.org/entity/Q1\u003e instead of `Q1`\n\n#### verbose (`-v`)\n\nShow verbose error messages\n\n## Output formats\n\n### Text format\n\nBy default, the taxonomy is printed in \"`text`\" format with colored Unicode characters:\n\n```sh\n$ wdtaxonomy Q17362350\n```\n```\nplanet of the Solar System (Q17362350) •2 ↑\n├──outer planet (Q30014) •25 ×4 ↑↑\n└──inner planets (Q3504248) •8 ×4 ↑↑\n\n```\n\nThe output contains item labels, Wikidata identifiers, the number of Wikimedia\nsites connected to each item (indicated by bullet character \"`•`\"), the number\nof instances (property [P31]), indicated by a multiplication sign \"`×`\"), and\nan upwards arrow (\"`↑`\") as indicator for additional superclasses.\n\nOption \"`--instances`\" (or \"`-i`\") explicitly includes instances:\n\n```sh\n$ wdtaxonomy -i Q17362350\n```\n```\nplanet of the Solar System (Q17362350) •2 ↑\n├──outer planet (Q30014) •25 ↑↑\n|   -Saturn (Q193)\n|   -Jupiter (Q319)\n|   -Uranus (Q324)\n|   -Neptune (Q332)\n└──inner planets (Q3504248) •8 ↑↑\n    -Earth (Q2)\n    -Mars (Q111)\n    -Mercury (Q308)\n    -Venus (Q313)\n```\n\nClasses that occur at multiple places in the taxonomy (multihierarchy) are marked like in the following example:\n\n```sh\n$ wdtaxonomy Q634\n```\n```\nplanet (Q634) •202 ×7 ↑\n├──extrasolar planet (Q44559) •88 ×833 ↑\n|  ├──circumbinary planet (Q205901) •15 ×10\n|  ├──super-Earth (Q327757) •32 ×46 ↑\n...\n├──terrestrial planet (Q128207) •70 ×7\n|  ╞══super-Earth (Q327757) •32 ×46 ↑ …\n...\n```\n\n### JSON format\n\nOption `--format json` serializes the taxonomy as JSON object. The format follows specification of [JSKOS Concept Schemes](https://gbv.github.io/jskos/jskos.html#concept-schemes):\n\n~~~json\n{\n  \"type\": [ \"http://www.w3.org/2004/02/skos/core#ConceptScheme\" ],\n  \"modified\": \"2017-11-06T10:25:54.966Z\",\n  \"license\": [\n    {\n      \"uri\": \"http://creativecommons.org/publicdomain/zero/1.0/\",\n      \"notation\": [ \"CC0\" ]\n    }\n  ],\n  \"languages\": [ \"en\" ],\n  \"topConcepts\": [\n    { \"uri\": \"http://www.wikidata.org/entity/Q17362350\" }\n  ],\n  \"concepts\": [ ]\n}\n~~~\n\nField `concepts` contains an array of all extracted Wikidata entities (usually classes and instances) as [JSKOS Concepts](https://gbv.github.io/jskos/jskos.html#concepts):\n\n~~~json\n{\n  \"uri\": \"http://www.wikidata.org/entity/Q17362350\",\n  \"notation\": [ \"Q17362350\" ],\n  \"prefLabel\": {\n    \"en\": \"planet of the Solar System\"\n  },\n  \"scopeNote\": {\n    \"en\": [ \"inner and outer planets of our solar system\" ]\n  },\n  \"broader\": [\n    { \"uri\": \"http://www.wikidata.org/entity/Q634\" }\n  ],\n  \"narrower\": [\n    { \"uri\": \"http://www.wikidata.org/entity/Q30014\" },\n    { \"uri\": \"http://www.wikidata.org/entity/Q3504248\" }\n  ]\n}\n~~~\n\nInstances (option `--instances`) are linked via field `subjectOf` the same way as field `broader` and `narrower`. \n\nThe number of instances and sites, if counted is given as array of [JSKOS Concept Occurrences](https://gbv.github.io/jskos/jskos.html#concept-occurrences) in field `occurrences`, each identified by subfield `relation`:\n\n~~~json\n\n{\n  \"uri\": \"http://www.wikidata.org/entity/Q30014\",\n  \"notation\": [ \"Q30014\" ],\n  \"prefLabel\": {\n    \"en\": \"outer planet of the Solar system\"\n  },\n  \"occurrences\": [\n    {\n      \"relation\": \"http://www.wikidata.org/entity/P31\",\n      \"count\": 4\n    },\n    {\n      \"relation\": \"http://schema.org/about\",\n      \"count\": 25\n    }\n  ]\n}\n~~~\n\nMappings (option `--mappings`) are stored in field `mappings` as array of [JSKOS Concept Mappings](https://gbv.github.io/jskos/jskos.html#concept-mappings):\n\n~~~json\n[\n  {\n    \"from\": {\n      \"memberSet\": [\n        { \"uri\": \"http://www.wikidata.org/entity/Q634\" }\n      ]\n    },\n    \"to\": {\n      \"memberSet\": [\n        { \"uri\": \"http://dbpedia.org/ontology/Planet\" }\n      ]\n    },\n    \"type\": [\n      \"http://www.w3.org/2004/02/skos/core#exactMatch\",\n      \"http://www.w3.org/2002/07/owl#equivalentClass\",\n      \"http://www.wikidata.org/entity/P1709\"\n    ]\n  }\n]\n~~~\n\nThe mapping type is given in field `type` with the Wikidata property URI as last array element and the SKOS mapping relation URI as first.\n\n## NDJSON format\n\nOption `--format ndjson` serializes JSON field `concepts` with one record per line. The order if records is same as in txt, json, and csv format but each concept is only included once.\n\n### CSV and TSV format\n\nCSV and TSV format are optimized for comparing differences in\ntime.  Each output row consists of five fields:\n\n* **level** in the hierarchy indicated by zero or more \"`-`\" (default) or \"`=`\"\n  characters (multihierarchy).\n\n* **id** of the item. Items on the same level are sorted by their id.\n\n* **label** of the item. Language can be selected with option `--language`.\n  The label in csv format is quoted.\n\n* **sites**: number of connected sites (Wikipedia and related project editions).\n  Larger numbers may indicate more established concepts.\n\n* **parents** outside of the hierarchy, indicated by zero or more \"`^`\" characters.\n\nFor instance the CSV output for [Q634] would be like this:\n\n```sh\n$ wdtaxonomy -f csv Q634\n```\n```csv\nlevel,id,label,sites,instances,parents\n,Q634,\"planet\",196,7,^\n-,Q44559,\"extrasolar planet\",81,833,^\n--,Q205901,\"circumbinary planet\",14,10,\n--,Q327757,\"super-Earth\",32,46,\n...\n-,Q128207,\"terrestrial planet\",67,7,\n==,Q327757,\"super-Earth\",32,46,\n...\n\n```\n\nIn this example there are 196 Wikipedia editions or other sites with an article\nabout planets and seven Wikidata items are direct instance of a planet. At the\nend of the line \"`^`\" indicates that \"planet\" has one superclass. In the next\nrows \"extrasolar planet\" ([Q44559]) is a subclass of planet with another\nsuperclass indicated by \"`^`\". Both \"circumbinary planet\" and \"super-Earth\" are\nsubclasses of \"extrasolar planet\". The latter also occurs as subclass of\n\"terrestrial planet\" where it is marked by \"`==`\" instead of \"`--`\".\n\n## Usage as module\n\nAdd `wikidata-taxonomy` as dependency to you `package.json`:\n\n```sh\n$ npm install wikidata-taxonomy --save\n```\n\nThe library provides:\n\n* `queryTaxonomy(id, options)` returns a promise with a taxonomy extracted from Wikidata\n  as [JSKOS Concept Scheme](https://gbv.github.io/jskos/jskos.html#concept-schemes). See\n  [JSON format](#json-format) of the command line client for documentation.\n\n    ~~~javascript\n    const { queryTaxonomy } = require('wikidata-taxonomy')\n\n    var options = { lang: 'fr', brief: true }\n    queryTaxonomy('Q634', lang)\n    .then(taxonomy =\u003e {\n      taxonomy.concepts.forEach(concept =\u003e {\n        var qid = concept.notation[0]\n        var label = (concept.prefLabel || {}).fr || '???'\n        console.log('%s %s', qid, label)\n      })\n    })\n    .catch(error =\u003e console.error(\"E\",error))\n    ~~~\n\n    Options roughly equivalent command line [query options](#query-options):\n\n    * boolean flags `brief`, `children`, `description`, `labels`, `total`,\n      `instances`, `instancecount`, `sitecount`, `reverse`, `post`\n    * SPARQL endpoint configuration with `endpoint`, `user`, `password`\n    * language tag `language` or `lang`\n    * array `property` (set to `['P279', 'P31']` by default)\n    * array or string `mappings`\n\n* `serializeTaxonomy` contains serializers to be called with a taxonomy, an output stream,\n  and optional configuration:\n\n    ~~~javascript\n    const { serializeTaxonomy } = require('wikidata-taxonomy')\n\n    // serialize taxonomy to stream\n    serializeTaxonomy.csv(taxonomy, process.stdout)\n    serializeTaxonomy.txt(taxonomy, process.stdout, {colors: true}) // FIXME\n    serializeTaxonomy.json(taxonomy, process.stdout)\n    serializeTaxonomy.ndjson(taxonomy, process.stdout)\n    ~~~\n\n## Usage in web applications\n\nExperimental support of this library in web application is given with file `wikidata-taxonomy.js` in directoy `dist`. The `gh-pages` branch contains a sample application, also available at \u003chttp://jakobvoss.de/wikidata-taxonomy/\u003e.\n\nRequires wikidata-sdk and a HTTP client library. The latter can be attached to `window.requestPromise` (before wikidata-taxonomy is loaded). Axios is detected by default.\n\n~~~html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript src=\"https://unpkg.com/wikidata-sdk/dist/wikidata-sdk.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://unpkg.com/axios/dist/axios.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://unpkg.com/wikidata-taxonomy/dist/wikidata-taxonomy.min.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    ...\n  \u003c/body\u003e\n\u003c/html\u003e\n~~~\n\n## Release notes\n\nRelease notes are listed in file [CHANGES.md](https://github.com/nichtich/wikidata-taxonomy/blob/master/CHANGES.md#changelog) in the source code repository.\n\n## See Also\n\n[![build status](https://api.travis-ci.org/nichtich/wikidata-taxonomy.svg?branch=master)](http://travis-ci.org/nichtich/wikidata-taxonomy)\n[![npm version](http://img.shields.io/npm/v/wikidata-taxonomy.svg?style=flat)](https://www.npmjs.org/package/wikidata-taxonomy)\n[![Documentation Status](https://readthedocs.org/projects/wdtaxonomy/badge/?version=latest)](http://wdtaxonomy.readthedocs.io/en/latest/?badge=latest)\n\n**This document**\n\n* [at GitHub](https://github.com/nichtich/wikidata-taxonomy/blob/master/README.md)\n* [at npmjs](https://www.npmjs.com/package/wikidata-taxonomy)\n* [at Read the Docs](https://wdtaxonomy.readthedocs.io/en/latest/)\n\n**Related tools**\n\n* [wikidata-sdk](https://npmjs.com/package/wikidata-sdk) is used by this module\n* [wikidata-cli] provide more generic command line tools for Wikidata\n* [taxonomy browser](http://sergestratan.bitbucket.org/) is a web application\n  based on Wikidata dumps\n* [Wikidata Graph Builder](https://angryloki.github.io/wikidata-graph-builder/) another web application\n* [wdmapper](https://wdmapper.readthedocs.io/) Wikidata authority file mapping tool\n* [Wikidata ontology explorer](https://lucaswerkmeister.github.io/wikidata-ontology-explorer/)\n\n[wikidata-cli]: https://npmjs.com/package/wikidata-cli\n\n**Publications**\n\n* Jakob Voß (2016): *Classification of Knowledge Organization Systems with Wikidata*. CEUR Workshop Proceedings 1676. \u003chttp://ceur-ws.org/Vol-1676/paper2.pdf\u003e (=[Q27261879])\n\n\n[P1628]: http://www.wikidata.org/entity/P1628\n[P1647]: http://www.wikidata.org/entity/P1647\n[P1696]: http://www.wikidata.org/entity/P1696\n[P1709]: http://www.wikidata.org/entity/P1709\n[P171]: http://www.wikidata.org/entity/P171\n[P2235]: http://www.wikidata.org/entity/P2235\n[P2236]: http://www.wikidata.org/entity/P2236\n[P27]: http://www.wikidata.org/entity/P27\n[P279]: http://www.wikidata.org/entity/P279\n[P2888]: http://www.wikidata.org/entity/P2888\n[P31]: http://www.wikidata.org/entity/P31\n[P361]: http://www.wikidata.org/entity/P361\n[P3950]: http://www.wikidata.org/entity/P3950\n[P463]: http://www.wikidata.org/entity/P463\n[P527]: http://www.wikidata.org/entity/P527\n[P856]: http://www.wikidata.org/entity/P856\n[Q111]: http://www.wikidata.org/entity/Q111\n[Q128207]: http://www.wikidata.org/entity/Q128207\n[Q17362350]: http://www.wikidata.org/entity/Q17362350\n[Q193]: http://www.wikidata.org/entity/Q193\n[Q2]: http://www.wikidata.org/entity/Q2\n[Q205901]: http://www.wikidata.org/entity/Q205901\n[Q21502402]: http://www.wikidata.org/entity/Q21502402\n[Q27261879]: http://www.wikidata.org/entity/Q27261879\n[Q30014]: http://www.wikidata.org/entity/Q30014\n[Q30249126]: http://www.wikidata.org/entity/Q30249126\n[Q308]: http://www.wikidata.org/entity/Q308\n[Q313]: http://www.wikidata.org/entity/Q313\n[Q319]: http://www.wikidata.org/entity/Q319\n[Q324]: http://www.wikidata.org/entity/Q324\n[Q327757]: http://www.wikidata.org/entity/Q327757\n[Q332]: http://www.wikidata.org/entity/Q332\n[Q33767]: http://www.wikidata.org/entity/Q33767\n[Q3504248]: http://www.wikidata.org/entity/Q3504248\n[Q370]: http://www.wikidata.org/entity/Q370\n[Q44559]: http://www.wikidata.org/entity/Q44559\n[Q458]: http://www.wikidata.org/entity/Q458\n[Q634]: http://www.wikidata.org/entity/Q634\n[Q7377]: http://www.wikidata.org/entity/Q7377\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnichtich%2Fwikidata-taxonomy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnichtich%2Fwikidata-taxonomy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnichtich%2Fwikidata-taxonomy/lists"}