pyLodStorage 0.2.10__tar.gz → 0.2.12__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.
- {pylodstorage-0.2.10/pylodstorage.egg-info → pylodstorage-0.2.12}/PKG-INFO +1 -1
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/querymain.py +11 -1
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/trulytabular.py +2 -1
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/version.py +2 -2
- {pylodstorage-0.2.10 → pylodstorage-0.2.12/pylodstorage.egg-info}/PKG-INFO +1 -1
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/LICENSE +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/README.md +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/__init__.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/csv.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/entity.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/jsonable.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/jsonpicklemixin.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/lod.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/mwTable.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/plot.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/query.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/sample.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/schema.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/sparql.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/sql.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/storageconfig.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/tabulateCounter.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/uml.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/xml.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/lodstorage/yamlablemixin.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/pylodstorage.egg-info/SOURCES.txt +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/pylodstorage.egg-info/dependency_links.txt +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/pylodstorage.egg-info/entry_points.txt +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/pylodstorage.egg-info/requires.txt +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/pylodstorage.egg-info/top_level.txt +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/sampledata/__init__.py +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/sampledata/endpoints.yaml +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/sampledata/formats.yaml +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/sampledata/queries.yaml +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/sampledata/scholia.yaml +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/sampledata/trulytabular.yaml +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/sampledata/wf.yaml +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/sampledata/wikidata.yaml +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/setup.cfg +0 -0
- {pylodstorage-0.2.10 → pylodstorage-0.2.12}/setup.py +0 -0
|
@@ -4,6 +4,7 @@ Created on 2022-02-13
|
|
|
4
4
|
@author: wf
|
|
5
5
|
'''
|
|
6
6
|
from lodstorage.version import Version
|
|
7
|
+
from pathlib import Path
|
|
7
8
|
__version__ = Version.version
|
|
8
9
|
__date__ = Version.date
|
|
9
10
|
__updated__ = Version.updated
|
|
@@ -20,7 +21,7 @@ from argparse import ArgumentParser
|
|
|
20
21
|
from argparse import RawDescriptionHelpFormatter
|
|
21
22
|
|
|
22
23
|
from lodstorage.csv import CSV
|
|
23
|
-
from lodstorage.query import QueryManager, EndpointManager, Format, ValueFormatter
|
|
24
|
+
from lodstorage.query import Query,QueryManager, EndpointManager, Format, ValueFormatter
|
|
24
25
|
from lodstorage.sparql import SPARQL
|
|
25
26
|
from lodstorage.sql import SQLDB
|
|
26
27
|
from lodstorage.xml import Lod2Xml
|
|
@@ -42,6 +43,7 @@ class QueryMain:
|
|
|
42
43
|
debug=args.debug
|
|
43
44
|
endpoints=EndpointManager.getEndpoints(args.endpointPath)
|
|
44
45
|
qm=QueryManager(lang=args.language,debug=debug,queriesPath=args.queriesPath)
|
|
46
|
+
query=None
|
|
45
47
|
queryCode=args.query
|
|
46
48
|
endpointConf=None
|
|
47
49
|
formats=None
|
|
@@ -66,6 +68,13 @@ class QueryMain:
|
|
|
66
68
|
if debug or args.showQuery:
|
|
67
69
|
if hasattr(query, "description") and query.description is not None:
|
|
68
70
|
print(query.description)
|
|
71
|
+
if query is None:
|
|
72
|
+
name="?"
|
|
73
|
+
if queryCode is None and args.queryFile is not None:
|
|
74
|
+
queryFilePath=Path(args.queryFile)
|
|
75
|
+
queryCode = queryFilePath.read_text()
|
|
76
|
+
name=queryFilePath.stem
|
|
77
|
+
query=Query(name="?",query=queryCode,lang=args.language)
|
|
69
78
|
if queryCode:
|
|
70
79
|
if debug or args.showQuery:
|
|
71
80
|
print(f"{args.language}:\n{queryCode}")
|
|
@@ -199,6 +208,7 @@ USAGE
|
|
|
199
208
|
parser.add_argument('-sq','--showQuery',action="store_true",help="show the query")
|
|
200
209
|
parser.add_argument('-qp', '--queriesPath',help="path to YAML file with query definitions")
|
|
201
210
|
parser.add_argument("-q", "--query",help="the query to run")
|
|
211
|
+
parser.add_argument("-qf", "--queryFile",help="the query file to run")
|
|
202
212
|
parser.add_argument("-qn","--queryName",help="run a named query")
|
|
203
213
|
parser.add_argument("-raw",action="store_true", help="return the raw query result from the endpoint. (MIME type defined over -f or -m)")
|
|
204
214
|
parser.add_argument('-V', '--version', action='version', version=program_version_message)
|
|
@@ -135,6 +135,7 @@ class WikidataItem:
|
|
|
135
135
|
sparql(SPARQL): the sparql access to use
|
|
136
136
|
'''
|
|
137
137
|
self.qid=qid
|
|
138
|
+
self.url=f"https://www.wikidata.org/wiki/{self.qid}"
|
|
138
139
|
self.lang=lang
|
|
139
140
|
self.sparql=sparql
|
|
140
141
|
if sparql is not None:
|
|
@@ -163,7 +164,7 @@ class WikidataItem:
|
|
|
163
164
|
desc=textwrap.fill(desc,width=wrapAt)
|
|
164
165
|
text+=f"☞{desc}"
|
|
165
166
|
if long:
|
|
166
|
-
text+=f"→
|
|
167
|
+
text+=f"→ {self.url}"
|
|
167
168
|
return text
|
|
168
169
|
|
|
169
170
|
@classmethod
|
|
@@ -9,7 +9,7 @@ class Version(object):
|
|
|
9
9
|
Version handling for pyLoDStorage
|
|
10
10
|
'''
|
|
11
11
|
name="pylodstorage"
|
|
12
|
-
version='0.2.
|
|
12
|
+
version='0.2.12'
|
|
13
13
|
date = '2020-09-10'
|
|
14
|
-
updated = '2022-07-
|
|
14
|
+
updated = '2022-07-27'
|
|
15
15
|
description='python List of Dict (Table) Storage library'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|