mustrd 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl
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.
- mustrd/README.adoc +0 -177
- mustrd/TestResult.py +1 -1
- mustrd/mustrd.py +90 -99
- mustrd/mustrdAnzo.py +30 -15
- mustrd/mustrdTestPlugin.py +48 -41
- mustrd/namespace.py +9 -8
- mustrd/run.py +3 -4
- mustrd/spec_component.py +109 -98
- mustrd/test/test_mustrd.py +1 -1
- mustrd/utils.py +1 -0
- {mustrd-0.2.1.dist-info → mustrd-0.2.2.dist-info}/METADATA +10 -5
- {mustrd-0.2.1.dist-info → mustrd-0.2.2.dist-info}/RECORD +15 -15
- {mustrd-0.2.1.dist-info → mustrd-0.2.2.dist-info}/LICENSE +0 -0
- {mustrd-0.2.1.dist-info → mustrd-0.2.2.dist-info}/WHEEL +0 -0
- {mustrd-0.2.1.dist-info → mustrd-0.2.2.dist-info}/entry_points.txt +0 -0
mustrd/mustrdAnzo.py
CHANGED
@@ -51,13 +51,16 @@ def query_with_bindings(bindings: dict, when: str) -> str:
|
|
51
51
|
split_query = when.lower().split("where {", 1)
|
52
52
|
return f"{split_query[0].strip()} WHERE {{ {values} {split_query[1].strip()}"
|
53
53
|
|
54
|
-
|
54
|
+
|
55
|
+
def execute_select(triple_store: dict, when: str, bindings: dict = None) -> str:
|
55
56
|
try:
|
56
57
|
if bindings:
|
57
58
|
when = query_with_bindings(bindings, when)
|
58
59
|
when = when.replace("${fromSources}", f"FROM <{triple_store['input_graph']}>\nFROM <{triple_store['output_graph']}>").replace(
|
59
60
|
"${targetGraph}", f"<{triple_store['output_graph']}>")
|
60
61
|
data = {'datasourceURI': triple_store['gqe_uri'], 'query': when,
|
62
|
+
'default-graph-uri': triple_store['input_graph'],
|
63
|
+
'named-graph-uri': triple_store['input_graph'],
|
61
64
|
'skipCache': 'true'}
|
62
65
|
url = f"https://{triple_store['url']}:{triple_store['port']}/sparql?format=application/sparql-results+json"
|
63
66
|
return manage_anzo_response(requests.post(url=url,
|
@@ -67,6 +70,7 @@ def execute_select (triple_store: dict, when: str, bindings: dict = None) -> st
|
|
67
70
|
except (ConnectionError, TimeoutError, HTTPError, ConnectTimeout):
|
68
71
|
raise
|
69
72
|
|
73
|
+
|
70
74
|
def execute_update(triple_store: dict, when: str, bindings: dict = None) -> Graph:
|
71
75
|
logging.debug(f"updating in anzo! {triple_store=} {when=}")
|
72
76
|
input_graph = triple_store['input_graph']
|
@@ -75,8 +79,11 @@ def execute_update(triple_store: dict, when: str, bindings: dict = None) -> Grap
|
|
75
79
|
substituted_query = when.replace("${usingSources}", f"USING <{triple_store['input_graph']}> \nUSING <{triple_store['output_graph']}>").replace(
|
76
80
|
"${targetGraph}", f"<{output_graph}>")
|
77
81
|
|
78
|
-
data = {'datasourceURI': triple_store['gqe_uri'],
|
79
|
-
|
82
|
+
data = {'datasourceURI': triple_store['gqe_uri'],
|
83
|
+
'update': substituted_query,
|
84
|
+
'using-graph-uri': [output_graph, input_graph],
|
85
|
+
'using-named-graph-uri': [output_graph, input_graph],
|
86
|
+
'skipCache': 'true'}
|
80
87
|
url = f"https://{triple_store['url']}:{triple_store['port']}/sparql?format=ttl"
|
81
88
|
response = manage_anzo_response(requests.post(url=url,
|
82
89
|
auth=(triple_store['username'],
|
@@ -85,7 +92,9 @@ def execute_update(triple_store: dict, when: str, bindings: dict = None) -> Grap
|
|
85
92
|
verify=False))
|
86
93
|
logging.debug(f'response {response}')
|
87
94
|
check_data = {'datasourceURI': triple_store['gqe_uri'], 'query': "construct {?s ?p ?o} { ?s ?p ?o }",
|
88
|
-
'default-graph-uri': output_graph,
|
95
|
+
'default-graph-uri': output_graph,
|
96
|
+
'named-graph-uri': output_graph,
|
97
|
+
'skipCache': 'true'}
|
89
98
|
everything_response = manage_anzo_response(requests.post(url=url,
|
90
99
|
auth=(triple_store['username'],
|
91
100
|
triple_store['password']),
|
@@ -102,7 +111,9 @@ def execute_construct(triple_store: dict, when: str, bindings: dict = None) -> G
|
|
102
111
|
if bindings:
|
103
112
|
when = query_with_bindings(bindings, when)
|
104
113
|
data = {'datasourceURI': triple_store['gqe_uri'], 'query': when,
|
105
|
-
'default-graph-uri': triple_store['input_graph'],
|
114
|
+
'default-graph-uri': triple_store['input_graph'],
|
115
|
+
'named-graph-uri': triple_store['input_graph'],
|
116
|
+
'skipCache': 'true'}
|
106
117
|
url = f"https://{triple_store['url']}:{triple_store['port']}/sparql?format=ttl"
|
107
118
|
response = requests.post(url=url,
|
108
119
|
auth=(triple_store['username'],
|
@@ -110,7 +121,9 @@ def execute_construct(triple_store: dict, when: str, bindings: dict = None) -> G
|
|
110
121
|
data=data,
|
111
122
|
verify=False)
|
112
123
|
logging.debug(f'response {response}')
|
113
|
-
|
124
|
+
g = Graph().parse(data=manage_anzo_response(response))
|
125
|
+
logging.debug(f"Actual Result = {g.serialize(format='ttl')}")
|
126
|
+
return g
|
114
127
|
except (ConnectionError, TimeoutError, HTTPError, ConnectTimeout) as e:
|
115
128
|
logging.error(f'response {e}')
|
116
129
|
raise
|
@@ -119,7 +132,7 @@ def execute_construct(triple_store: dict, when: str, bindings: dict = None) -> G
|
|
119
132
|
# Get Given or then from the content of a graphmart
|
120
133
|
def get_spec_component_from_graphmart(triple_store: dict, graphmart: URIRef, layer: URIRef = None) -> ConjunctiveGraph:
|
121
134
|
try:
|
122
|
-
anzo_client = AnzoClient(triple_store['url'], triple_store['port'],
|
135
|
+
anzo_client = AnzoClient(triple_store['url'], triple_store['port'],
|
123
136
|
username=triple_store['username'],
|
124
137
|
password=triple_store['password'])
|
125
138
|
return anzo_client.query_graphmart(graphmart=graphmart,
|
@@ -140,10 +153,10 @@ def get_query_from_querybuilder(triple_store: dict, folder_name: Literal, query_
|
|
140
153
|
?queryFolder a <http://www.cambridgesemantics.com/ontologies/QueryPlayground#QueryFolder>;
|
141
154
|
<http://purl.org/dc/elements/1.1/title> "{folder_name}"
|
142
155
|
}}"""
|
143
|
-
anzo_client = AnzoClient(triple_store['url'], triple_store['port'],
|
156
|
+
anzo_client = AnzoClient(triple_store['url'], triple_store['port'],
|
144
157
|
username=triple_store['username'],
|
145
158
|
password=triple_store['password'])
|
146
|
-
|
159
|
+
|
147
160
|
result = anzo_client.query_journal(query_string=query).as_table_results().as_record_dictionaries()
|
148
161
|
if len(result) == 0:
|
149
162
|
raise FileNotFoundError(f"Query {query_name} not found in folder {folder_name}")
|
@@ -158,7 +171,7 @@ def get_query_from_step(triple_store: dict, query_step_uri: URIRef) -> str:
|
|
158
171
|
<http://cambridgesemantics.com/ontologies/Graphmarts#transformQuery> ?query
|
159
172
|
}}
|
160
173
|
# """
|
161
|
-
anzo_client = AnzoClient(triple_store['url'], triple_store['port'],
|
174
|
+
anzo_client = AnzoClient(triple_store['url'], triple_store['port'],
|
162
175
|
username=triple_store['username'],
|
163
176
|
password=triple_store['password'])
|
164
177
|
record_dictionaries = anzo_client.query_journal(query_string=query).as_table_results().as_record_dictionaries()
|
@@ -175,7 +188,7 @@ def get_queries_from_templated_step(triple_store: dict, query_step_uri: URIRef)
|
|
175
188
|
<http://cambridgesemantics.com/ontologies/Graphmarts#template> ?query_template .
|
176
189
|
}}
|
177
190
|
"""
|
178
|
-
anzo_client = AnzoClient(triple_store['url'], triple_store['port'],
|
191
|
+
anzo_client = AnzoClient(triple_store['url'], triple_store['port'],
|
179
192
|
username=triple_store['username'],
|
180
193
|
password=triple_store['password'])
|
181
194
|
record_dictionaries = anzo_client.query_journal(query_string=query).as_table_results().as_record_dictionaries()
|
@@ -189,7 +202,7 @@ SELECT ?query ?param_query ?query_template
|
|
189
202
|
{{ <{graphmart_layer_uri}> graphmarts:step ?step .
|
190
203
|
?step anzo:index ?index ;
|
191
204
|
anzo:orderedValue ?query_step .
|
192
|
-
?query_step graphmarts:enabled true ;
|
205
|
+
?query_step graphmarts:enabled true ;
|
193
206
|
OPTIONAL {{ ?query_step
|
194
207
|
graphmarts:parametersTemplate ?param_query ;
|
195
208
|
graphmarts:template ?query_template ;
|
@@ -199,7 +212,7 @@ SELECT ?query ?param_query ?query_template
|
|
199
212
|
. }}
|
200
213
|
}}
|
201
214
|
ORDER BY ?index"""
|
202
|
-
anzo_client = AnzoClient(triple_store['url'], triple_store['port'],
|
215
|
+
anzo_client = AnzoClient(triple_store['url'], triple_store['port'],
|
203
216
|
username=triple_store['username'],
|
204
217
|
password=triple_store['password'])
|
205
218
|
return anzo_client.query_journal(query_string=query).as_table_results().as_record_dictionaries()
|
@@ -215,7 +228,10 @@ def upload_given(triple_store: dict, given: Graph):
|
|
215
228
|
clear_graph(triple_store, output_graph)
|
216
229
|
serialized_given = given.serialize(format="nt")
|
217
230
|
insert_query = f"INSERT DATA {{graph <{triple_store['input_graph']}>{{{serialized_given}}}}}"
|
218
|
-
data = {'datasourceURI': triple_store['gqe_uri'],
|
231
|
+
data = {'datasourceURI': triple_store['gqe_uri'],
|
232
|
+
'update': insert_query,
|
233
|
+
'using-graph-uri': input_graph,
|
234
|
+
'using-named-graph-uri': input_graph}
|
219
235
|
response = requests.post(url=f"https://{triple_store['url']}:{triple_store['port']}/sparql",
|
220
236
|
auth=(triple_store['username'], triple_store['password']), data=data, verify=False)
|
221
237
|
manage_anzo_response(response)
|
@@ -233,4 +249,3 @@ def clear_graph(triple_store: dict, graph_uri: str):
|
|
233
249
|
manage_anzo_response(response)
|
234
250
|
except (ConnectionError, TimeoutError, HTTPError, ConnectTimeout):
|
235
251
|
raise
|
236
|
-
|
mustrd/mustrdTestPlugin.py
CHANGED
@@ -85,37 +85,44 @@ def pytest_configure(config) -> None:
|
|
85
85
|
if config.getoption("mustrd"):
|
86
86
|
test_configs = parse_config(config.getoption("configpath"))
|
87
87
|
config.pluginmanager.register(MustrdTestPlugin(config.getoption("mdpath"),
|
88
|
-
|
89
|
-
|
88
|
+
test_configs, config.getoption("secrets")))
|
89
|
+
|
90
|
+
|
90
91
|
def parse_config(config_path):
|
91
92
|
test_configs = []
|
92
93
|
config_graph = Graph().parse(config_path)
|
93
94
|
shacl_graph = Graph().parse(Path(os.path.join(mustrd_root, "model/mustrdTestShapes.ttl")))
|
94
95
|
ont_graph = Graph().parse(Path(os.path.join(mustrd_root, "model/mustrdTestOntology.ttl")))
|
95
96
|
conforms, results_graph, results_text = validate(
|
96
|
-
data_graph=
|
97
|
-
shacl_graph
|
98
|
-
ont_graph
|
99
|
-
advanced=
|
100
|
-
inference=
|
97
|
+
data_graph=config_graph,
|
98
|
+
shacl_graph=shacl_graph,
|
99
|
+
ont_graph=ont_graph,
|
100
|
+
advanced=True,
|
101
|
+
inference='none'
|
101
102
|
)
|
102
103
|
if not conforms:
|
103
|
-
raise ValueError(f"Mustrd test configuration not conform to the shapes. SHACL report: {results_text}",
|
104
|
-
|
104
|
+
raise ValueError(f"Mustrd test configuration not conform to the shapes. SHACL report: {results_text}",
|
105
|
+
results_graph)
|
106
|
+
|
105
107
|
for test_config_subject in config_graph.subjects(predicate=RDF.type, object=MUSTRDTEST.MustrdTest):
|
106
108
|
spec_path = get_config_param(config_graph, test_config_subject, MUSTRDTEST.hasSpecPath, str)
|
107
109
|
data_path = get_config_param(config_graph, test_config_subject, MUSTRDTEST.hasDataPath, str)
|
108
110
|
triplestore_spec_path = get_config_param(config_graph, test_config_subject, MUSTRDTEST.triplestoreSpecPath, str)
|
109
111
|
pytest_path = get_config_param(config_graph, test_config_subject, MUSTRDTEST.hasPytestPath, str)
|
110
112
|
filter_on_tripleStore = list(config_graph.objects(subject=test_config_subject,
|
111
|
-
|
113
|
+
predicate=MUSTRDTEST.filterOnTripleStore))
|
114
|
+
|
115
|
+
# Root path is the mustrd test config path
|
116
|
+
root_path = Path(config_path).parent
|
117
|
+
spec_path = root_path / Path(spec_path) if spec_path else None
|
118
|
+
data_path = root_path / Path(data_path) if data_path else None
|
119
|
+
triplestore_spec_path = root_path / Path(triplestore_spec_path) if triplestore_spec_path else None
|
112
120
|
|
113
121
|
test_configs.append(TestConfig(spec_path=spec_path, data_path=data_path,
|
114
|
-
|
115
|
-
|
116
|
-
|
122
|
+
triplestore_spec_path=triplestore_spec_path,
|
123
|
+
pytest_path=pytest_path,
|
124
|
+
filter_on_tripleStore=filter_on_tripleStore))
|
117
125
|
return test_configs
|
118
|
-
|
119
126
|
|
120
127
|
|
121
128
|
def get_config_param(config_graph, config_subject, config_param, convert_function):
|
@@ -125,18 +132,19 @@ def get_config_param(config_graph, config_subject, config_param, convert_functio
|
|
125
132
|
|
126
133
|
@dataclass
|
127
134
|
class TestConfig:
|
128
|
-
spec_path:
|
129
|
-
data_path:
|
130
|
-
triplestore_spec_path:
|
135
|
+
spec_path: Path
|
136
|
+
data_path: Path
|
137
|
+
triplestore_spec_path: Path
|
131
138
|
pytest_path: str
|
132
139
|
filter_on_tripleStore: str = None
|
133
|
-
|
140
|
+
|
134
141
|
|
135
142
|
@dataclass
|
136
143
|
class TestParamWrapper:
|
137
144
|
test_config: TestConfig
|
138
145
|
unit_test: Union[Specification, SpecSkipped]
|
139
146
|
|
147
|
+
|
140
148
|
class MustrdTestPlugin:
|
141
149
|
md_path: str
|
142
150
|
test_configs: list
|
@@ -149,7 +157,7 @@ class MustrdTestPlugin:
|
|
149
157
|
self.test_configs = test_configs
|
150
158
|
self.secrets = secrets
|
151
159
|
self.items = []
|
152
|
-
|
160
|
+
|
153
161
|
@pytest.hookimpl(tryfirst=True)
|
154
162
|
def pytest_collection(self, session):
|
155
163
|
self.unit_tests = []
|
@@ -157,7 +165,7 @@ class MustrdTestPlugin:
|
|
157
165
|
if len(args) > 0:
|
158
166
|
file_name = self.get_file_name_from_arg(args[0])
|
159
167
|
# Filter test to collect only specified path
|
160
|
-
config_to_collect = list(filter(lambda config:
|
168
|
+
config_to_collect = list(filter(lambda config:
|
161
169
|
# Case we want to collect everything
|
162
170
|
MUSTRD_PYTEST_PATH not in args[0]
|
163
171
|
# Case we want to collect a test or sub test
|
@@ -165,30 +173,33 @@ class MustrdTestPlugin:
|
|
165
173
|
# Case we want to collect a whole test folder
|
166
174
|
or args[0].replace(f"./{MUSTRD_PYTEST_PATH}", "") in config.pytest_path,
|
167
175
|
self.test_configs))
|
168
|
-
|
169
|
-
# Redirect everything to test_mustrd.py,
|
176
|
+
|
177
|
+
# Redirect everything to test_mustrd.py,
|
178
|
+
# no need to filter on specified test: Only specified test will be collected anyway
|
170
179
|
session.config.args[0] = os.path.join(mustrd_root, "test/test_mustrd.py")
|
171
180
|
# Collecting only relevant tests
|
172
|
-
|
173
|
-
for one_test_config in config_to_collect:
|
181
|
+
|
182
|
+
for one_test_config in config_to_collect:
|
174
183
|
triple_stores = self.get_triple_stores_from_file(one_test_config)
|
175
184
|
|
176
185
|
if one_test_config.filter_on_tripleStore and not triple_stores:
|
177
|
-
self.unit_tests.extend(list(map(
|
178
|
-
|
179
|
-
|
186
|
+
self.unit_tests.extend(list(map(
|
187
|
+
lambda triple_store:
|
188
|
+
TestParamWrapper(test_config=one_test_config,
|
189
|
+
unit_test=SpecSkipped(MUST.TestSpec, triple_store, "No triplestore found")),
|
190
|
+
one_test_config.filter_on_tripleStore)))
|
180
191
|
else:
|
181
|
-
specs = self.generate_tests_for_config({"spec_path":
|
182
|
-
|
183
|
-
|
184
|
-
self.unit_tests.extend(list(map(
|
185
|
-
|
192
|
+
specs = self.generate_tests_for_config({"spec_path": one_test_config.spec_path,
|
193
|
+
"data_path": one_test_config.data_path},
|
194
|
+
triple_stores, file_name)
|
195
|
+
self.unit_tests.extend(list(map(
|
196
|
+
lambda spec: TestParamWrapper(test_config=one_test_config, unit_test=spec), specs)))
|
197
|
+
|
186
198
|
def get_file_name_from_arg(self, arg):
|
187
199
|
if arg and len(arg) > 0 and "[" in arg and ".mustrd.ttl@" in arg:
|
188
200
|
return arg[arg.index("[") + 1: arg.index(".mustrd.ttl@")]
|
189
201
|
return None
|
190
|
-
|
191
|
-
|
202
|
+
|
192
203
|
@pytest.hookimpl(hookwrapper=True)
|
193
204
|
def pytest_pycollect_makeitem(self, collector, name, obj):
|
194
205
|
report = yield
|
@@ -196,18 +207,17 @@ class MustrdTestPlugin:
|
|
196
207
|
items = report.get_result()
|
197
208
|
new_results = []
|
198
209
|
for item in items:
|
199
|
-
virtual_path =
|
210
|
+
virtual_path = MUSTRD_PYTEST_PATH + (item.callspec.params["unit_tests"].test_config.pytest_path or "default")
|
200
211
|
item.fspath = Path(virtual_path)
|
201
212
|
item._nodeid = virtual_path + "::" + item.name
|
202
213
|
self.items.append(item)
|
203
214
|
new_results.append(item)
|
204
215
|
return new_results
|
205
|
-
|
206
216
|
|
207
217
|
# Hook called at collection time: reads the configuration of the tests, and generate pytests from it
|
208
218
|
def pytest_generate_tests(self, metafunc):
|
209
219
|
if len(metafunc.fixturenames) > 0:
|
210
|
-
if metafunc.function.__name__
|
220
|
+
if metafunc.function.__name__ == "test_unit":
|
211
221
|
# Create the test in itself
|
212
222
|
if self.unit_tests:
|
213
223
|
metafunc.parametrize(metafunc.fixturenames[0], self.unit_tests,
|
@@ -217,9 +227,6 @@ class MustrdTestPlugin:
|
|
217
227
|
metafunc.parametrize(metafunc.fixturenames[0],
|
218
228
|
[SpecSkipped(MUST.TestSpec, None, "No triplestore found")],
|
219
229
|
ids=lambda x: "No configuration found for this test")
|
220
|
-
|
221
|
-
|
222
|
-
|
223
230
|
|
224
231
|
# Generate test for each triple store available
|
225
232
|
def generate_tests_for_config(self, config, triple_stores, file_name):
|
@@ -250,7 +257,7 @@ class MustrdTestPlugin:
|
|
250
257
|
def get_triple_stores_from_file(self, test_config):
|
251
258
|
if test_config.triplestore_spec_path:
|
252
259
|
try:
|
253
|
-
triple_stores = get_triple_stores(get_triple_store_graph(
|
260
|
+
triple_stores = get_triple_stores(get_triple_store_graph(test_config.triplestore_spec_path,
|
254
261
|
self.secrets))
|
255
262
|
except Exception as e:
|
256
263
|
print(f"""Triplestore configuration parsing failed {test_config.triplestore_spec_path}.
|
mustrd/namespace.py
CHANGED
@@ -25,10 +25,11 @@ SOFTWARE.
|
|
25
25
|
from rdflib import URIRef
|
26
26
|
from rdflib.namespace import DefinedNamespace, Namespace
|
27
27
|
|
28
|
+
|
28
29
|
# Namespace for the test specifications
|
29
30
|
class MUST(DefinedNamespace):
|
30
31
|
_NS = Namespace("https://mustrd.com/model/")
|
31
|
-
|
32
|
+
|
32
33
|
# Specification classes
|
33
34
|
TestSpec: URIRef
|
34
35
|
SelectSparql: URIRef
|
@@ -55,7 +56,7 @@ class MUST(DefinedNamespace):
|
|
55
56
|
hasBinding: URIRef
|
56
57
|
variable: URIRef
|
57
58
|
boundValue: URIRef
|
58
|
-
focus:URIRef
|
59
|
+
focus: URIRef
|
59
60
|
|
60
61
|
# Specification data sources
|
61
62
|
TableDataset: URIRef
|
@@ -85,16 +86,16 @@ class MUST(DefinedNamespace):
|
|
85
86
|
AnzoGraphmartQueryDrivenTemplatedStepSparqlSource: URIRef
|
86
87
|
anzoQueryStep: URIRef
|
87
88
|
anzoGraphmartLayer: URIRef
|
88
|
-
|
89
|
+
|
89
90
|
graphmart: URIRef
|
90
91
|
layer: URIRef
|
91
92
|
|
92
|
-
|
93
93
|
# FIXME: There is nothing to do that by default?
|
94
94
|
@classmethod
|
95
95
|
def get_local_name(cls, uri: URIRef):
|
96
96
|
return str(uri).split(cls._NS)[1]
|
97
97
|
|
98
|
+
|
98
99
|
# Namespace for triplestores
|
99
100
|
class TRIPLESTORE(DefinedNamespace):
|
100
101
|
_NS = Namespace("https://mustrd.com/triplestore/")
|
@@ -103,16 +104,17 @@ class TRIPLESTORE(DefinedNamespace):
|
|
103
104
|
Anzo: URIRef
|
104
105
|
ExternalTripleStore: URIRef
|
105
106
|
InternalTripleStore: URIRef
|
106
|
-
|
107
|
+
|
107
108
|
gqeURI: URIRef
|
108
|
-
inputGraph: URIRef
|
109
|
-
outputGraph: URIRef
|
109
|
+
inputGraph: URIRef
|
110
|
+
outputGraph: URIRef # anzo specials? # Triple store config parameters
|
110
111
|
url: URIRef
|
111
112
|
port: URIRef
|
112
113
|
username: URIRef
|
113
114
|
password: URIRef
|
114
115
|
repository: URIRef
|
115
116
|
|
117
|
+
|
116
118
|
# namespace for pytest_mustrd config
|
117
119
|
class MUSTRDTEST(DefinedNamespace):
|
118
120
|
_NS = Namespace("https://mustrd.com/mustrdTest/")
|
@@ -122,4 +124,3 @@ class MUSTRDTEST(DefinedNamespace):
|
|
122
124
|
triplestoreSpecPath: URIRef
|
123
125
|
hasPytestPath: URIRef
|
124
126
|
filterOnTripleStore: URIRef
|
125
|
-
|
mustrd/run.py
CHANGED
@@ -31,7 +31,6 @@ from .mustrd import get_triple_store_graph, run_specs, get_triple_stores, review
|
|
31
31
|
from pathlib import Path
|
32
32
|
from .namespace import TRIPLESTORE
|
33
33
|
from .utils import get_project_root
|
34
|
-
import logging
|
35
34
|
log = logger_setup.setup_logger(__name__)
|
36
35
|
|
37
36
|
|
@@ -50,7 +49,7 @@ def parse_args() -> argparse.Namespace:
|
|
50
49
|
|
51
50
|
# https://github.com/Semantic-partners/mustrd/issues/108
|
52
51
|
def main(argv):
|
53
|
-
#
|
52
|
+
# Given_path = when_path = then_path = None
|
54
53
|
project_root = get_project_root()
|
55
54
|
run_config = {}
|
56
55
|
args = parse_args()
|
@@ -59,7 +58,7 @@ def main(argv):
|
|
59
58
|
|
60
59
|
verbose = args.verbose
|
61
60
|
if verbose:
|
62
|
-
log.info(
|
61
|
+
log.info("Verbose set")
|
63
62
|
run_config["verbose"] = True
|
64
63
|
|
65
64
|
if args.config:
|
@@ -67,7 +66,7 @@ def main(argv):
|
|
67
66
|
log.info(f"Path for triple store configuration is {triplestore_spec_path}")
|
68
67
|
triple_stores = get_triple_stores(get_triple_store_graph(triplestore_spec_path))
|
69
68
|
else:
|
70
|
-
log.info(
|
69
|
+
log.info("No triple store configuration added, running default configuration")
|
71
70
|
triple_stores = [{'type': TRIPLESTORE.RdfLib}]
|
72
71
|
log.info("Triple Stores: " + str(triple_stores))
|
73
72
|
if args.data:
|