Skip to content

Commit

Permalink
test without skolemization
Browse files Browse the repository at this point in the history
  • Loading branch information
muddymudskipper committed Sep 25, 2024
1 parent 294fdec commit af61092
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/test_pyshacl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import pyshacl
import pytest
from cmem.cmempy.dp.proxy.graph import delete, get, post_streamed
from rdflib import RDF, Graph, URIRef

from rdflib import RDF, Graph, URIRef, PROV
from rdflib.compare import isomorphic
from cmem_plugin_pyshacl.plugin_pyshacl import ShaclValidation

from . import __path__
from .utils import TestExecutionContext, needs_cmem

UUID4 = "b36254a836e04279aecf411d2c8e364a"
Expand Down Expand Up @@ -52,7 +52,7 @@ def test_workflow_execution(_setup: None) -> None: # noqa: PT019
output_entities=True,
clear_validation_graph=True,
owl_imports=True,
skolemize=True,
skolemize=False,
add_labels=True,
include_graphs_labels=True,
add_shui_conforms=True,
Expand All @@ -65,6 +65,10 @@ def test_workflow_execution(_setup: None) -> None: # noqa: PT019
max_validation_depth=15,
)
plugin.execute(inputs=(), context=TestExecutionContext())
res = get(VALIDATION_GRAPH_URI)
if res.status_code != 200: # noqa: PLR2004
raise ValueError(f"Response {res.status_code}: {res.url}")

result = Graph().parse(data=get(VALIDATION_GRAPH_URI).text)
result.remove((None, PROV.generatedAtTime, None))
test = Graph().parse(Path(__path__[0]) / "test_pyshacl.ttl", format="turtle")

assert isomorphic(result, test)

11 changes: 11 additions & 0 deletions tests/test_pyshacl.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

[] a sh:ValidationReport ;
rdfs:label "SHACL validation report, conforms=true" ;
prov:wasDerivedFrom <https://vocab.eccenca.com/shacl/> ;
prov:wasInformedBy <https://example.org/pyshacl-plugin-test/b36254a836e04279aecf411d2c8e364a> ;
sh:conforms true .

0 comments on commit af61092

Please sign in to comment.