Add SPARQL validation - #1425
Conversation
|
@JPEWdev may be related issue |
|
Generating these SPARQL rules from the text descriptions seemed like a really good fit for AI generation, and it did a really good job. |
Yes, I did notice that. It does work with correctly with BASE though, which is why I chose to use that instead. I think that should be good enough for the SPARQL queries |
RelationshipTypes values frequently place additional constraints on Relationship in which they are used. Previously, these could only be validated manually. However, it is also possible to write SPARQL queries that correctly enforce these constraints and provide useful error messages when they are validated. AI-Generated: Claude Sonnet 5
Adds SPARQL queries that enforce the additional restrictions required by various classes AI-Generated: Claude Sonnet 5
|
This will work as an example or for a validation? |
|
It turned out to be pretty easy to get the AI to spit out the SPARQL queries, so I would probably say this isn't an example anymore. I've been testing the rules by generating a model with spdx/spec-parser#213 applied to the spec parser and it does appear to work as intended |
|
Looks great. Will be really really useful if we can have this integrated into the published RDF/Turtule file: sh:sparql [
sh:message "..." ;
sh:select """
SELECT ...
""" ;
]which spdx/spec-parser#213 is exactly doing. In terms of human editor creation and review, this requires knowledge of SPARQL. (I have a different proposal, based on a YAML-based rule - which may be more author-friendly - but it is still another domain-specific language to learn - and not a standardized one like the SPARQL used here) |
An example SPARQL query in the model. See: spdx/spec-parser#213