pyLodStorage 0.3.11__tar.gz → 0.3.14__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.3.11/pylodstorage.egg-info → pylodstorage-0.3.14}/PKG-INFO +1 -1
  2. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/query.py +13 -5
  3. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/trulytabular.py +7 -3
  4. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/version.py +1 -1
  5. {pylodstorage-0.3.11 → pylodstorage-0.3.14/pylodstorage.egg-info}/PKG-INFO +1 -1
  6. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/LICENSE +0 -0
  7. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/README.md +0 -0
  8. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/__init__.py +0 -0
  9. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/csv.py +0 -0
  10. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/entity.py +0 -0
  11. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/jsonable.py +0 -0
  12. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/jsonpicklemixin.py +0 -0
  13. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/lod.py +0 -0
  14. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/mwTable.py +0 -0
  15. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/plot.py +0 -0
  16. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/querymain.py +0 -0
  17. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/sample.py +0 -0
  18. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/schema.py +0 -0
  19. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/sparql.py +0 -0
  20. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/sql.py +0 -0
  21. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/storageconfig.py +0 -0
  22. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/tabulateCounter.py +0 -0
  23. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/uml.py +0 -0
  24. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/xml.py +0 -0
  25. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/lodstorage/yamlablemixin.py +0 -0
  26. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/pylodstorage.egg-info/SOURCES.txt +0 -0
  27. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/pylodstorage.egg-info/dependency_links.txt +0 -0
  28. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/pylodstorage.egg-info/entry_points.txt +0 -0
  29. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/pylodstorage.egg-info/requires.txt +0 -0
  30. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/pylodstorage.egg-info/top_level.txt +0 -0
  31. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/sampledata/__init__.py +0 -0
  32. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/sampledata/endpoints.yaml +0 -0
  33. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/sampledata/formats.yaml +0 -0
  34. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/sampledata/got.yaml +0 -0
  35. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/sampledata/queries.yaml +0 -0
  36. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/sampledata/scholia.yaml +0 -0
  37. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/sampledata/trulytabular.yaml +0 -0
  38. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/sampledata/wf.yaml +0 -0
  39. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/sampledata/wikidata.yaml +0 -0
  40. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/setup.cfg +0 -0
  41. {pylodstorage-0.3.11 → pylodstorage-0.3.14}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pylodstorage
3
- Version: 0.3.11
3
+ Version: 0.3.14
4
4
  Summary: python List of Dict (Table) Storage library
5
5
  Home-page: https://github.com/WolfgangFahl/pyLodStorage
6
6
  Author: Wolfgang Fahl
@@ -548,9 +548,13 @@ class EndpointManager(object):
548
548
  """
549
549
 
550
550
  @staticmethod
551
- def getEndpoints(endpointPath=None):
551
+ def getEndpoints(endpointPath:str=None,lang:str=None):
552
552
  '''
553
- get the queries for thee given queries Path
553
+ get the endpoints for the given endpointPath
554
+
555
+ Args:
556
+ endpointPath(str): the path to the yaml file with the endpoint configurations
557
+ lang(str): if lang is given filter by the given language
554
558
  '''
555
559
  endpointPaths=YamlPath.getPaths("endpoints.yaml",endpointPath)
556
560
  endpoints={}
@@ -558,9 +562,13 @@ class EndpointManager(object):
558
562
  with open(lEndpointPath, 'r') as stream:
559
563
  endpointRecords = yaml.safe_load(stream)
560
564
  for name, record in endpointRecords.items():
561
- endpoint=Endpoint()
562
- endpoint.fromDict({"name": name, **record})
563
- endpoints[name]=endpoint
565
+ select=True
566
+ if lang is not None:
567
+ select=record["lang"]==lang
568
+ if select:
569
+ endpoint=Endpoint()
570
+ endpoint.fromDict({"name": name, **record})
571
+ endpoints[name]=endpoint
564
572
  return endpoints
565
573
 
566
574
  @staticmethod
@@ -503,7 +503,7 @@ WHERE {{
503
503
  sparqlQuery+=f"\n)"
504
504
  return sparqlQuery
505
505
 
506
- def mostFrequentPropertiesQuery(self,whereClause:str=None):
506
+ def mostFrequentPropertiesQuery(self,whereClause:str=None,minCount:int=0):
507
507
  '''
508
508
  get the most frequently used properties
509
509
 
@@ -515,6 +515,9 @@ WHERE {{
515
515
  if self.endpointConf.database!="qlever":
516
516
  whereClause+=";?p ?id"
517
517
  whereClause+="."
518
+ minCountFilter=""
519
+ if minCount>0:
520
+ minCountFilter=f"\n FILTER(?count >{minCount})."
518
521
  itemText=self.getItemText()
519
522
  sparqlQuery=f"""# get the most frequently used properties for
520
523
  # {itemText}
@@ -546,7 +549,7 @@ SELECT ?prop ?propLabel ?count WHERE {{
546
549
  }}"""
547
550
  sparqlQuery+=f"""
548
551
  ?prop rdfs:label ?propLabel.
549
- FILTER(LANG(?propLabel) = "{self.lang}")
552
+ FILTER(LANG(?propLabel) = "{self.lang}").{minCountFilter}
550
553
  }}
551
554
  ORDER BY DESC (?count)
552
555
  """
@@ -590,7 +593,8 @@ ORDER BY DESC (?frequency)"""
590
593
  sparql=f"""{sparql}
591
594
  HAVING (COUNT (?value) > 1)
592
595
  ORDER BY DESC(?count)"""
593
- sparql=f"""# Count all {self.asText(long=True)} items
596
+ itemText=self.getItemText()
597
+ sparql=f"""# Count all {itemText} items
594
598
  # with the given {propertyLabel}({propertyId}) https://www.wikidata.org/wiki/Property:{propertyId}
595
599
  {WikidataItem.getPrefixes()}
596
600
  """+sparql
@@ -9,7 +9,7 @@ class Version(object):
9
9
  Version handling for pyLoDStorage
10
10
  '''
11
11
  name="pylodstorage"
12
- version='0.3.11'
12
+ version='0.3.14'
13
13
  date = '2020-09-10'
14
14
  updated = '2022-08-02'
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.3.11
3
+ Version: 0.3.14
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