pyLodStorage 0.4.4__tar.gz → 0.4.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {pylodstorage-0.4.4/pylodstorage.egg-info → pylodstorage-0.4.5}/PKG-INFO +1 -1
  2. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/trulytabular.py +7 -5
  3. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/version.py +2 -2
  4. {pylodstorage-0.4.4 → pylodstorage-0.4.5/pylodstorage.egg-info}/PKG-INFO +1 -1
  5. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/LICENSE +0 -0
  6. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/README.md +0 -0
  7. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/__init__.py +0 -0
  8. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/csv.py +0 -0
  9. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/entity.py +0 -0
  10. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/jsonable.py +0 -0
  11. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/jsonpicklemixin.py +0 -0
  12. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/lod.py +0 -0
  13. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/mwTable.py +0 -0
  14. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/plot.py +0 -0
  15. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/query.py +0 -0
  16. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/querymain.py +0 -0
  17. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/sample.py +0 -0
  18. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/schema.py +0 -0
  19. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/sparql.py +0 -0
  20. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/sql.py +0 -0
  21. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/storageconfig.py +0 -0
  22. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/tabulateCounter.py +0 -0
  23. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/uml.py +0 -0
  24. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/xml.py +0 -0
  25. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/lodstorage/yamlablemixin.py +0 -0
  26. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/pylodstorage.egg-info/SOURCES.txt +0 -0
  27. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/pylodstorage.egg-info/dependency_links.txt +0 -0
  28. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/pylodstorage.egg-info/entry_points.txt +0 -0
  29. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/pylodstorage.egg-info/requires.txt +0 -0
  30. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/pylodstorage.egg-info/top_level.txt +0 -0
  31. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/sampledata/__init__.py +0 -0
  32. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/sampledata/endpoints.yaml +0 -0
  33. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/sampledata/formats.yaml +0 -0
  34. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/sampledata/got.yaml +0 -0
  35. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/sampledata/queries.yaml +0 -0
  36. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/sampledata/scholia.yaml +0 -0
  37. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/sampledata/trulytabular.yaml +0 -0
  38. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/sampledata/wf.yaml +0 -0
  39. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/sampledata/wikidata.yaml +0 -0
  40. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/setup.cfg +0 -0
  41. {pylodstorage-0.4.4 → pylodstorage-0.4.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pylodstorage
3
- Version: 0.4.4
3
+ Version: 0.4.5
4
4
  Summary: python List of Dict (Table) Storage library
5
5
  Home-page: https://github.com/WolfgangFahl/pyLodStorage
6
6
  Author: Wolfgang Fahl
@@ -323,7 +323,7 @@ class TrulyTabular(object):
323
323
  checks "how tabular" a query based on a list of properties of an itemclass is
324
324
  '''
325
325
 
326
- def __init__(self, itemQid, propertyLabels:list=[],propertyIds:list=[],where:str=None,endpointConf=None,lang="en",debug=False):
326
+ def __init__(self, itemQid, propertyLabels:list=[],propertyIds:list=[],subclassPredicate="wdt:P31",where:str=None,endpointConf=None,lang="en",debug=False):
327
327
  '''
328
328
  Constructor
329
329
 
@@ -331,6 +331,7 @@ class TrulyTabular(object):
331
331
  itemQid(str): wikidata id of the type to analyze
332
332
  propertyLabels(list): a list of labels of properties to be considered
333
333
  propertyIds(list): a list of ids of properties to be considered
334
+ subclassPredicate(str): the subclass Predicate to use
334
335
  where(str): extra where clause for instance selection (if any)
335
336
  endpoint(str): the url of the SPARQL endpoint to be used
336
337
  '''
@@ -341,6 +342,7 @@ class TrulyTabular(object):
341
342
  self.endpointConf=endpointConf
342
343
  self.sparql=SPARQL(endpointConf.endpoint,method=self.endpointConf.method)
343
344
  self.sparql.debug=self.debug
345
+ self.subclassPredicate=subclassPredicate
344
346
  self.where=f"\n {where}" if where is not None else ""
345
347
  self.lang=lang
346
348
  self.item=WikidataItem(itemQid,sparql=self.sparql,lang=lang)
@@ -369,7 +371,7 @@ SELECT (COUNT (DISTINCT ?item) AS ?count)
369
371
  WHERE
370
372
  {{
371
373
  # instance of {self.item.qlabel}
372
- ?item wdt:P31 wd:{self.item.qid}.{self.where}
374
+ ?item {self.subclassPredicate} wd:{self.item.qid}.{self.where}
373
375
  }}"""
374
376
  try:
375
377
  count=self.sparql.getValue(query, "count")
@@ -471,7 +473,7 @@ SELECT ?{item.itemVarname} ?{item.labelVarname}"""
471
473
  sparqlQuery+=f"""
472
474
  WHERE {{
473
475
  # instanceof {item.qid}:{item.qlabel}
474
- ?{item.itemVarname} wdt:P31 wd:{item.qid}.
476
+ ?{item.itemVarname} {self.subclassPredicate} wd:{item.qid}.
475
477
  # label
476
478
  ?{item.itemVarname} rdfs:label ?{item.labelVarname}.
477
479
  FILTER (LANG(?{item.labelVarname}) = "{lang}").
@@ -525,7 +527,7 @@ WHERE {{
525
527
  whereClause(str): an extra WhereClause to use
526
528
  '''
527
529
  if whereClause is None:
528
- whereClause=f"?item wdt:P31 wd:{self.itemQid}";
530
+ whereClause=f"?item {self.subclassPredicate} wd:{self.itemQid}";
529
531
  if self.endpointConf.database!="qlever":
530
532
  whereClause+=";?p ?id"
531
533
  whereClause+="."
@@ -589,7 +591,7 @@ ORDER BY DESC (?count)
589
591
  WHERE
590
592
  {{
591
593
  # instance of {self.item.qlabel}
592
- ?item wdt:P31 wd:{self.itemQid}.{self.where}
594
+ ?item {self.subclassPredicate} wd:{self.itemQid}.{self.where}
593
595
  ?item rdfs:label ?itemLabel.
594
596
  FILTER (LANG(?itemLabel) = "{self.lang}").
595
597
  # {propertyLabel}
@@ -9,7 +9,7 @@ class Version(object):
9
9
  Version handling for pyLoDStorage
10
10
  '''
11
11
  name="pylodstorage"
12
- version='0.4.4'
12
+ version='0.4.5'
13
13
  date = '2020-09-10'
14
- updated = '2022-08-04'
14
+ updated = '2022-08-07'
15
15
  description='python List of Dict (Table) Storage library'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pylodstorage
3
- Version: 0.4.4
3
+ Version: 0.4.5
4
4
  Summary: python List of Dict (Table) Storage library
5
5
  Home-page: https://github.com/WolfgangFahl/pyLodStorage
6
6
  Author: Wolfgang Fahl
File without changes
File without changes
File without changes
File without changes