From 372fcf9a827fbe8fe51f4cb8b2098432a5e75ef5 Mon Sep 17 00:00:00 2001 From: mereolog Date: Mon, 24 Jun 2024 12:22:47 +0200 Subject: [PATCH 1/9] update of hygiene tests from IDMP project Signed-off-by: mereolog --- ...rql => testHygiene_cycles_subClass.sparql} | 2 +- .../testHygiene_cycles_subProperty.sparql | 16 ++++ .../testHygiene_deprecated.sparql | 25 +++++ .../testHygiene_long_IRIs.sparql | 12 +++ .../testHygiene_multiple_blanks.sparql | 12 +++ ...ene_obsolete_restrictions_exact&min.sparql | 31 ++++++ ...olete_restrictions_exact&min_remote.sparql | 33 +++++++ ...olete_restrictions_max&exact_remote.sparql | 34 +++++++ ...stHygiene_obsolete_restrictions_max.sparql | 33 +++++++ ...ene_obsolete_restrictions_max@exact.sparql | 33 +++++++ ...ne_obsolete_restrictions_max_remote.sparql | 34 +++++++ ...stHygiene_obsolete_restrictions_min.sparql | 6 +- ...ne_obsolete_restrictions_min_remote.sparql | 35 +++++++ ...e_restrictions_someValuesFrom&exact.sparql | 30 ++++++ ...ictions_someValuesFrom&exact_remote.sparql | 31 ++++++ ...ete_restrictions_someValuesFrom&min.sparql | 29 ++++++ ...trictions_someValuesFrom&min_remote.sparql | 30 ++++++ ...bsolete_restrictions_someValuesFrom.sparql | 5 +- ..._restrictions_someValuesFrom_remote.sparql | 31 ++++++ ...stHygiene_ontology_circular_imports.sparql | 14 +++ ...ance_multiple_different_individuals.sparql | 4 +- ...testHygiene_underspecified_examples.sparql | 94 +++++++++++++++++++ 22 files changed, 567 insertions(+), 7 deletions(-) rename etc/testing/hygiene_parameterized/{testHygiene_classes_subclassof_non-circular.sparql => testHygiene_cycles_subClass.sparql} (81%) create mode 100644 etc/testing/hygiene_parameterized/testHygiene_cycles_subProperty.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_deprecated.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_long_IRIs.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_multiple_blanks.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_ontology_circular_imports.sparql create mode 100644 etc/testing/hygiene_parameterized/testHygiene_underspecified_examples.sparql diff --git a/etc/testing/hygiene_parameterized/testHygiene_classes_subclassof_non-circular.sparql b/etc/testing/hygiene_parameterized/testHygiene_cycles_subClass.sparql similarity index 81% rename from etc/testing/hygiene_parameterized/testHygiene_classes_subclassof_non-circular.sparql rename to etc/testing/hygiene_parameterized/testHygiene_cycles_subClass.sparql index f8db5c582..a92aa146c 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_classes_subclassof_non-circular.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_cycles_subClass.sparql @@ -12,5 +12,5 @@ WHERE ?class rdfs:subClassOf+ ?class . FILTER NOT EXISTS {?class owl:deprecated "true"^^xsd:boolean} . - BIND (concat ("PRODERROR: There is a hierarchy cycle around class ", str(?class)) AS ?error) + BIND (concat ("ERROR: There is a hierarchy cycle around class ", str(?class)) AS ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_cycles_subProperty.sparql b/etc/testing/hygiene_parameterized/testHygiene_cycles_subProperty.sparql new file mode 100644 index 000000000..9d65218ab --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_cycles_subProperty.sparql @@ -0,0 +1,16 @@ +prefix rdfs: +prefix owl: +prefix xsd: + +## +# banner Property subPropertyOf hierarchy shouldn't be circular. + +SELECT DISTINCT ?error ?property +WHERE +{ + FILTER regex(str(?property), ) + ?property rdfs:subPropertyOf+ ?property . + FILTER NOT EXISTS {?property owl:deprecated "true"^^xsd:boolean} . + + BIND (concat ("ERROR: There is a hierarchy cycle around property ", str(?property)) AS ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_deprecated.sparql b/etc/testing/hygiene_parameterized/testHygiene_deprecated.sparql new file mode 100644 index 000000000..5afcf3266 --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_deprecated.sparql @@ -0,0 +1,25 @@ +prefix owl: +prefix xsd: +prefix rdf: +prefix rdfs: + +## +# banner Deprecated resources should not be used. + +SELECT DISTINCT ?error ?resource +WHERE +{ + ?resource owl:deprecated "true"^^xsd:boolean . + FILTER NOT EXISTS {?resource rdf:type/rdf:type/(rdfs:subClassOf*) owl:Class.} + FILTER regex(str(?resource), ) + { + ?resource ?property1 ?object. + FILTER (?property1 != owl:equivalentClass && ?property1 != owl:deprecated && ?property1 != rdf:type && ?property1 != owl:equivalentProperty && ?property1 != owl:sameAs) + } + UNION + { + ?subject ?property2 ?resource . + FILTER (?property2 != owl:equivalentClass && ?property2 != owl:deprecated && ?property2 != rdf:type && ?property2 != owl:equivalentProperty && ?property2 != owl:sameAs) + } + BIND ("PRODERROR: Deprecated resource " + str(?resource) + " is still in use." as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_long_IRIs.sparql b/etc/testing/hygiene_parameterized/testHygiene_long_IRIs.sparql new file mode 100644 index 000000000..6e2af9102 --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_long_IRIs.sparql @@ -0,0 +1,12 @@ +## +# banner No IRI should be longer than 255 chars. + + +SELECT DISTINCT ?error ?resource +WHERE +{ + ?resource ?property ?value . + FILTER (STRLEN(STR(?resource)) > 255) + FILTER regex(str(?resource), ) + BIND (concat("PRODERROR: IRI ", STR(?resource), " is longer than 255 chars.") AS ?error) +} diff --git a/etc/testing/hygiene_parameterized/testHygiene_multiple_blanks.sparql b/etc/testing/hygiene_parameterized/testHygiene_multiple_blanks.sparql new file mode 100644 index 000000000..8c1102708 --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_multiple_blanks.sparql @@ -0,0 +1,12 @@ +## +# banner No literal should contain multiple embedded space(s). + +SELECT DISTINCT ?warning ?value +WHERE +{ + ?resource ?property ?value. + FILTER (ISLITERAL(?value)) + FILTER (REGEX(?value, '[^\\s]+[\\u0020\\t][\\u0020\\t]+[^\\s]+')) + FILTER regex(str(?resource), ) + BIND (concat ("ERROR: ", "Resource <", STR(?resource), "> has property <", STR(?property), "> whose value contains multiple embedded spaces:") AS ?warning) +} diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql new file mode 100644 index 000000000..5ae95f196 --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql @@ -0,0 +1,31 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We should avoid restrictions that can be inferred from other restrictions. Here we check exact and min cardinality restrictions. + +SELECT ?error ?class +WHERE +{ + ?class rdfs:subClassOf ?restriction1. + ?class rdfs:subClassOf ?restriction2. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:onClass ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction1 owl:qualifiedCardinality ?cardinality1. + ?restriction2 owl:minQualifiedCardinality ?cardinality2. + ?property1 rdfs:subPropertyOf* ?property2. + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?restriction1 != ?restriction2) + FILTER (?cardinality1 >= ?cardinality2) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " exactly ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql new file mode 100644 index 000000000..6a0907aa3 --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql @@ -0,0 +1,33 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We may want to avoid restrictions that can be remotely inferred from other restrictions. Here we check remote exact and min cardinality restrictions. + +SELECT ?error ?class +WHERE +{ + ?class rdfs:subClassOf+ ?restriction1. + ?superClass rdfs:subClassOf ?restriction1. + ?class rdfs:subClassOf ?restriction2. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:onClass ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction1 owl:qualifiedCardinality ?cardinality1. + ?restriction2 owl:minQualifiedCardinality ?cardinality2. + ?property1 rdfs:subPropertyOf* ?property2. + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?restriction1 != ?restriction2) + FILTER (?cardinality1 >= ?cardinality2) + FILTER (?cardinality2 > 0) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " exactly ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND (CONCAT("WARN: Class ", STR(?class), " may inherit obsolete min cardinality restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">", " from class ", STR(?restrictingClass1)) as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql new file mode 100644 index 000000000..16449baf1 --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql @@ -0,0 +1,34 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We may want to avoid restrictions that can be remotely inferred from other restrictions. Here we check remote exact and max cardinality restrictions. + + +SELECT ?error ?class +WHERE +{ + ?class rdfs:subClassOf+ ?restriction2. + ?superClass rdfs:subClassOf ?restriction2. + ?class rdfs:subClassOf ?restriction1. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:onClass ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction1 owl:maxQualifiedCardinality ?cardinality1. + ?restriction2 owl:qualifiedCardinality ?cardinality2. + ?property1 rdfs:subPropertyOf* ?property2. + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?restriction1 != ?restriction2) + FILTER (?cardinality1 >= ?cardinality2) + FILTER (?cardinality1 > 0) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " max ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " exactly ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete max cardinality restriction <", ?restriction1String, "> because of exact cardinality restriction <", ?restriction2String, ">", " from class ", STR(?superClass)) as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql new file mode 100644 index 000000000..ae2e5c44f --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql @@ -0,0 +1,33 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We should avoid restrictions that can be inferred from other restrictions. Here we check max cardinality restrictions. + + +SELECT ?error ?class +WHERE +{ + ?class rdfs:subClassOf ?restriction1. + ?class rdfs:subClassOf ?restriction2. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:onClass ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction1 owl:maxQualifiedCardinality ?cardinality1. + ?restriction2 owl:maxQualifiedCardinality ?cardinality2. + ?property1 rdfs:subPropertyOf* ?property2. + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?restriction1 != ?restriction2) + FILTER (?cardinality1 >= ?cardinality2) + FILTER (?cardinality2 > 0) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " max ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " max ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete max cardinality restriction <", ?restriction1String, "> because of max cardinality restriction <", ?restriction2String, ">.") as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql new file mode 100644 index 000000000..3e3fef54d --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql @@ -0,0 +1,33 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We may want to avoid restrictions that can be inferred from other restrictions. Here we check exact and max cardinality restrictions. + + +SELECT ?error ?class +WHERE +{ + ?class rdfs:subClassOf ?restriction1. + ?class rdfs:subClassOf ?restriction2. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:onClass ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction1 owl:maxQualifiedCardinality ?cardinality1. + ?restriction2 owl:qualifiedCardinality ?cardinality2. + ?property1 rdfs:subPropertyOf* ?property2. + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?restriction1 != ?restriction2) + FILTER (?cardinality1 >= ?cardinality2) + FILTER (?cardinality1 > 0) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " max ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " exactly ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete max cardinality restriction <", ?restriction1String, "> because of exact cardinality restriction <", ?restriction2String, ">.") as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql new file mode 100644 index 000000000..0678edf2e --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql @@ -0,0 +1,34 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We may want to avoid restrictions that can be remotely inferred from other restrictions. Here we check remote exact and max cardinality restrictions. + + +SELECT ?error ?class +WHERE +{ + ?class rdfs:subClassOf+ ?restriction2. + ?superClass rdfs:subClassOf ?restriction2. + ?class rdfs:subClassOf ?restriction1. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:onClass ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction1 owl:maxQualifiedCardinality ?cardinality1. + ?restriction2 owl:maxQualifiedCardinality ?cardinality2. + ?property1 rdfs:subPropertyOf* ?property2. + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?restriction1 != ?restriction2) + FILTER (?cardinality1 >= ?cardinality2) + FILTER (?cardinality2 > 0) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " max ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " max ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete max cardinality restriction <", ?restriction1String, "> because of max cardinality restriction <", ?restriction2String, ">", " from class ", STR(?superClass)) as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql index fb8298bd3..7cd57d650 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql @@ -5,7 +5,8 @@ prefix xsd: prefix afn: ## -# banner We should avoid restrictions that can be inferred from other restrictions. +# banner We should avoid restrictions that can be inferred from other restrictions. Here we check min cardinality restrictions. + SELECT ?error WHERE @@ -25,7 +26,8 @@ WHERE FILTER (?restriction1 != ?restriction2) FILTER (?minCardinality1 >= ?minCardinality2) FILTER (?minCardinality1 != 0) + FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?minCardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?minCardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete restriction <", ?restriction2String, "> because of restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql new file mode 100644 index 000000000..58cbfe347 --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql @@ -0,0 +1,35 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We may want to avoid restrictions that can be remotely inferred from other restrictions. Here we check remote min cardinality restrictions. + + +SELECT ?error +WHERE +{ + ?class rdfs:subClassOf+ ?restriction1. + ?superClass rdfs:subClassOf ?restriction1. + ?class rdfs:subClassOf ?restriction2. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:onClass ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction1 owl:minQualifiedCardinality ?minCardinality1. + ?restriction2 owl:minQualifiedCardinality ?minCardinality2. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {?property1 rdfs:subPropertyOf* ?property2. FILTER (?property1 = ?property2)} + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} + FILTER (?restriction1 != ?restriction2) + FILTER (?minCardinality1 >= ?minCardinality2) + FILTER (?minCardinality1 > 0) + FILTER (?minCardinality2 > 0) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?minCardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?minCardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql new file mode 100644 index 000000000..4254c921e --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql @@ -0,0 +1,30 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We should avoid restrictions that can be inferred from other restrictions. Here we check someValues and exact cardinality restrictions. + +SELECT ?error ?class +WHERE +{ + ?class rdfs:subClassOf ?restriction1. + ?class rdfs:subClassOf ?restriction2. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:someValuesFrom ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction2 owl:qualifiedCardinality ?cardinality2. + ?property1 rdfs:subPropertyOf* ?property2. + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?restriction1 != ?restriction2) + FILTER (?cardinality2 > 0) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR("1"), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " exact ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete exact cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql new file mode 100644 index 000000000..92176e6a9 --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql @@ -0,0 +1,31 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We may want to avoid restrictions that can be remotely inferred from other restrictions. Here we check remote someValues and exact cardinality restrictions. + +SELECT ?error ?class +WHERE +{ + ?class rdfs:subClassOf+ ?restriction1. + ?superClass rdfs:subClassOf ?restriction1. + ?class rdfs:subClassOf ?restriction2. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:someValuesFrom ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction2 owl:qualifiedCardinality ?cardinality2. + ?property1 rdfs:subPropertyOf* ?property2. + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?restriction1 != ?restriction2) + FILTER (?cardinality2 > 0) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR("1"), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " exact ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete exact cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql new file mode 100644 index 000000000..25d89f6de --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql @@ -0,0 +1,29 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We should avoid restrictions that can be inferred from other restrictions. Here we check someValues and min cardinality restrictions. + +SELECT ?error ?class +WHERE +{ + ?class rdfs:subClassOf ?restriction1. + ?class rdfs:subClassOf ?restriction2. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:someValuesFrom ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction2 owl:minQualifiedCardinality ?cardinality2. + ?property1 rdfs:subPropertyOf* ?property2. + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?cardinality2 > 0) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR("1"), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql new file mode 100644 index 000000000..7e7a19b60 --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql @@ -0,0 +1,30 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We may want to avoid restrictions that can be remotely inferred from other restrictions. Here we check remote someValues and min cardinality restrictions. + +SELECT ?error ?class +WHERE +{ + ?class rdfs:subClassOf+ ?restriction1. + ?superClass rdfs:subClassOf ?restriction1. + ?class rdfs:subClassOf ?restriction2. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:someValuesFrom ?restrictingClass1. + ?restriction2 owl:onClass ?restrictingClass2. + ?restriction2 owl:minQualifiedCardinality ?cardinality2. + ?property1 rdfs:subPropertyOf* ?property2. + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?cardinality2 > 0) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR("1"), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete min cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql index 0507b08df..878d14ef6 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql @@ -5,7 +5,7 @@ prefix xsd: prefix afn: ## -# banner We should avoid restrictions that can be inferred from other restrictions. +# banner We should avoid restrictions that can be inferred from other restrictions. Here we check someValues restrictions. SELECT ?error @@ -22,7 +22,8 @@ WHERE {?property1 rdfs:subPropertyOf+ ?property2.} UNION {?property1 rdfs:subPropertyOf* ?property2. FILTER (?property1 = ?property2)} {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) + FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete restriction <", ?restriction2String, "> because of restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql new file mode 100644 index 000000000..6778514f3 --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql @@ -0,0 +1,31 @@ +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +prefix afn: + +## +# banner We may want to avoid restrictions that can be remotely inferred from other restrictions. Here we check remote someValues restrictions. + + + +SELECT ?error +WHERE +{ + ?class rdfs:subClassOf+ ?restriction1. + ?superClass rdfs:subClassOf ?restriction1. + ?class rdfs:subClassOf ?restriction2. + ?restriction1 rdf:type owl:Restriction. + ?restriction2 rdf:type owl:Restriction. + ?restriction1 owl:onProperty ?property1. + ?restriction2 owl:onProperty ?property2. + ?restriction1 owl:someValuesFrom ?restrictingClass1. + ?restriction2 owl:someValuesFrom ?restrictingClass2. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {?property1 rdfs:subPropertyOf* ?property2. FILTER (?property1 = ?property2)} + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} + FILTER (?restriction1 != ?restriction2) + FILTER regex(str(?class), ) + BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_ontology_circular_imports.sparql b/etc/testing/hygiene_parameterized/testHygiene_ontology_circular_imports.sparql new file mode 100644 index 000000000..0503709db --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_ontology_circular_imports.sparql @@ -0,0 +1,14 @@ +prefix owl: +prefix xsd: + +## +# banner Property owl:imports cannot be circular across all ontologies. + +SELECT DISTINCT ?error ?ontology +WHERE +{ + ?ontology owl:imports+ ?ontology. + FILTER NOT EXISTS {?ontology owl:deprecated "true"^^xsd:boolean} . + FILTER regex(str(?ontology), ) + BIND (concat ("ERROR: ", str(?ontology), " imports itself.") AS ?error) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_performance_multiple_different_individuals.sparql b/etc/testing/hygiene_parameterized/testHygiene_performance_multiple_different_individuals.sparql index 55935e35f..f30839e43 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_performance_multiple_different_individuals.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_performance_multiple_different_individuals.sparql @@ -24,5 +24,5 @@ WHERE { ?individual1 owl:differentFrom/owl:differentFrom/owl:differentFrom/owl:differentFrom/owl:differentFrom/owl:differentFrom/owl:differentFrom/owl:differentFrom ?individual2. } - BIND (concat ("WARN: An ontology contains more than seven different individuals") AS ?warning) -} + BIND (concat ("An ontology contains more than seven different individuals") AS ?warning) +} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_underspecified_examples.sparql b/etc/testing/hygiene_parameterized/testHygiene_underspecified_examples.sparql new file mode 100644 index 000000000..c6b3431dc --- /dev/null +++ b/etc/testing/hygiene_parameterized/testHygiene_underspecified_examples.sparql @@ -0,0 +1,94 @@ +prefix owl: +prefix rdf: +prefix xsd: +prefix rdfs: + +## +# banner We should provide all required properties for examples. + +SELECT DISTINCT ?error ?instance ?property +WHERE +{ + ?instance rdf:type ?class. + FILTER (ISIRI(?instance)) + + + ?class rdfs:subClassOf ?restriction. + ?restriction rdf:type owl:Restriction. + { + ?restriction owl:onProperty ?property. + ?restriction owl:onClass ?restrictingClass. + ?restriction owl:minQualifiedCardinality ?cardinality. + FILTER (?cardinality > 0) + } + UNION + { + ?restriction owl:onProperty ?property. + ?restriction owl:someValuesFrom ?restrictingClass. + } + + FILTER NOT EXISTS + { + {?property owl:inverseOf ?inverseProperty.} + UNION + {?inverseProperty owl:inverseOf ?property.} + + ?subInverseProperty rdfs:subPropertyOf* ?inverseProperty. + ?inverseRestriction owl:hasValue ?instance. + ?restrictedClass rdfs:subClassOf* ?restrictingClass. + ?restrictedClass rdfs:subClassOf* ?inverseRestriction. + } + + FILTER NOT EXISTS + { + ?instance (owl:sameAs | ^owl:sameAs)* ?sameasinstance. + {?property owl:inverseOf ?inverseProperty.} + UNION + {?inverseProperty owl:inverseOf ?property.} + + ?subInverseProperty rdfs:subPropertyOf* ?inverseProperty. + ?inverseRestriction owl:hasValue ?sameasinstance. + ?restrictedClass rdfs:subClassOf* ?restrictingClass. + ?restrictedClass rdfs:subClassOf* ?inverseRestriction. + } + + FILTER NOT EXISTS + { + {?property owl:inverseOf ?inverseProperty.} + UNION + {?inverseProperty owl:inverseOf ?property.} + + ?subInverseProperty rdfs:subPropertyOf* ?inverseProperty. + ?inverseInstance ?subInverseProperty ?instance. + ?inverseInstance rdf:type/rdfs:subClassOf* ?restrictingClass. + } + + FILTER NOT EXISTS + { + ?instance (owl:sameAs | ^owl:sameAs)* ?sameasinstance. + {?property owl:inverseOf ?inverseProperty.} + UNION + {?inverseProperty owl:inverseOf ?property.} + + ?subInverseProperty rdfs:subPropertyOf* ?inverseProperty. + ?inverseInstance ?subInverseProperty ?sameasinstance. + ?inverseInstance rdf:type/rdfs:subClassOf* ?restrictingClass. + } + + FILTER NOT EXISTS + { + ?subProperty rdfs:subPropertyOf* ?property. + ?instance ?subProperty ?value. + + } + + FILTER NOT EXISTS + { + ?instance (owl:sameAs | ^owl:sameAs)* ?sameasinstance. + ?subProperty rdfs:subPropertyOf* ?property. + ?sameasinstance ?subProperty ?value. + } + + BIND (concat ("WARN: Individual ", STR(?instance), " looks like an unfinished example because it is missing a property required by its type.") AS ?error) +} +ORDER BY ?instance \ No newline at end of file From 8941968ed1f2d210d44f65d72434c88b786f8496 Mon Sep 17 00:00:00 2001 From: mereolog Date: Mon, 24 Jun 2024 12:45:36 +0200 Subject: [PATCH 2/9] descalation of some new hygiene test Signed-off-by: mereolog --- .../testHygiene_cycles_subClass.sparql | 2 +- .../testHygiene_cycles_subProperty.sparql | 2 +- .../testHygiene_deprecated.sparql | 25 ------------------- .../testHygiene_multiple_blanks.sparql | 12 --------- ...stHygiene_ontology_circular_imports.sparql | 2 +- 5 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 etc/testing/hygiene_parameterized/testHygiene_deprecated.sparql delete mode 100644 etc/testing/hygiene_parameterized/testHygiene_multiple_blanks.sparql diff --git a/etc/testing/hygiene_parameterized/testHygiene_cycles_subClass.sparql b/etc/testing/hygiene_parameterized/testHygiene_cycles_subClass.sparql index a92aa146c..f8db5c582 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_cycles_subClass.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_cycles_subClass.sparql @@ -12,5 +12,5 @@ WHERE ?class rdfs:subClassOf+ ?class . FILTER NOT EXISTS {?class owl:deprecated "true"^^xsd:boolean} . - BIND (concat ("ERROR: There is a hierarchy cycle around class ", str(?class)) AS ?error) + BIND (concat ("PRODERROR: There is a hierarchy cycle around class ", str(?class)) AS ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_cycles_subProperty.sparql b/etc/testing/hygiene_parameterized/testHygiene_cycles_subProperty.sparql index 9d65218ab..e41854cc7 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_cycles_subProperty.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_cycles_subProperty.sparql @@ -12,5 +12,5 @@ WHERE ?property rdfs:subPropertyOf+ ?property . FILTER NOT EXISTS {?property owl:deprecated "true"^^xsd:boolean} . - BIND (concat ("ERROR: There is a hierarchy cycle around property ", str(?property)) AS ?error) + BIND (concat ("PRODERROR: There is a hierarchy cycle around property ", str(?property)) AS ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_deprecated.sparql b/etc/testing/hygiene_parameterized/testHygiene_deprecated.sparql deleted file mode 100644 index 5afcf3266..000000000 --- a/etc/testing/hygiene_parameterized/testHygiene_deprecated.sparql +++ /dev/null @@ -1,25 +0,0 @@ -prefix owl: -prefix xsd: -prefix rdf: -prefix rdfs: - -## -# banner Deprecated resources should not be used. - -SELECT DISTINCT ?error ?resource -WHERE -{ - ?resource owl:deprecated "true"^^xsd:boolean . - FILTER NOT EXISTS {?resource rdf:type/rdf:type/(rdfs:subClassOf*) owl:Class.} - FILTER regex(str(?resource), ) - { - ?resource ?property1 ?object. - FILTER (?property1 != owl:equivalentClass && ?property1 != owl:deprecated && ?property1 != rdf:type && ?property1 != owl:equivalentProperty && ?property1 != owl:sameAs) - } - UNION - { - ?subject ?property2 ?resource . - FILTER (?property2 != owl:equivalentClass && ?property2 != owl:deprecated && ?property2 != rdf:type && ?property2 != owl:equivalentProperty && ?property2 != owl:sameAs) - } - BIND ("PRODERROR: Deprecated resource " + str(?resource) + " is still in use." as ?error) -} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_multiple_blanks.sparql b/etc/testing/hygiene_parameterized/testHygiene_multiple_blanks.sparql deleted file mode 100644 index 8c1102708..000000000 --- a/etc/testing/hygiene_parameterized/testHygiene_multiple_blanks.sparql +++ /dev/null @@ -1,12 +0,0 @@ -## -# banner No literal should contain multiple embedded space(s). - -SELECT DISTINCT ?warning ?value -WHERE -{ - ?resource ?property ?value. - FILTER (ISLITERAL(?value)) - FILTER (REGEX(?value, '[^\\s]+[\\u0020\\t][\\u0020\\t]+[^\\s]+')) - FILTER regex(str(?resource), ) - BIND (concat ("ERROR: ", "Resource <", STR(?resource), "> has property <", STR(?property), "> whose value contains multiple embedded spaces:") AS ?warning) -} diff --git a/etc/testing/hygiene_parameterized/testHygiene_ontology_circular_imports.sparql b/etc/testing/hygiene_parameterized/testHygiene_ontology_circular_imports.sparql index 0503709db..1b3517b08 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_ontology_circular_imports.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_ontology_circular_imports.sparql @@ -10,5 +10,5 @@ WHERE ?ontology owl:imports+ ?ontology. FILTER NOT EXISTS {?ontology owl:deprecated "true"^^xsd:boolean} . FILTER regex(str(?ontology), ) - BIND (concat ("ERROR: ", str(?ontology), " imports itself.") AS ?error) + BIND (concat ("PRODERROR: ", str(?ontology), " imports itself.") AS ?error) } \ No newline at end of file From 3739a9f75797e9ec45a6e6086b65a30c03040261 Mon Sep 17 00:00:00 2001 From: mereolog Date: Mon, 24 Jun 2024 13:37:25 +0200 Subject: [PATCH 3/9] descalation of some new hygiene test Signed-off-by: mereolog --- .../testHygiene_long_IRIs.sparql | 2 +- ...ene_obsolete_restrictions_exact&min.sparql | 2 +- ...stHygiene_obsolete_restrictions_max.sparql | 2 +- ...stHygiene_obsolete_restrictions_min.sparql | 2 +- ...e_restrictions_someValuesFrom&exact.sparql | 2 +- ...ete_restrictions_someValuesFrom&min.sparql | 2 +- ...bsolete_restrictions_someValuesFrom.sparql | 2 +- .../testHygiene_resources_deprecated.sparql | 2 +- ...testHygiene_underspecified_examples.sparql | 94 ------------------- 9 files changed, 8 insertions(+), 102 deletions(-) delete mode 100644 etc/testing/hygiene_parameterized/testHygiene_underspecified_examples.sparql diff --git a/etc/testing/hygiene_parameterized/testHygiene_long_IRIs.sparql b/etc/testing/hygiene_parameterized/testHygiene_long_IRIs.sparql index 6e2af9102..039aea145 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_long_IRIs.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_long_IRIs.sparql @@ -8,5 +8,5 @@ WHERE ?resource ?property ?value . FILTER (STRLEN(STR(?resource)) > 255) FILTER regex(str(?resource), ) - BIND (concat("PRODERROR: IRI ", STR(?resource), " is longer than 255 chars.") AS ?error) + BIND (concat("WARN: IRI ", STR(?resource), " is longer than 255 chars.") AS ?error) } diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql index 5ae95f196..6c92f7862 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql @@ -27,5 +27,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " exactly ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql index ae2e5c44f..2fcc8f39e 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql @@ -29,5 +29,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " max ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " max ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete max cardinality restriction <", ?restriction1String, "> because of max cardinality restriction <", ?restriction2String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete max cardinality restriction <", ?restriction1String, "> because of max cardinality restriction <", ?restriction2String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql index 7cd57d650..a0e89f32e 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql @@ -29,5 +29,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?minCardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?minCardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql index 4254c921e..1f9fe387e 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql @@ -26,5 +26,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR("1"), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " exact ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete exact cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete exact cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql index 25d89f6de..0236ee715 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql @@ -25,5 +25,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR("1"), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql index 878d14ef6..e986428cf 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql @@ -25,5 +25,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql b/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql index ac43c3dd1..1b5d0eee6 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql @@ -21,5 +21,5 @@ WHERE ?subject ?property2 ?resource . FILTER (?property2 != owl:equivalentClass && ?property2 != owl:deprecated && ?property2 != rdf:type && ?property2 != owl:equivalentProperty) } - BIND ("WARN: Deprecated resource " + str(?resource) + " is still in use." as ?warning) + BIND ("PRODERROR: Deprecated resource " + str(?resource) + " is still in use." as ?warning) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_underspecified_examples.sparql b/etc/testing/hygiene_parameterized/testHygiene_underspecified_examples.sparql deleted file mode 100644 index c6b3431dc..000000000 --- a/etc/testing/hygiene_parameterized/testHygiene_underspecified_examples.sparql +++ /dev/null @@ -1,94 +0,0 @@ -prefix owl: -prefix rdf: -prefix xsd: -prefix rdfs: - -## -# banner We should provide all required properties for examples. - -SELECT DISTINCT ?error ?instance ?property -WHERE -{ - ?instance rdf:type ?class. - FILTER (ISIRI(?instance)) - - - ?class rdfs:subClassOf ?restriction. - ?restriction rdf:type owl:Restriction. - { - ?restriction owl:onProperty ?property. - ?restriction owl:onClass ?restrictingClass. - ?restriction owl:minQualifiedCardinality ?cardinality. - FILTER (?cardinality > 0) - } - UNION - { - ?restriction owl:onProperty ?property. - ?restriction owl:someValuesFrom ?restrictingClass. - } - - FILTER NOT EXISTS - { - {?property owl:inverseOf ?inverseProperty.} - UNION - {?inverseProperty owl:inverseOf ?property.} - - ?subInverseProperty rdfs:subPropertyOf* ?inverseProperty. - ?inverseRestriction owl:hasValue ?instance. - ?restrictedClass rdfs:subClassOf* ?restrictingClass. - ?restrictedClass rdfs:subClassOf* ?inverseRestriction. - } - - FILTER NOT EXISTS - { - ?instance (owl:sameAs | ^owl:sameAs)* ?sameasinstance. - {?property owl:inverseOf ?inverseProperty.} - UNION - {?inverseProperty owl:inverseOf ?property.} - - ?subInverseProperty rdfs:subPropertyOf* ?inverseProperty. - ?inverseRestriction owl:hasValue ?sameasinstance. - ?restrictedClass rdfs:subClassOf* ?restrictingClass. - ?restrictedClass rdfs:subClassOf* ?inverseRestriction. - } - - FILTER NOT EXISTS - { - {?property owl:inverseOf ?inverseProperty.} - UNION - {?inverseProperty owl:inverseOf ?property.} - - ?subInverseProperty rdfs:subPropertyOf* ?inverseProperty. - ?inverseInstance ?subInverseProperty ?instance. - ?inverseInstance rdf:type/rdfs:subClassOf* ?restrictingClass. - } - - FILTER NOT EXISTS - { - ?instance (owl:sameAs | ^owl:sameAs)* ?sameasinstance. - {?property owl:inverseOf ?inverseProperty.} - UNION - {?inverseProperty owl:inverseOf ?property.} - - ?subInverseProperty rdfs:subPropertyOf* ?inverseProperty. - ?inverseInstance ?subInverseProperty ?sameasinstance. - ?inverseInstance rdf:type/rdfs:subClassOf* ?restrictingClass. - } - - FILTER NOT EXISTS - { - ?subProperty rdfs:subPropertyOf* ?property. - ?instance ?subProperty ?value. - - } - - FILTER NOT EXISTS - { - ?instance (owl:sameAs | ^owl:sameAs)* ?sameasinstance. - ?subProperty rdfs:subPropertyOf* ?property. - ?sameasinstance ?subProperty ?value. - } - - BIND (concat ("WARN: Individual ", STR(?instance), " looks like an unfinished example because it is missing a property required by its type.") AS ?error) -} -ORDER BY ?instance \ No newline at end of file From 5770a0ea7ece5d3caca6cfdbbf2aeb88d0a620f0 Mon Sep 17 00:00:00 2001 From: mereolog Date: Mon, 24 Jun 2024 16:17:21 +0200 Subject: [PATCH 4/9] fixes to some hygiene test for obsolete restrictions Signed-off-by: mereolog --- ...iene_obsolete_restrictions_exact&min.sparql | 4 ++-- ...solete_restrictions_exact&min_remote.sparql | 2 +- ...solete_restrictions_max&exact_remote.sparql | 2 +- ...estHygiene_obsolete_restrictions_max.sparql | 4 ++-- ...iene_obsolete_restrictions_max@exact.sparql | 2 +- ...ene_obsolete_restrictions_max_remote.sparql | 2 +- ...estHygiene_obsolete_restrictions_min.sparql | 4 ++-- ...ene_obsolete_restrictions_min_remote.sparql | 2 +- ...te_restrictions_someValuesFrom&exact.sparql | 12 ++++++------ ...rictions_someValuesFrom&exact_remote.sparql | 12 ++++++------ ...lete_restrictions_someValuesFrom&min.sparql | 17 +++++++++-------- ...strictions_someValuesFrom&min_remote.sparql | 18 +++++++++--------- ...obsolete_restrictions_someValuesFrom.sparql | 4 ++-- ...e_restrictions_someValuesFrom_remote.sparql | 2 +- 14 files changed, 44 insertions(+), 43 deletions(-) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql index 6c92f7862..212460fe3 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql @@ -20,12 +20,12 @@ WHERE ?restriction2 owl:onClass ?restrictingClass2. ?restriction1 owl:qualifiedCardinality ?cardinality1. ?restriction2 owl:minQualifiedCardinality ?cardinality2. - ?property1 rdfs:subPropertyOf* ?property2. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restriction1 != ?restriction2) FILTER (?cardinality1 >= ?cardinality2) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " exactly ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql index 6a0907aa3..cc5979add 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql @@ -21,7 +21,7 @@ WHERE ?restriction2 owl:onClass ?restrictingClass2. ?restriction1 owl:qualifiedCardinality ?cardinality1. ?restriction2 owl:minQualifiedCardinality ?cardinality2. - ?property1 rdfs:subPropertyOf* ?property2. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restriction1 != ?restriction2) FILTER (?cardinality1 >= ?cardinality2) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql index 16449baf1..8e275a884 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql @@ -22,7 +22,7 @@ WHERE ?restriction2 owl:onClass ?restrictingClass2. ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:qualifiedCardinality ?cardinality2. - ?property1 rdfs:subPropertyOf* ?property2. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restriction1 != ?restriction2) FILTER (?cardinality1 >= ?cardinality2) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql index 2fcc8f39e..1fc1fd622 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql @@ -21,7 +21,7 @@ WHERE ?restriction2 owl:onClass ?restrictingClass2. ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:maxQualifiedCardinality ?cardinality2. - ?property1 rdfs:subPropertyOf* ?property2. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restriction1 != ?restriction2) FILTER (?cardinality1 >= ?cardinality2) @@ -29,5 +29,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " max ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " max ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete max cardinality restriction <", ?restriction1String, "> because of max cardinality restriction <", ?restriction2String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete max cardinality restriction <", ?restriction1String, "> because of max cardinality restriction <", ?restriction2String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql index 3e3fef54d..8a2497dec 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql @@ -21,7 +21,7 @@ WHERE ?restriction2 owl:onClass ?restrictingClass2. ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:qualifiedCardinality ?cardinality2. - ?property1 rdfs:subPropertyOf* ?property2. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restriction1 != ?restriction2) FILTER (?cardinality1 >= ?cardinality2) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql index 0678edf2e..fdef4f77b 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql @@ -22,7 +22,7 @@ WHERE ?restriction2 owl:onClass ?restrictingClass2. ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:maxQualifiedCardinality ?cardinality2. - ?property1 rdfs:subPropertyOf* ?property2. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restriction1 != ?restriction2) FILTER (?cardinality1 >= ?cardinality2) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql index a0e89f32e..b64194a45 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql @@ -21,7 +21,7 @@ WHERE ?restriction2 owl:onClass ?restrictingClass2. ?restriction1 owl:minQualifiedCardinality ?minCardinality1. ?restriction2 owl:minQualifiedCardinality ?minCardinality2. - {?property1 rdfs:subPropertyOf+ ?property2.} UNION {?property1 rdfs:subPropertyOf* ?property2. FILTER (?property1 = ?property2)} + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER (?minCardinality1 >= ?minCardinality2) @@ -29,5 +29,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?minCardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?minCardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql index 58cbfe347..95d0762cd 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql @@ -22,7 +22,7 @@ WHERE ?restriction2 owl:onClass ?restrictingClass2. ?restriction1 owl:minQualifiedCardinality ?minCardinality1. ?restriction2 owl:minQualifiedCardinality ?minCardinality2. - {?property1 rdfs:subPropertyOf+ ?property2.} UNION {?property1 rdfs:subPropertyOf* ?property2. FILTER (?property1 = ?property2)} + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER (?minCardinality1 >= ?minCardinality2) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql index 1f9fe387e..fb1c74e83 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql @@ -16,15 +16,15 @@ WHERE ?restriction2 rdf:type owl:Restriction. ?restriction1 owl:onProperty ?property1. ?restriction2 owl:onProperty ?property2. - ?restriction1 owl:someValuesFrom ?restrictingClass1. ?restriction2 owl:onClass ?restrictingClass2. - ?restriction2 owl:qualifiedCardinality ?cardinality2. - ?property1 rdfs:subPropertyOf* ?property2. + ?restriction2 owl:someValuesFrom ?restrictingClass2. + ?restriction1 owl:qualifiedCardinality ?cardinality1. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restriction1 != ?restriction2) - FILTER (?cardinality2 > 0) + FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) - BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR("1"), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " exact ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete exact cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql index 92176e6a9..713b655d6 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql @@ -17,15 +17,15 @@ WHERE ?restriction2 rdf:type owl:Restriction. ?restriction1 owl:onProperty ?property1. ?restriction2 owl:onProperty ?property2. - ?restriction1 owl:someValuesFrom ?restrictingClass1. ?restriction2 owl:onClass ?restrictingClass2. - ?restriction2 owl:qualifiedCardinality ?cardinality2. - ?property1 rdfs:subPropertyOf* ?property2. + ?restriction2 owl:someValuesFrom ?restrictingClass2. + ?restriction1 owl:qualifiedCardinality ?cardinality1. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restriction1 != ?restriction2) - FILTER (?cardinality2 > 0) + FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) - BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR("1"), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " exact ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete exact cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete someValues restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql index 0236ee715..9af25746e 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql @@ -16,14 +16,15 @@ WHERE ?restriction2 rdf:type owl:Restriction. ?restriction1 owl:onProperty ?property1. ?restriction2 owl:onProperty ?property2. - ?restriction1 owl:someValuesFrom ?restrictingClass1. - ?restriction2 owl:onClass ?restrictingClass2. - ?restriction2 owl:minQualifiedCardinality ?cardinality2. - ?property1 rdfs:subPropertyOf* ?property2. + ?restriction1 owl:onClass ?restrictingClass1. + ?restriction2 owl:someValuesFrom ?restrictingClass2. + ?restriction1 owl:minQualifiedCardinality ?cardinality1. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. - FILTER (?cardinality2 > 0) + FILTER (?restriction1 != ?restriction2) + FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) - BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR("1"), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) - BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) + BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND (CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql index 7e7a19b60..a47644b87 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql @@ -12,19 +12,19 @@ WHERE { ?class rdfs:subClassOf+ ?restriction1. ?superClass rdfs:subClassOf ?restriction1. - ?class rdfs:subClassOf ?restriction2. ?restriction1 rdf:type owl:Restriction. ?restriction2 rdf:type owl:Restriction. ?restriction1 owl:onProperty ?property1. ?restriction2 owl:onProperty ?property2. - ?restriction1 owl:someValuesFrom ?restrictingClass1. - ?restriction2 owl:onClass ?restrictingClass2. - ?restriction2 owl:minQualifiedCardinality ?cardinality2. - ?property1 rdfs:subPropertyOf* ?property2. + ?restriction1 owl:onClass ?restrictingClass1. + ?restriction2 owl:someValuesFrom ?restrictingClass2. + ?restriction1 owl:minQualifiedCardinality ?cardinality1. + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. - FILTER (?cardinality2 > 0) + FILTER (?restriction1 != ?restriction2) + FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) - BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR("1"), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) - BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete min cardinality restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) + BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) + BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) + BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete someValues restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql index e986428cf..95b2d46fc 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql @@ -19,11 +19,11 @@ WHERE ?restriction2 owl:onProperty ?property2. ?restriction1 owl:someValuesFrom ?restrictingClass1. ?restriction2 owl:someValuesFrom ?restrictingClass2. - {?property1 rdfs:subPropertyOf+ ?property2.} UNION {?property1 rdfs:subPropertyOf* ?property2. FILTER (?property1 = ?property2)} + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql index 6778514f3..8d4e029b0 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql @@ -21,7 +21,7 @@ WHERE ?restriction2 owl:onProperty ?property2. ?restriction1 owl:someValuesFrom ?restrictingClass1. ?restriction2 owl:someValuesFrom ?restrictingClass2. - {?property1 rdfs:subPropertyOf+ ?property2.} UNION {?property1 rdfs:subPropertyOf* ?property2. FILTER (?property1 = ?property2)} + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER regex(str(?class), ) From 392dc2249356b39b31c26757145deefd8b46a3dc Mon Sep 17 00:00:00 2001 From: mereolog Date: Mon, 24 Jun 2024 16:19:09 +0200 Subject: [PATCH 5/9] fixes to some hygiene test for obsolete restrictions Signed-off-by: mereolog --- .../testHygiene_obsolete_restrictions_exact&min.sparql | 2 +- .../testHygiene_obsolete_restrictions_max.sparql | 2 +- .../testHygiene_obsolete_restrictions_min.sparql | 2 +- ...estHygiene_obsolete_restrictions_someValuesFrom&exact.sparql | 2 +- .../testHygiene_obsolete_restrictions_someValuesFrom&min.sparql | 2 +- .../testHygiene_obsolete_restrictions_someValuesFrom.sparql | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql index 212460fe3..1b791a54b 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql @@ -27,5 +27,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " exactly ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql index 1fc1fd622..3d3d6b216 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql @@ -29,5 +29,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " max ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " max ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete max cardinality restriction <", ?restriction1String, "> because of max cardinality restriction <", ?restriction2String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete max cardinality restriction <", ?restriction1String, "> because of max cardinality restriction <", ?restriction2String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql index b64194a45..34f00ea1e 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql @@ -29,5 +29,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?minCardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?minCardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql index fb1c74e83..77d65a3ec 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql @@ -26,5 +26,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " exact ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql index 9af25746e..c86ea3266 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql @@ -26,5 +26,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND (CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND (CONCAT("WARN: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql index 95b2d46fc..b81b838b7 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql @@ -25,5 +25,5 @@ WHERE FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file From d4b7f2217e54e94cd052d51df5c4726e0793f653 Mon Sep 17 00:00:00 2001 From: mereolog Date: Mon, 24 Jun 2024 16:39:07 +0200 Subject: [PATCH 6/9] simplification of hygiene tests for obsolete restrictions Signed-off-by: mereolog --- .../testHygiene_obsolete_restrictions_exact&min.sparql | 3 +-- ...testHygiene_obsolete_restrictions_exact&min_remote.sparql | 3 +-- ...ql => testHygiene_obsolete_restrictions_max&exact.sparql} | 3 +-- ...testHygiene_obsolete_restrictions_max&exact_remote.sparql | 3 +-- .../testHygiene_obsolete_restrictions_max.sparql | 2 +- .../testHygiene_obsolete_restrictions_max_remote.sparql | 3 +-- .../testHygiene_obsolete_restrictions_min.sparql | 2 +- .../testHygiene_obsolete_restrictions_min_remote.sparql | 2 +- ...Hygiene_obsolete_restrictions_someValuesFrom&exact.sparql | 3 +-- ..._obsolete_restrictions_someValuesFrom&exact_remote.sparql | 5 ++--- ...stHygiene_obsolete_restrictions_someValuesFrom&min.sparql | 3 +-- ...ne_obsolete_restrictions_someValuesFrom&min_remote.sparql | 3 +-- .../testHygiene_obsolete_restrictions_someValuesFrom.sparql | 2 +- ...ygiene_obsolete_restrictions_someValuesFrom_remote.sparql | 2 +- 14 files changed, 15 insertions(+), 24 deletions(-) rename etc/testing/hygiene_parameterized/{testHygiene_obsolete_restrictions_max@exact.sparql => testHygiene_obsolete_restrictions_max&exact.sparql} (93%) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql index 1b791a54b..ac8e449c7 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql @@ -21,8 +21,7 @@ WHERE ?restriction1 owl:qualifiedCardinality ?cardinality1. ?restriction2 owl:minQualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. - FILTER (?restriction1 != ?restriction2) + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?cardinality1 >= ?cardinality2) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " exactly ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql index cc5979add..1ff07d1bf 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql @@ -22,8 +22,7 @@ WHERE ?restriction1 owl:qualifiedCardinality ?cardinality1. ?restriction2 owl:minQualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. - FILTER (?restriction1 != ?restriction2) + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?cardinality1 >= ?cardinality2) FILTER (?cardinality2 > 0) FILTER regex(str(?class), ) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact.sparql similarity index 93% rename from etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql rename to etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact.sparql index 8a2497dec..77b2c128c 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max@exact.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact.sparql @@ -22,8 +22,7 @@ WHERE ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:qualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. - FILTER (?restriction1 != ?restriction2) + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?cardinality1 >= ?cardinality2) FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql index 8e275a884..b3b62dc25 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql @@ -23,9 +23,8 @@ WHERE ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:qualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) - FILTER (?cardinality1 >= ?cardinality2) FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " max ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql index 3d3d6b216..f6e88539f 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql @@ -22,7 +22,7 @@ WHERE ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:maxQualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER (?cardinality1 >= ?cardinality2) FILTER (?cardinality2 > 0) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql index fdef4f77b..7c8217c9a 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql @@ -23,8 +23,7 @@ WHERE ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:maxQualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. - FILTER (?restriction1 != ?restriction2) + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?cardinality1 >= ?cardinality2) FILTER (?cardinality2 > 0) FILTER regex(str(?class), ) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql index 34f00ea1e..0b36c12e7 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql @@ -22,7 +22,7 @@ WHERE ?restriction1 owl:minQualifiedCardinality ?minCardinality1. ?restriction2 owl:minQualifiedCardinality ?minCardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {{?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER (?minCardinality1 >= ?minCardinality2) FILTER (?minCardinality1 != 0) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql index 95d0762cd..52c389eec 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql @@ -23,7 +23,7 @@ WHERE ?restriction1 owl:minQualifiedCardinality ?minCardinality1. ?restriction2 owl:minQualifiedCardinality ?minCardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {{?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER (?minCardinality1 >= ?minCardinality2) FILTER (?minCardinality1 > 0) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql index 77d65a3ec..de64900e8 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql @@ -20,8 +20,7 @@ WHERE ?restriction2 owl:someValuesFrom ?restrictingClass2. ?restriction1 owl:qualifiedCardinality ?cardinality1. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. - FILTER (?restriction1 != ?restriction2) + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql index 713b655d6..4d5fd488b 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql @@ -20,9 +20,8 @@ WHERE ?restriction2 owl:onClass ?restrictingClass2. ?restriction2 owl:someValuesFrom ?restrictingClass2. ?restriction1 owl:qualifiedCardinality ?cardinality1. - {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. - FILTER (?restriction1 != ?restriction2) + {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql index c86ea3266..ae7897e11 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql @@ -20,8 +20,7 @@ WHERE ?restriction2 owl:someValuesFrom ?restrictingClass2. ?restriction1 owl:minQualifiedCardinality ?cardinality1. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. - FILTER (?restriction1 != ?restriction2) + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql index a47644b87..9377a5605 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql @@ -20,8 +20,7 @@ WHERE ?restriction2 owl:someValuesFrom ?restrictingClass2. ?restriction1 owl:minQualifiedCardinality ?cardinality1. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. - FILTER (?restriction1 != ?restriction2) + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql index b81b838b7..de34e36c6 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql @@ -20,7 +20,7 @@ WHERE ?restriction1 owl:someValuesFrom ?restrictingClass1. ?restriction2 owl:someValuesFrom ?restrictingClass2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {{?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql index 8d4e029b0..f5fdb8573 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql @@ -22,7 +22,7 @@ WHERE ?restriction1 owl:someValuesFrom ?restrictingClass1. ?restriction2 owl:someValuesFrom ?restrictingClass2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {{?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) From 7419a5cb20534a3399cc1f809a73c1013e46921b Mon Sep 17 00:00:00 2001 From: mereolog Date: Mon, 24 Jun 2024 17:12:42 +0200 Subject: [PATCH 7/9] removal of spuirous hygiene test for obsolete restrictions Signed-off-by: mereolog --- ...ene_obsolete_restrictions_exact&min.sparql | 4 +-- ...olete_restrictions_exact&min_remote.sparql | 4 +-- ...ene_obsolete_restrictions_max&exact.sparql | 3 +- ...olete_restrictions_max&exact_remote.sparql | 4 +-- ...stHygiene_obsolete_restrictions_max.sparql | 4 +-- ...ne_obsolete_restrictions_max_remote.sparql | 3 +- ...stHygiene_obsolete_restrictions_min.sparql | 4 +-- ...ne_obsolete_restrictions_min_remote.sparql | 35 ------------------- ...e_restrictions_someValuesFrom&exact.sparql | 4 +-- ...ictions_someValuesFrom&exact_remote.sparql | 6 ++-- ...ete_restrictions_someValuesFrom&min.sparql | 4 +-- ...trictions_someValuesFrom&min_remote.sparql | 29 --------------- ...bsolete_restrictions_someValuesFrom.sparql | 4 +-- ..._restrictions_someValuesFrom_remote.sparql | 31 ---------------- 14 files changed, 23 insertions(+), 116 deletions(-) delete mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql delete mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql delete mode 100644 etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql index ac8e449c7..20993bfc9 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min.sparql @@ -21,10 +21,10 @@ WHERE ?restriction1 owl:qualifiedCardinality ?cardinality1. ?restriction2 owl:minQualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?cardinality1 >= ?cardinality2) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " exactly ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql index 1ff07d1bf..38b6f86d0 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_exact&min_remote.sparql @@ -22,9 +22,9 @@ WHERE ?restriction1 owl:qualifiedCardinality ?cardinality1. ?restriction2 owl:minQualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?cardinality1 >= ?cardinality2) - FILTER (?cardinality2 > 0) + FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " exactly ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact.sparql index 77b2c128c..8a2497dec 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact.sparql @@ -22,7 +22,8 @@ WHERE ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:qualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?restriction1 != ?restriction2) FILTER (?cardinality1 >= ?cardinality2) FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql index b3b62dc25..8a99274fc 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max&exact_remote.sparql @@ -23,8 +23,8 @@ WHERE ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:qualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} - FILTER (?restriction1 != ?restriction2) + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?cardinality1 >= ?cardinality2) FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " max ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql index f6e88539f..1fc1fd622 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max.sparql @@ -22,12 +22,12 @@ WHERE ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:maxQualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restriction1 != ?restriction2) FILTER (?cardinality1 >= ?cardinality2) FILTER (?cardinality2 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " max ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " max ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete max cardinality restriction <", ?restriction1String, "> because of max cardinality restriction <", ?restriction2String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete max cardinality restriction <", ?restriction1String, "> because of max cardinality restriction <", ?restriction2String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql index 7c8217c9a..fdef4f77b 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_max_remote.sparql @@ -23,7 +23,8 @@ WHERE ?restriction1 owl:maxQualifiedCardinality ?cardinality1. ?restriction2 owl:maxQualifiedCardinality ?cardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. + FILTER (?restriction1 != ?restriction2) FILTER (?cardinality1 >= ?cardinality2) FILTER (?cardinality2 > 0) FILTER regex(str(?class), ) diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql index 0b36c12e7..b64194a45 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min.sparql @@ -22,12 +22,12 @@ WHERE ?restriction1 owl:minQualifiedCardinality ?minCardinality1. ?restriction2 owl:minQualifiedCardinality ?minCardinality2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {{?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restrictingClass1 = ?restrictingClass2)} + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER (?minCardinality1 >= ?minCardinality2) FILTER (?minCardinality1 != 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?minCardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?minCardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql deleted file mode 100644 index 52c389eec..000000000 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_min_remote.sparql +++ /dev/null @@ -1,35 +0,0 @@ -prefix rdf: -prefix rdfs: -prefix owl: -prefix xsd: -prefix afn: - -## -# banner We may want to avoid restrictions that can be remotely inferred from other restrictions. Here we check remote min cardinality restrictions. - - -SELECT ?error -WHERE -{ - ?class rdfs:subClassOf+ ?restriction1. - ?superClass rdfs:subClassOf ?restriction1. - ?class rdfs:subClassOf ?restriction2. - ?restriction1 rdf:type owl:Restriction. - ?restriction2 rdf:type owl:Restriction. - ?restriction1 owl:onProperty ?property1. - ?restriction2 owl:onProperty ?property2. - ?restriction1 owl:onClass ?restrictingClass1. - ?restriction2 owl:onClass ?restrictingClass2. - ?restriction1 owl:minQualifiedCardinality ?minCardinality1. - ?restriction2 owl:minQualifiedCardinality ?minCardinality2. - {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {{?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restrictingClass1 = ?restrictingClass2)} - FILTER (?restriction1 != ?restriction2) - FILTER (?minCardinality1 >= ?minCardinality2) - FILTER (?minCardinality1 > 0) - FILTER (?minCardinality2 > 0) - FILTER regex(str(?class), ) - BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?minCardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) - BIND (CONCAT(STR(afn:localname(?property2)), " min ", STR(?minCardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete min cardinality restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) -} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql index de64900e8..e1729db8b 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact.sparql @@ -20,10 +20,10 @@ WHERE ?restriction2 owl:someValuesFrom ?restrictingClass2. ?restriction1 owl:qualifiedCardinality ?cardinality1. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " exact ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql index 4d5fd488b..0a6ce0d8a 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&exact_remote.sparql @@ -11,7 +11,7 @@ SELECT ?error ?class WHERE { ?class rdfs:subClassOf+ ?restriction1. - ?superClass rdfs:subClassOf ?restriction1. + ?superClass rdfs:subClassOf ?restriction2. ?class rdfs:subClassOf ?restriction2. ?restriction1 rdf:type owl:Restriction. ?restriction2 rdf:type owl:Restriction. @@ -21,10 +21,10 @@ WHERE ?restriction2 owl:someValuesFrom ?restrictingClass2. ?restriction1 owl:qualifiedCardinality ?cardinality1. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " exact ", STR(?cardinality2), " ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete someValues restriction <", ?restriction2String, "> because of exact cardinality restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) + BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete someValues restriction <", ?restriction1String, "> because of exact cardinality restriction <", ?restriction2String, ">", " from class ", STR(?superClass)) as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql index ae7897e11..5a782d87c 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min.sparql @@ -20,10 +20,10 @@ WHERE ?restriction2 owl:someValuesFrom ?restrictingClass2. ?restriction1 owl:minQualifiedCardinality ?cardinality1. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} + ?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?cardinality1 > 0) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND (CONCAT("WARN: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) + BIND (CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql deleted file mode 100644 index 9377a5605..000000000 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom&min_remote.sparql +++ /dev/null @@ -1,29 +0,0 @@ -prefix rdf: -prefix rdfs: -prefix owl: -prefix xsd: -prefix afn: - -## -# banner We may want to avoid restrictions that can be remotely inferred from other restrictions. Here we check remote someValues and min cardinality restrictions. - -SELECT ?error ?class -WHERE -{ - ?class rdfs:subClassOf+ ?restriction1. - ?superClass rdfs:subClassOf ?restriction1. - ?restriction1 rdf:type owl:Restriction. - ?restriction2 rdf:type owl:Restriction. - ?restriction1 owl:onProperty ?property1. - ?restriction2 owl:onProperty ?property2. - ?restriction1 owl:onClass ?restrictingClass1. - ?restriction2 owl:someValuesFrom ?restrictingClass2. - ?restriction1 owl:minQualifiedCardinality ?cardinality1. - {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} - FILTER (?cardinality1 > 0) - FILTER regex(str(?class), ) - BIND (CONCAT(STR(afn:localname(?property1)), " min ", STR(?cardinality1), " ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) - BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete someValues restriction <", ?restriction2String, "> because of min cardinality restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) -} \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql index de34e36c6..95b2d46fc 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom.sparql @@ -20,10 +20,10 @@ WHERE ?restriction1 owl:someValuesFrom ?restrictingClass1. ?restriction2 owl:someValuesFrom ?restrictingClass2. {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {{?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restrictingClass1 = ?restrictingClass2)} + {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {?restrictingClass1 rdfs:subClassOf* ?restrictingClass2. FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restriction1 != ?restriction2) FILTER regex(str(?class), ) BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) + BIND(CONCAT("PRODERROR: Class ", STR(?class), " has obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">.") as ?error) } \ No newline at end of file diff --git a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql b/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql deleted file mode 100644 index f5fdb8573..000000000 --- a/etc/testing/hygiene_parameterized/testHygiene_obsolete_restrictions_someValuesFrom_remote.sparql +++ /dev/null @@ -1,31 +0,0 @@ -prefix rdf: -prefix rdfs: -prefix owl: -prefix xsd: -prefix afn: - -## -# banner We may want to avoid restrictions that can be remotely inferred from other restrictions. Here we check remote someValues restrictions. - - - -SELECT ?error -WHERE -{ - ?class rdfs:subClassOf+ ?restriction1. - ?superClass rdfs:subClassOf ?restriction1. - ?class rdfs:subClassOf ?restriction2. - ?restriction1 rdf:type owl:Restriction. - ?restriction2 rdf:type owl:Restriction. - ?restriction1 owl:onProperty ?property1. - ?restriction2 owl:onProperty ?property2. - ?restriction1 owl:someValuesFrom ?restrictingClass1. - ?restriction2 owl:someValuesFrom ?restrictingClass2. - {?property1 rdfs:subPropertyOf+ ?property2.} UNION {FILTER (?property1 = ?property2)} - {?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {{?restrictingClass1 rdfs:subClassOf+ ?restrictingClass2.} UNION {FILTER (?restrictingClass1 = ?restrictingClass2)} FILTER (?restrictingClass1 = ?restrictingClass2)} - FILTER (?restriction1 != ?restriction2) - FILTER regex(str(?class), ) - BIND (CONCAT(STR(afn:localname(?property1)), " someValuesFrom ", STR(afn:localname(?restrictingClass1))) as ?restriction1String) - BIND (CONCAT(STR(afn:localname(?property2)), " someValuesFrom ", STR(afn:localname(?restrictingClass2))) as ?restriction2String) - BIND(CONCAT("WARN: Class ", STR(?class), " may inherit obsolete someValues restriction <", ?restriction2String, "> because of someValues restriction <", ?restriction1String, ">", " from class ", STR(?superClass)) as ?error) -} \ No newline at end of file From a71846b629620f2725ead5800409d8d302604637 Mon Sep 17 00:00:00 2001 From: mereolog Date: Thu, 27 Jun 2024 18:20:30 +0200 Subject: [PATCH 8/9] fix to test for deprecated resources Signed-off-by: mereolog --- .../testHygiene_resources_deprecated.sparql | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql b/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql index 1b5d0eee6..90c934a65 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql @@ -6,20 +6,19 @@ prefix rdfs: ## # banner Deprecated resources should not be used. -SELECT DISTINCT ?warning ?resource +SELECT DISTINCT ?error ?resource WHERE { ?resource owl:deprecated "true"^^xsd:boolean . - FILTER NOT EXISTS {?resource rdf:type/rdf:type/(rdfs:subClassOf*) owl:Class.} FILTER regex(str(?resource), ) { ?resource ?property1 ?object. - FILTER (?property1 != owl:equivalentClass && ?property1 != owl:deprecated && ?property1 != rdf:type && ?property1 != owl:equivalentProperty) + FILTER (?property1 != owl:equivalentClass && ?property1 != owl:deprecated && ?property1 != rdf:type && ?property1 != owl:equivalentProperty && ?property1 != owl:sameAs) } UNION { ?subject ?property2 ?resource . - FILTER (?property2 != owl:equivalentClass && ?property2 != owl:deprecated && ?property2 != rdf:type && ?property2 != owl:equivalentProperty) + FILTER (?property2 != owl:equivalentClass && ?property2 != owl:deprecated && ?property2 != rdf:type && ?property2 != owl:equivalentProperty && ?property2 != owl:sameAs) } - BIND ("PRODERROR: Deprecated resource " + str(?resource) + " is still in use." as ?warning) + BIND ("PRODERROR: Deprecated resource " + str(?resource) + " is still in use." as ?error) } \ No newline at end of file From 276fc2c937a03bc1b1c16ff58e1c9ebad172a5de Mon Sep 17 00:00:00 2001 From: mereolog Date: Fri, 28 Jun 2024 16:40:01 +0200 Subject: [PATCH 9/9] check for deprecated excludes now individuals Signed-off-by: mereolog --- .../testHygiene_resources_deprecated.sparql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql b/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql index 90c934a65..b95922f8b 100644 --- a/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql +++ b/etc/testing/hygiene_parameterized/testHygiene_resources_deprecated.sparql @@ -10,15 +10,16 @@ SELECT DISTINCT ?error ?resource WHERE { ?resource owl:deprecated "true"^^xsd:boolean . + FILTER NOT EXISTS {?resource rdf:type owl:NamedIndividual} FILTER regex(str(?resource), ) { ?resource ?property1 ?object. - FILTER (?property1 != owl:equivalentClass && ?property1 != owl:deprecated && ?property1 != rdf:type && ?property1 != owl:equivalentProperty && ?property1 != owl:sameAs) + FILTER (?property1 != owl:equivalentClass && ?property1 != owl:deprecated && ?property1 != rdf:type && ?property1 != owl:equivalentProperty) } UNION { ?subject ?property2 ?resource . - FILTER (?property2 != owl:equivalentClass && ?property2 != owl:deprecated && ?property2 != rdf:type && ?property2 != owl:equivalentProperty && ?property2 != owl:sameAs) + FILTER (?property2 != owl:equivalentClass && ?property2 != owl:deprecated && ?property2 != rdf:type && ?property2 != owl:equivalentProperty) } BIND ("PRODERROR: Deprecated resource " + str(?resource) + " is still in use." as ?error) } \ No newline at end of file