zazuko / rdf-validate-shacl

Validate RDF data purely in JavaScript. An implementation of the W3C SHACL specification on top of the RDFJS stack.
MIT License
98 stars 13 forks source link

Fix multi level sublcass inheritance #42

Closed mpolitze closed 3 years ago

mpolitze commented 3 years ago

Hi,

this is related to issue #41.

As pointed out there getSubClassesOf is not resolving transitive subclasses. I made a small fix and an additional test that verifies the behaviour and that can be replicated on https://shacl.org/playground/ (I do not know if that is the intended place for such kinds of tests though) .

codecov-io commented 3 years ago

Codecov Report

Merging #42 (5b1fd42) into master (dad9520) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
+ Coverage   96.74%   96.75%   +0.01%     
==========================================
  Files          14       14              
  Lines         675      679       +4     
==========================================
+ Hits          653      657       +4     
  Misses         22       22              
Impacted Files Coverage Δ
src/rdflib-graph.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dad9520...5b1fd42. Read the comment docs.

mpolitze commented 3 years ago

On a second thought: my Implementation likely falls for cyclic subClass relationships. AFAIK they are forbidden by RDFS but you never know...

Will update the PR later this week.

martinmaillard commented 3 years ago

Thanks :)

martinmaillard commented 3 years ago

I created a separate issue for the cyclic subClass relationship problem: https://github.com/zazuko/rdf-validate-shacl/issues/43