Deprecated and archived in favor of https://github.com/dpriskorn/entityshape
Python library to lookup Wikidata items in the entityshape API.
This is the alpha software. Please open an issue if you have any ideas or suggestions or bugs to report.
- validate one item at a time (the API has no batch support).
- determine whether an item is valid according to a certain schema or not
Get it from pypi
$ pip install pyentityshape
Example:
e = EntityShape(eid="E1", lang="en", qid="Q1")
result = e.get_result()
result.is_valid
False|True
result.required_properties_that_are_missing
["P1", "P2"]
The is_valid method on the Result object mimics all red warnings displayed by https://www.wikidata.org/wiki/User:Teester/EntityShape.js
It currently checks these five conditions that all have to be false for the item to be valid:
- properties with too many statements found
- incorrect statements found
- some required properties are missing
- properties without enough correct statements found
- statements with properties that are not allowed found
GPLv3+