@@ -127,15 +127,7 @@ def validate(
127127 allow_warnings = True ,
128128 )
129129 elif engine == "topquadrant" :
130- # check if 'java' is in the path
131- import shutil
132-
133- if shutil .which ("java" ) is None :
134- raise Exception (
135- "TopQuadrant SHACL validation requires Java to be installed and in the PATH"
136- )
137- from brickschema .topquadrant_shacl import validate
138-
130+ from brick_tq_shacl .pyshacl import validate
139131 if shape_graphs is not None and isinstance (shape_graphs , list ):
140132 for sg in shape_graphs :
141133 shapes += sg
@@ -263,21 +255,12 @@ def expand(
263255 return
264256 elif profile == "shacl" :
265257 if backend == "topquadrant" :
266- # check if 'java' is in the path
267- import shutil
268-
269- if shutil .which ("java" ) is None :
270- raise Exception (
271- "TopQuadrant SHACL validation requires Java to be installed and in the PATH"
272- )
273- from brickschema .topquadrant_shacl import infer
274-
258+ from brick_tq_shacl .pyshacl import infer
275259 # 'res' is a de-skolemized graph. We want to replace the contents
276260 # of this graph with the de-skolemized version because topquadrant requires
277261 # that skolemization is applied to the input graph in order to preserve
278262 # identity of inferred subject/objects
279263 res = infer (self , og or rdflib .Graph ())
280- self .remove ((None , None , None ))
281264 self += res
282265 return self
283266 valid , _ , report = pyshacl .validate (
0 commit comments