ucoProject / UCO

This repository is for development of the Unified Cyber Ontology.
Apache License 2.0
74 stars 34 forks source link

Failed to create validator: org.topbraid.shacl.validation.SHACLException: Invalid SPARQL constraint #513

Closed DrSnowbird closed 1 year ago

DrSnowbird commented 1 year ago

Bug description

Tool transcript:

Failed to create validator: org.topbraid.shacl.validation.SHACLException: Invalid SPARQL constraint (Line 5, column 41: Unresolved prefixed name: rdfs:subClassOf):\n\n\t\t\tPREFIX uco-core: <https://ontology.unifiedcyberontology.org/uco/core/>\n\t\t\tSELECT $this\n\t\t\tWHERE {\n\t\t\t        $this a/rdfs:subClassOf* uco-core:UcoThing .\n\t\t\t        FILTER (\n\t\t\t                ! REGEX (\n\t\t\t                        STR($this),\n\t\t\t                        \"[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$\",\n\t\t\t                        \"i\"\n\t\t\t                )\n\t\t\t        )

Steps to reproduce

Steps to reproduce the behavior.

  1. Use Topbraid SHACL validator to load UCO v1.1.0 Shapes and then,
  2. Use the input sample: "https://raw.githubusercontent.com/casework/CASE-Examples/master/examples/illustrations/location/location.json"
  3. The results will come back to report the failure as "Failed to create validator: org.topbraid.shacl.validation.SHACLException: Invalid SPARQL constraint". -- Please see the attachment JSON file (the response using SHACL validator Service)

UCO-v1-1-0-SHACL-Exception (copy).txt

Coordination

ajnelson-nist commented 1 year ago

It appears there's a disagreement between the tool you used and rdflib on what the guaranteed RDF prefixes are. It looks like we need to add explicit rdfs declarations to each of the SHACL-SPARQL constraints.

@DrSnowbird , thank you for the bug report, we'll schedule it for the next release.