Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: read shapes #143

Open
rwst opened this issue Dec 19, 2020 · 2 comments
Open

feature: read shapes #143

rwst opened this issue Dec 19, 2020 · 2 comments

Comments

@rwst
Copy link
Contributor

rwst commented Dec 19, 2020

Wish for next year, make this more useful:

> wd d E233
/usr/lib/node_modules/wikibase-cli/lib/tolerant_id_parser.js:25
  throw errors_.new('invalid id', input)
  ^
maxlath added a commit that referenced this issue May 1, 2021
@maxlath
Copy link
Owner

maxlath commented May 1, 2021

v15.11.0 now offers to download the text version from EntitySchema (via the /wiki/Special:EntitySchemaText, ex: https://www.wikidata.org/wiki/Special:EntitySchemaText/E233) by running wd data E233.

I played with bit with the shex module to see if that could be worth integrating or if there was a workflow to recommend, but I couldn't get this to work: shex-to-json -j https://www.wikidata.org/wiki/Special:EntitySchemaText/E233

aborting: Error: error parsing JSON https://www.wikidata.org/wiki/Special:EntitySchemaText/E233: SyntaxError: Unexpected token P in JSON at position 0
    at parseShExJ (/some/project/node_modules/shex/lib/ShExLoader.js:274:14)
    at /some/project/node_modules/shex/lib/ShExLoader.js:103:14
    at tryCatcher (/some/project/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/some/project/node_modules/bluebird/js/main/promise.js:510:31)
    at Promise._settlePromiseAt (/some/project/node_modules/bluebird/js/main/promise.js:584:18)
    at Promise._settlePromises (/some/project/node_modules/bluebird/js/main/promise.js:700:14)
    at Async._drainQueue (/some/project/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/some/project/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues (/some/project/node_modules/bluebird/js/main/async.js:15:14)
    at processImmediate (internal/timers.js:461:21)

Any clue on what's wrong?

@rwst
Copy link
Contributor Author

rwst commented May 3, 2021

Using this script:

from pyshexc.parser_impl.generate_shexj import generate
generate(['-nr', './E233'])

the file parses successfully and generates JSONLD, so it seems your parser does not do its job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants