semanticarts / gist

Semantic Arts gist upper enterprise ontology
Creative Commons Attribution 4.0 International
154 stars 18 forks source link

Implement versioning ontology #979

Open rjyounes opened 11 months ago

rjyounes commented 11 months ago

The primary value is for managing dependencies in ontologies importing gist (sub-gists, client ontologies).

See https://github.com/semanticarts/versioning-ontology.

gist will declare its version (X.x.x) and the dependency on the versioning ontology.

We also need to include the validation queries in the repository.

@Jamie-SA We will need to make the operators-ontology and the versioning ontology downloadable to enable a Protege import of gist, since gist will import the versioning ontology, which imports the operators ontology.

rjyounes commented 10 months ago

Protege needs the versioned imports.

DECISION: Implement the versioning ontology and use versioned IRIs in owl:imports.

To dos: I will submit a single PR for those assigned to me:

I've added separate issues for these:

@Jamie-SA #983 Make the operators and versioning ontologies accessible over HTTP for gist users. I forgot to mention this one today - I believe it's needed. @rjyounes @dylan-sa Update materialize subclass inference script to include version and version dependencies. Dylan, I have an approach in mind that will work for this.

pmcb55 commented 10 months ago

It's great to see an explicit effort at vocab versioning - so congrats on this work!

But I notice that even though your Versioning vocab does use a prefix (i.e., @prefix ver: <https://w3id.org/semanticarts/ns/ontology/versioning/> .), it's not declaring that prefix (or it's namespace IRI) using the SHACL PrefixDeclaration class. Is this a deliberate omission, or an oversight...?

Also, just for information, but were you guys aware of the work on PLOW from Field33 (paper here: https://ebooks.iospress.nl/pdf/doi/10.3233/SSW220015), with GitHub repo here: https://github.com/field33/plow

I'm not very familiar with PLOW myself (and the Field33 website seems to have disappeared!), but I'd assume there might be some interesting overlap...

uscholdm commented 10 months ago

But I notice that even though your Versioning vocab does use a prefix (i.e., @prefix ver: https://w3id.org/semanticarts/ns/ontology/versioning/ .), it's not declaring that prefix (or it's namespace IRI) using the SHACL PrefixDeclaration class. Is this a deliberate omission, or an oversight...?

@rjyounes, I don't know whether we want it or not. What do you think?

rjyounes commented 10 months ago

I don't know either. That was something we implemented in gist, we haven't done it for our ontologies across the board. I don't have strong feelings either way.

uscholdm commented 10 months ago

I don't know either. That was something we implemented in gist, we haven't done it for our ontologies across the board. I don't have strong feelings either way.

Should we bring this to the group?

rjyounes commented 10 months ago

It's not a gist issue. Why don't you ask Boris and the two of you can make a decision?

pmcb55 commented 10 months ago

Just my 2c-worth of input to the above decision, but if you guys 'preferred' to define and use a prefix for this ontology (and you clearly did with ver:), i.e.:

@prefix ver: <https://w3id.org/semanticarts/ns/ontology/versioning/> .

ver:SemanticVersionNumber
    a owl:Class ;

...then wouldn't you assume consumers of the terms defined in this ontology might 'prefer' to do likewise (I sure would), so I'd like if this ontology explicitly provided that 'preference' in a machine-readable way. We all know it is just a 'preference' anyways, so where's the harm!?

uscholdm commented 10 months ago

Also, just for information, but were you guys aware of the work on PLOW from Field33 (paper here: https://ebooks.iospress.nl/pdf/doi/10.3233/SSW220015), with GitHub repo here: https://github.com/field33/plow

No I had not heard of this, most interesting. Thanks for the reference. @sa-bpelakh, what do you think?

uscholdm commented 10 months ago

...then wouldn't you assume consumers of the terms defined in this ontology might 'prefer' to do likewise (I sure would), so I'd like if this ontology explicitly provided that 'preference' in a machine-readable way. We all know it is just a 'preference' anyways, so where's the harm!?

I'm not sure exactly what you are proposing. Are you saying to declare the namespace and ver: prefix using the SHACL PrefixDeclaration. Where would that declaration go?

BTW, the ver: prefix is introduced in the separate versioning ontology which we wanted to keep independent from gist. See: https://github.com/semanticarts/versioning-ontology/

sa-bpelakh commented 10 months ago

Also, just for information, but were you guys aware of the work on PLOW from Field33 (paper here: https://ebooks.iospress.nl/pdf/doi/10.3233/SSW220015), with GitHub repo here: https://github.com/field33/plow

No I had not heard of this, most interesting. Thanks for the reference. @sa-bpelakh, what do you think?

It's pretty neat, basically what we did but with a nice tool wrapping it. The dependencies are flatter than ours, e.g.

registry:dependency "@other/other_ontology =0.1.2" ;

as opposed to our operator-based structure. This wasn't around when we came up with this 4-5 years ago, or I would have used it. Didn't cover the other parts, i.e. application versioning and data sets.

pmcb55 commented 10 months ago

Hiya Michael,

I'm not sure exactly what you are proposing.

Oh, all I'm proposing is adding some extra metadata to the Versioning ontology itself - i.e., just adding these triples:

<https://w3id.org/semanticarts/ontology/versioning> sh:declare ver:_PrefixDeclaration_versioning .

ver:_PrefixDeclaration_versioning a sh:PrefixDeclaration ;
    sh:namespace "https://w3id.org/semanticarts/ns/ontology/versioning/"^^xsd:anyURI;
    sh:prefix "ver".  

...so that the ontology itself is described like this (new triples added to the end):

<https://w3id.org/semanticarts/ontology/versioning>
    a owl:Ontology ;
    owl:imports <https://w3id.org/semanticarts/ontology/operators1.0.0> ;
    owl:versionIRI <https://w3id.org/semanticarts/ontology/versioningX.x.x> ;
    skos:definition "Generic concepts for semantic versioning of a suite of artifacts for semantic systems in production."^^xsd:string ;
    skos:editorialNote "Although this was originally intended for semantic version numbers, the ontology could be tweaked in a very small way to use different version numbers, so long as they are ordered."^^xsd:string ;
    skos:example "The semantic version number for the disease taxonomy is 6.3.0. This version depends on the version of the imported disease ontology being at least 3.1.0 and less than 4.0.0. It also depends on the version of gist core being at least 12.1.0 and less than 13.0.0."^^xsd:string ;
    skos:prefLabel "Semantic Versioning Ontology"^^xsd:string ;
    ver:hasVersionNumber [
        a ver:SemanticVersionNumber ;
        ver:uniqueText "X.x.x"^^xsd:string ;
    ] ;
        sh:declare ver:_PrefixDeclaration_versioning .

ver:_PrefixDeclaration_versioning a sh:PrefixDeclaration ;
    sh:namespace "https://w3id.org/semanticarts/ns/ontology/versioning/"^^xsd:anyURI;
    sh:prefix "ver".
sa-bpelakh commented 10 months ago

@pmcb55 Usually we do not include SHACL dependencies in the ontology itself but include an auxiliary annotation file like https://github.com/semanticarts/gist/blob/develop/gistPrefixDeclarations.ttl instead. Would that be sufficient?

pmcb55 commented 10 months ago

Hiya @sa-bpelakh - so I think I get why you have that separate gistPrefixDeclarations.ttl file, as it (at the moment) only contains declarations for common and standard vocabs that don't provide any preferred prefix or namespace triples themselves (since they're all so 'old'!). So that makes perfect sense to me - I've no problem with that at all.

But when creating a new ontology (like this versioning ontology), or evolving an existing one (like gist itself), I don't see any reason not to include the PrefixDeclaration triples directly in the ontology itself, since it's just more descriptive metadata about the ontology itself, just like skos:definition or owl:versionIRI (i.e., I don't think anyone would expect those triples to be in separate file, so what's different for the PrefixDeclaration triples that would justify moving them out into a separate file...?)

Jamie-SA commented 10 months ago

Usually we do not include SHACL dependencies in the ontology itself but include an auxiliary annotation file like https://github.com/semanticarts/gist/blob/develop/gistPrefixDeclarations.ttl instead. Would that be sufficient?

@sa-bpelakh we do have a SHACL PrefixDeclaration in gistCore now.

gist:_PrefixDeclaration_gist
    a sh:PrefixDeclaration ;
    sh:namespace "https://w3id.org/semanticarts/ns/ontology/gist/"^^xsd:anyURI ;
    sh:prefix "gist"^^xsd:string ;

The gistPrefixDeclarations.ttl file includes declarations for all the ontologies that we use that don't have their own PrefixDeclarations. But I think we would recommend putting the declaration in the actual ontology.

As discussed elsewhere, we have discussed, and decided against, importing SHACL (and SKOS).

rjyounes commented 6 months ago

Moved to 12.2.0

rjyounes commented 6 months ago

I am now realizing that we should have minimally added gist's declaration of its own version so that importing ontologies can implement the versioning ontology by stating their dependencies. We are looking to do this in one of our client projects. @sa-bpelakh @uscholdm What do you think of issuing a 12.1.1 release (it can legitimately be considered an oversight and therefore a patch release) to add this? Aside from the overhead of the new release, is there any difficulty caused by having only that small part of the framework implemented?