Accord-Project / API-Development

API Development Working Area
0 stars 0 forks source link

concerns about complex hasTarget/hasValue #6

Closed VladimirAlexiev closed 6 months ago

VladimirAlexiev commented 7 months ago

Hi @beachtom (cc @Gonsco and @EdliraK and @maximelefrancois86 )!

While making the SOML and a GraphQL query structured similarly to FI2.jsonld, I came up to this complex fragment:

                {
                  "asText": "exceed five per cent",
                  "$id": "Government_Decree_on_Accessibility_of_building/2.1.2.4",
                  "identifier": "2.1.2.4",
                  "isOperationalizedBy": {
                    "$id": "Government_Decree_on_Accessibility_of_building/2.1.2.4_method",
                    "identifier": "2.1.2.4_method",
                    "hasTarget": {
                      "hasTarget": {
                        "$type": "FunctionCheckMethod",
                        "$id": "Government_Decree_on_Accessibility_of_building/2.1.2.4_method.1.1",
                        "identifier": "2.1.2.4_method.1.1",
                        "executes": "functions:tan",
                        "hasValue": [
                          {
                            "hasTarget": {
                              "$id": "terms:Slope",
                              "$type": "$id"
                            },
                            "hasValue": {
                              "hasTarget": "pi",
                              "hasValue": "180",
                              "$type": "NumericalCheckMethod",
                              "hasComparator": "CheckMethodOperator-division",
                              "$id": "Government_Decree_on_Accessibility_of_building/2.1.2.4_method.1.1.1.2",
                              "identifier": "2.1.2.4_method.1.1.1.2"
                            },
                            "$type": "CompositeCheckMethod",
                            "hasComparator": "CheckMethodOperator-multiplication",
                            "$id": "Government_Decree_on_Accessibility_of_building/2.1.2.4_method.1.1.1",
                            "identifier": "2.1.2.4_method.1.1.1"
                          }
                        ]
                      },
                      "hasValue": "100",
                      "$type": "NumericalCheckMethod",
                      "hasComparator": "CheckMethodOperator-multiplication",
                      "$id": "Government_Decree_on_Accessibility_of_building/2.1.2.4_method.1",
                      "identifier": "2.1.2.4_method.1"
                    },
                    "hasComparator": "CheckMethodComparator-gt",
                    "$type": "NumericalCheckMethod",
                    "hasValue": "5",
                    "hasUnit": "%"
                  },
                  "$type": [
                    "CheckStatement",
                    "RequirementStatement"
                  ]
                },
beachtom commented 7 months ago

So this was a tounge in cheek example to see how complex it could do and not break everything. I did produce a simpler version without all the complex rules expanded - but I am unsure which is better:

https://github.com/Accord-Project/bcrl/blob/main/FI-accessibility-experiment/Tom%20Example/FI2a.yaml

You raise a few points that I think we should look at:

Can you confirm that the formula here is tan(Slope(pi/180))100>5 - Yes

Is the nesting of hasTarget {hasTarget correct? - Yes "hasComparator": "CheckMethodOperator-division": but this arithmetic operator is not a comparison (and similarly for multiplication) -This is true - perhaps we need an hasOperator instead?

"hasTarget": "pi" will not resolve to a reasonable URL since it has no prefix - Yes - how would you suggest - is there an ontology of known mathematical constants we can reference against?

functions: prefix is not defined- It should be - must have dropped of the definitions somehow I will fix

VladimirAlexiev commented 7 months ago

@beachtom see last bullet in Descr (added)

beachtom commented 7 months ago

@VladimirAlexiev regarding the last bullet - now we have scoped that perhaps need graphQL does this mean this still does need to be fixed?

maximelefrancois86 commented 7 months ago

we have https://w3id.org/lbd/aec3po/hasOperator in module _checkmethod

beachtom commented 6 months ago

This is now sorted