opengeospatial / ogc-geosparql

Public Repository for the OGC GeoSPARQL Standards Working Group
78 stars 20 forks source link

Create a validator for 1.1 RDF #113

Closed nicholascar closed 2 years ago

nicholascar commented 3 years ago

We should add a resource to the 1.1. profile with the role validation, i.e. something that can be used to validate RDF data claiming conformance to GeoSPARQL 1.1.

I can create such a resource using SHACL and I invite anyone else to create any other validators they are interested in (SPIN, ShEx etc.).

FransKnibbe commented 3 years ago

Am I right in assuming validation will not include geometry literals?

nicholascar commented 3 years ago

Am I right in assuming validation will not include geometry literals?

Correct: we can't write SHACL that "looks inside" the geometry literals and performs any tests with them, so any SHACL tests will be for graph pattern issues only, e.g. is something declared to be both a Feature and a Geometry at the same time (not allowed, disjoint classes).

I'll propose a series of SHACL tests and then ask people to compare them not only to the ontology rules but also the intention of the ontology as it may be we can write SHACL rules for things that were intended in the ontology (or the specification, rather) but not implemented as OWL rules.

FransKnibbe commented 3 years ago

I'll propose a series of SHACL tests and then ask people to compare them not only to the ontology rules but also the intention of the ontology as it may be we can write SHACL rules for things that were intended in the ontology (or the specification, rather) but not implemented as OWL rules.

@nicholascar: could you give an example of such an intention?

I like the idea: SHACL tests could not only help implementers, but also help us in identifying (fringe) cases that could warrant more clarification in the spec.

nicholascar commented 3 years ago

could you give an example of such an intention?

Perhaps something like "every Geometry should be associated with 1+ Feature instances". You can make such rules in OWL but it's a lot easier in SHACL. I don't know if that rule should be true - there may be good reason to have independent Geometry instances - but it's that sort of thing.

Give me a few days and I'll properly review the ontology rules and also statements and requirements in the Specification and see if that leads to any such SHACL rules.

mathib commented 3 years ago

@nicholascar In case it come's in handy, I've made SHACL shapes for OMG/FOG in the past. They probably already contain a lot of constructs that are relevant for GeoSPARQL as well

Don't confuse OWL with SHACL, in the sense that OWL axioms are rather declaritive (meant for open world assumption and reasoning) while SHACL is meant for validating (rather closed world). Before SHACL and SheX existed, people used OWL axioms to express such validation patterns (constraints) in OWL since there was nothing else, potentially leading to a lot of confusion (a reasoner will interpret it differently than a validator engine) but I think this should now be avoided

nicholascar commented 3 years ago

Don't confuse OWL with SHACL

I won't! This is why, now that we have SHACL, I'm aware that there may be a whole family of constraints that are relevant to GeoSPARQL that are able to be expressed in SHACL that weren't able to be expressed in OWL.

Thanks for the OMG/FOG SHACL link: I'll check them out too.

nicholascar commented 2 years ago

Long since added: https://github.com/opengeospatial/ogc-geosparql/blob/master/1.1/validator.ttl