ternaustralia / ontology_tern

TERN Ontology
https://linkeddata.tern.org.au/viewers/tern-ontology
Creative Commons Attribution 4.0 International
6 stars 4 forks source link

TERN loc ontology not needed #68

Closed nicholascar closed 2 years ago

nicholascar commented 2 years ago

The TERN Geometry class, https://w3id.org/tern/ontologies/loc/Geometry, is defined as a subclass of geo:Geometry but imposes no additional required properties*, thus it's not needed.

The purpose of tern:Geometry seems to be to indicate that a Geometry could/should have a geometry type, indicated by dcterms:type, but this can be realised by just using that property on a regular geo:Geometry instance.

The TERN Geometry also includes a Shape to ensure that, if dcterms:type is present, then it must be of type sh:IRI but again, this Shape can be defined for geo:Geometry.

So: remove the tern:Geometry class but retain the Shape! This will improve ease of use since we just have a GeoSPARQL Geometry but you may type it.

Likewise, tern:LineString, tern:Point & tern:Polygon are not needed as they can be replaced with the SF classes they subclass.

* sure, it says to use only WKT for the geometry literal but GeoSPARQL has conversion functions defined

nicholascar commented 2 years ago

Actually Point seems to be the only TERN class with much going on - depth, elevation etc.

There is a conflict in tern:Point:

and yet:

We do have data using WGS84, GDA94 and GDA2020 CRSes...

edmondchuc commented 2 years ago

Initially, tern-loc is just a combination of Basic Geo (WGS84) and GeoSPARQL for TERN's purposes. The usage of tern-loc may not be required once the TERN Ontology shapes have been separated and relaxed (https://github.com/ternaustralia/ontology_tern/issues/56 and https://github.com/ternaustralia/ontology_tern/issues/63).

Actually Point seems to be the only TERN class with much going on - depth, elevation etc.

I do see some value with tern:Point and tern:Geometry. Some enhancements in my mind:

You can now have multiple points in different coordinate reference systems (filter by tern-loc:crs).

These additions also make it easier to integrate with more traditional systems such as PostGIS (no need to parse and tokenise the GeoSPARQL WKT literal.

And it would resolve what you said about the conflict below.

There is a conflict in tern:Point:

  • wgs:lat -- exactly 1 (WGS84 only)
  • wgs:long -- exactly 1 (WGS84 only) and yet:
  • geo:asWKT (inherited) -- exactly 1 with the allowance of use of non-WGS84 WKT values.
nicholascar commented 2 years ago

In discussion with @edmondchuc:

dr-shorthair commented 2 years ago

I would agree with this.

There are two key approaches to developing a domain ontology

  1. create all new classes and relationships, then align them with external vocabs, but use the local names and namespace
  2. re-use external vocabs by preference, and only create new classes and relationships where existing ones don't exist

Style 2. ends up looking messier as it involves lots of namespaces, while 1. looks much cleaner. But if you want to surface the alignment, in order to support 'standard' queries etc, then re-using existing namespaces is probably a good idea.

Under style 2. you should only create new classes if they have additional properties and constraints - not otherwise.

Now where SHACL fits in all this is the question. I tend to see SHACL as a way to introduce rules on classes for a specific context. You can have different SHACL shapes for different applications on the same classes. So SHACL rules that go beyond the original definitions do not imply a new class. Others see SHACL as a replacement for OWL, so any SHACL rules that go beyond the OWL axiomatization would imply new classes.

I don't think the rules are hard and fast - it is a policy decision for TERN which way to go.

smguru commented 2 years ago

@dr-shorthair @nicholascar @edmondchuc probably make sense to use Style 2 approach.

dr-shorthair commented 2 years ago

re-using existing namespaces is probably a good idea.

particularly for properties, which are very important in queries.