Skip to content

Commit

Permalink
version 0.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
andrawaag committed Aug 25, 2021
1 parent df6256d commit f4015e2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

VERSION = "0.9.6"
VERSION = "0.9.7"

setup(
name='wikidataintegrator',
Expand Down
29 changes: 0 additions & 29 deletions wikidataintegrator/wdi_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,35 +1219,6 @@ def get_sitelink(self, site):
else:
return None

def check_shex_conformance(self, eid, entity_schema_repo=None, output='confirm'):
"""
Static method which can be used to check for conformance of a Wikidata item to an EntitySchema any SPARQL query
:param eid: The EntitySchema identifier from Wikidata
:param output: results of a test of conformance on a given shape expression
:return: The results of the query are returned in string format
"""

entity_schema_repo = config["ENTITY_SCHEMA_REPO"] if entity_schema_repo is None else entity_schema_repo
schema = requests.get(entity_schema_repo + eid).text
self.
rdfdata = Graph()
rdfdata.parse(config["CONCEPT_BASE_URI"] + qid + ".ttl")

for result in ShExEvaluator(rdf=rdfdata, schema=schema, focus=config["CONCEPT_BASE_URI"] + qid).evaluate():
shex_result = dict()
if result.result:
shex_result["result"] = True
else:
shex_result["result"] = False
shex_result["reason"] = result.reason
shex_result["focus"] = result.focus

if output == "confirm":
return shex_result["result"]
elif output == "reason":
return shex_result["reason"]
else:
return shex_result

def write(self, login, bot_account=True, edit_summary='', entity_type='item', property_datatype='string',
max_retries=1000, retry_after=60):
Expand Down

0 comments on commit f4015e2

Please sign in to comment.