Re: [dxwg] Indicate a conventional way to automatically validate data instances of application profiles (#698)

You can imagine a method deriving from the structures of the PROF ontology where code (a Linked Data crawler) could find a Profiles' resource with prof:role Validation (and perhaps a particular formalism of a Validation resource, such as SHACL or similar) and then it could recurse up a isProfileOf hierarchy finding all similar resources. Then, joining all those resources together, data claiming conformance could be validated against all. This would both ensure data is valid to a Profile and it's dependencies and also potentially allow Profile implementors to only have to define their extensions on the things they profile, not the full set of constraints.

In pseudo code, for `data_x` claiming adherence to `profile_y`:

```
profiles = get_profiles(profile_y)
validators = gather_validating_resources()
validate(data_x, aggregation_of_all_validators)

function get_profiles(profile_uri):
    recurse up a profile hierarchy indicated by isProfileOf statements and return all profiles' RDF

function gather_validating_resources(profiles_metadata, conformance_type):
    profile_validators = null
    for each profile in profiles_metadata:
        for each resource with role Validation and conformsTo conformance_type:
            add resource content to profile_validators

    return profile_validators
```

-- 
GitHub Notification of comment by nicholascar
Please view or discuss this issue at https://github.com/w3c/dxwg/issues/698#issuecomment-457800277 using your GitHub account

Received on Saturday, 26 January 2019 04:15:43 UTC