Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Model Integrity Checks #39

Closed
twalmsley opened this issue Aug 5, 2022 · 1 comment · Fixed by #42
Closed

Data Model Integrity Checks #39

twalmsley opened this issue Aug 5, 2022 · 1 comment · Fixed by #42
Assignees

Comments

@twalmsley
Copy link
Collaborator

HQDM has a lot of flexibility in how a data model is created, with none of the relationships being mandatory in the current code. This is not a problem in itself, but it raises the issue of how should HQDM be used and how can we check that the data model is not missing some required triple in the Jena database. Data Integration between databases will be easier if they all use HQDM in the same way.

One way is to implement a series of SPARQL data integrity checks that can be run against a database to check whether it complies with the guidelines agreed on by some interested community. For example, this SPARQL query CONSTRUCTS some triples to indicate when some required triples are missing. It checks that every participant_in an association is also a member_of_kind of at least one role (the constructed triples are only in the query results, not the database):

PREFIX hqdm: <http://www.semanticweb.org/hqdm#>

construct {
  ?s hqdm:error_participant_with_no_role "Should be a member_of_kind of a role.".
  ?s a ?type.
}
where {
    ?s hqdm:participant_in ?association;
       a ?type.
  
    ?association a hqdm:association.
  
    OPTIONAL {
      ?s hqdm:member_of_kind ?kind.
      ?kind a hqdm:role.
    }

    FILTER(!bound(?kind))
}

This might need to be a separate data-integrity or data-validation module with options to run it against local or remote SPARQL endpoints or against in-memory databases as part of unit tests in core.

@twalmsley twalmsley self-assigned this Aug 5, 2022
@twalmsley
Copy link
Collaborator Author

Theses checks were needed to get #38 working with the right test data, so they will be included in the same PR.

This was referenced Aug 12, 2022
@twalmsley twalmsley linked a pull request Aug 12, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant