Skip to content

Commit

Permalink
Fixup some assist checks
Browse files Browse the repository at this point in the history
* NODE is the new RACK super-top-class
* Don't infer domain restrictions from cardinality restrictions
* Support domain restrictions on unionOf classes
  • Loading branch information
glguy committed Jul 11, 2023
1 parent ad8c310 commit 613d5e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion assist/bin/checks/srs_checks.pl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
rdf(I, 'http://arcos.rack/PROV-S#dataInsertedBy', A),
must_have_srs_data_ingestion(T,I,A).

must_have_srs_data_ingestion(T,I,A) :-
must_have_srs_data_ingestion(_T,_I,A) :-
rack_instance_ident(A, "SRS Data Ingestion"), !.
must_be_srs_data_ingestion(T,I,A) :-
rack_instance_ident(A, AName),
Expand Down
16 changes: 4 additions & 12 deletions assist/bin/rack/check.pl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
check_not_prov_s(Class) :-
rdf(Class, rdf:type, owl:'Class'),
has_interesting_prefix(Class),
rack_ref('PROV-S#THING', Thing),
rack_ref('PROV-S#NODE', Thing),
\+ rdf_reachable(Class, rdfs:subClassOf, Thing),
\+ rdf_is_bnode(Class),
print_message(warning, not_prov_s_thing_class(Class)).
Expand Down Expand Up @@ -248,20 +248,12 @@
check_invalid_domain_class(_SrcClass, Property, _DefinedClass).

check_invalid_domain_class(SrcClass, Property, DefinedClass) :-
rdf(SrcClass, _, B),
rack_ref(_, SrcClass),
rdf_is_bnode(B),
rdf(B, rdf:type, owl:'Restriction'),
rdf(B, owl:onProperty, Property),
rdf(Property, rdfs:domain, DefinedClass),
\+ rdf_reachable(SrcClass, rdfs:subClassOf, DefinedClass),
print_message(error, invalid_domain(SrcClass, Property, DefinedClass)).

check_invalid_domain_class(SrcClass, Property, DefinedClass) :-
property(SrcClass, Property, _Usage),
property(SrcClass, Property, Usage),
rdf_reachable(Property, rdfs:subPropertyOf, ParentProp),
property(DefinedClass, ParentProp, _ParentUsage),
\+ rdf_reachable(SrcClass, rdfs:subClassOf, DefinedClass),
findall(OtherParent, (property(OtherParent, Property, Usage), OtherParent \= SrcClass), OtherParents),
\+ member(DefinedClass, OtherParents),
( Property = ParentProp,
print_message(error, invalid_domain(SrcClass, Property, DefinedClass))
; Property \= ParentProp,
Expand Down

0 comments on commit 613d5e5

Please sign in to comment.