From 613d5e514e1f45a330265d260eb482c2fa63b4f7 Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Tue, 11 Jul 2023 15:56:36 -0700 Subject: [PATCH] Fixup some assist checks * NODE is the new RACK super-top-class * Don't infer domain restrictions from cardinality restrictions * Support domain restrictions on unionOf classes --- assist/bin/checks/srs_checks.pl | 2 +- assist/bin/rack/check.pl | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/assist/bin/checks/srs_checks.pl b/assist/bin/checks/srs_checks.pl index f851f690..ff25fff7 100644 --- a/assist/bin/checks/srs_checks.pl +++ b/assist/bin/checks/srs_checks.pl @@ -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), diff --git a/assist/bin/rack/check.pl b/assist/bin/rack/check.pl index b0ed496a..8e737a87 100644 --- a/assist/bin/rack/check.pl +++ b/assist/bin/rack/check.pl @@ -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)). @@ -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,