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

Should gist describe its preferred prefix and namespace URI using VANN? #684

Closed
pmcb55 opened this issue Jun 12, 2022 · 10 comments
Closed
Assignees
Labels
impact: patch No new functionality or changes in human-readable semantics (e.g,. fixing a typo in an annotation)

Comments

@pmcb55
Copy link

pmcb55 commented Jun 12, 2022

It's become very common practice in more recent years for ontologies to explicitly provide simple metadata for their preferred prefix and namespace URI using the long-standing, and stable, VANN vocabulary.

For gist, this would simply be including the following two new VANN triples:

prefix vann: <http://purl.org/vocab/vann/>

<https://ontologies.semanticarts.com/o/gistCore> a owl:Ontology;
    vann:preferredNamespacePrefix "gist" ;
    vann:preferredNamespaceUri "https://ontologies.semanticarts.com/gist/" .

Note: In the case of the prefix, this is just potentially helpful extra metadata - i.e., by explicitly stating a preferred value it can help maintain a higher degree of consistency among people using that ontology.

Note: In the case of the namespace URI, this can be helpful in linking the ontology resource (i.e., <https://ontologies.semanticarts.com/o/gistCore> in the case of gist) back to the actual namespace URI it describes (i.e., "https://ontologies.semanticarts.com/gist/").

Note: The rdfs:range of the VANN preferredNamespaceUri predicate (although not explicitly stated in the VANN documentation) is accepted to be an xsd:string, and not an IRI, or xsd:anyURI.
I think this is deliberate to allow processors perform simple string manipulation on the IRIs of terms from a vocabulary, but also because to-date the notion of a Namespace has not been explicitly denoted (i.e., there are no rdf:Namespace or owl:Namespace types, and no associated rdf:namespace or owl:hasNamespace predicates), and so dereferencing a Namespace URI in-and-of-itself has generally (but not always!) been expected to return the description of that ontology - but that description has never been expected to contain triples describing the Namespace itself (whether it should or not is a separate issue :) !).

@rjyounes
Copy link
Collaborator

I've used vann:preferredNamespacePrefix in the past and don't see any reason not to use it. vann:preferredNamespaceURI also seems like a good idea. Too bad VANN didn't go with 'IRI' rather than 'URI' in the property name.

I'm putting this on the roster for consideration for the next release, as it's an easy and non-semantic fix.

@rjyounes rjyounes added the impact: patch No new functionality or changes in human-readable semantics (e.g,. fixing a typo in an annotation) label Jun 13, 2022
@uscholdm
Copy link
Contributor

This makes a lot of sense to me, especially this:

In the case of the namespace URI, this can be helpful in linking the ontology resource (i.e., <https://ontologies.semanticarts.com/o/gistCore> in the case of gist) back to the actual namespace URI it describes (i.e., "https://ontologies.semanticarts.com/gist/").

@rjyounes
Copy link
Collaborator

Why do we have /o/ etc in namespaces? To avoid the namespace being the same as the ontology IRI, since these are two distinct concepts.

@rjyounes
Copy link
Collaborator

rjyounes commented Jun 23, 2022

Reasons not to use:

  1. They are specifically for use in an XML document (see VANN ontology).
  2. We don't like the use of "Uri" rather than "Iri."
  3. The URI is a string.
  4. What is the purpose? Preferred namespace is already defined from the namespace. Prefix is obvious from usage in the ontology.

Jamie: They facilitate machine readability. In conjunction they tell the machine what they should be so users don't have to.

Rebecca: It doesn't matter what prefix people use.

Michael: It would be perverse to use a prefix that is not the standard defined by the authors.

Rebecca: The VANN ontology isn't retrievable from its ontology IRI (http://purl.org/vocab/vann/), either in Chrome or Protege. So clearly this isn't a commonly-used ontology and most machines would not be equipped to interpret these properties.

Jamie: Not sold on VANN ontology for reasons above, but could use others. Perhaps SHACL - using in DCA.

Class: sh:PrefixDeclaration
Properties: sh:prefix, sh:namespace

@rjyounes rjyounes reopened this Jun 23, 2022
@rjyounes
Copy link
Collaborator

@Jamie-SA Where did we leave this? Were you going to do any additional exploration, or is it still under group review?

@Jamie-SA
Copy link
Contributor

Here are the SHACL term definitions for everyone to review:

sh:PrefixDeclaration
	a rdfs:Class ;
	rdfs:label "Prefix declaration"@en ;
	rdfs:comment "The class of prefix declarations, consisting of pairs of a prefix with a namespace."@en ;
	rdfs:subClassOf rdfs:Resource ;
	rdfs:isDefinedBy sh: .

sh:declare
	a rdf:Property ;
	rdfs:label "declare"@en ;
	rdfs:comment "Links a resource with its namespace prefix declarations."@en ;
	rdfs:domain owl:Ontology ;
	rdfs:range sh:PrefixDeclaration ;
	rdfs:isDefinedBy sh: .

sh:prefix
	a rdf:Property ;
	rdfs:label "prefix"@en ;
	rdfs:comment "The prefix of a prefix declaration."@en ;
	rdfs:domain sh:PrefixDeclaration ;
	rdfs:range xsd:string ;
	rdfs:isDefinedBy sh: .

sh:namespace
	a rdf:Property ;
	rdfs:label "namespace"@en ;
	rdfs:comment "The namespace associated with a prefix in a prefix declaration."@en ;
	rdfs:domain sh:PrefixDeclaration ;
	rdfs:range xsd:anyURI ;
	rdfs:isDefinedBy sh: .

Here is their example of how to use them.

sh:
	a owl:Ontology ;
	rdfs:label "W3C Shapes Constraint Language (SHACL) Vocabulary"@en ;
	rdfs:comment "This vocabulary defines terms used in SHACL, the W3C Shapes Constraint Language."@en ;
	sh:declare [
		sh:prefix "sh" ;
		sh:namespace "http://www.w3.org/ns/shacl#" ;
	] .

@rjyounes
Copy link
Collaborator

rjyounes commented Jul 14, 2022

Michael/Rebecca: The SHACL terms aren't precisely what we want to express - they're used to associate a prefix with a namespace, not to specify the namespace itself. Could mint our own annotation properties.

Dan: Could use the SHACL mechanism to specify multiple prefixes; e.g., the tbox, abox, and cbox patterns.

Jamie: This way applications like visualizations could use the prefix declarations to match an IRI and display the prefix rather than the full namespace.

Dan: Could put the SHACL prefix declarations into a separate file. This provides the guidance for applications without adding application-level cues to the ontology.

Can add a bare PrefixDeclaration object in a separate file, without linking to the ontology

With a blank node:

[] a sh:PrefixDeclaration ;
	sh:prefix "gist" ;
	sh:namespace "https://ontologies.semanticarts.com/gist/" ;
	.

With an IRI node:

gist:_PrefixDeclaration_gist a sh:PrefixDeclaration ;
	sh:prefix "gist" ;
	sh:namespace "https://ontologies.semanticarts.com/gist/" ;
	.

On gist:

<https://ontologies.semanticarts.com/o/gistCore>
	a owl:Ontology ;
	owl:versionIRI <https://ontologies.semanticarts.com/o/gistCore11.0.0> ;
	skos:definition "gist is a minimalist upper ontology created by Semantic Arts."^^xsd:string ;
	skos:prefLabel "gist"^^xsd:string ;
	gist:license "https://creativecommons.org/licenses/by-sa/3.0/"^^xsd:string ;
	sh:declare [
                a sh:PrefixDeclaration ;
		sh:prefix "gist" ;
		sh:namespace "https://ontologies.semanticarts.com/gist/" ;
	]  ;
	.

Options:

  • Do nothing
  • Mint our own annotations
  • Use the SHACL prefix declarations on the ontology
  • Put the SHACL prefix declarations in a separate file

What about the output of tarql? - Can add prefix declaration blank nodes as above if desired.

Which prefixes would you declare?

  • Minimally, the tbox/cbox/abox prefixes - e.g., pleo, pleox, pleod
  • Probably not standard prefixes like owl, rdf, rdfs, skos, xsd (these are generally built into applications anyway). Could put into a separate file.

DECISION:

  1. Add to gist:
<https://ontologies.semanticarts.com/o/gistCore>
	a owl:Ontology ;
	owl:versionIRI <https://ontologies.semanticarts.com/o/gistCore11.0.0> ;
	skos:definition "gist is a minimalist upper ontology created by Semantic Arts."^^xsd:string ;
	skos:prefLabel "gist"^^xsd:string ;
	gist:license "https://creativecommons.org/licenses/by-sa/3.0/"^^xsd:string ;
	sh:declare gist:_PrefixDeclaration_gist ;
	.

gist:_PrefixDeclaration_gist a sh:PrefixDeclaration ;
	sh:prefix "gist" ;
	sh:namespace "https://ontologies.semanticarts.com/gist/" ;
	.

If in future we decide to adopt the namespace pattern gist/gistx/gistd, we would change gist:_PrefixDeclaration_gist to gistd:_PrefixDeclaration_gist (or maybe it would be gistx:_PrefixDeclaration_gist, not sure). See issue #305.

  1. Add standard prefixes skos, owl, rdf, rdfs, xsd to a separate file. These could be imported into gist. Don't use blank nodes.

@rjyounes rjyounes self-assigned this Jul 14, 2022
@pmcb55
Copy link
Author

pmcb55 commented Sep 21, 2022

Just catching up on this issue now(!), and I totally agree with the decision you folks arrived on here!

But shouldn't the object of the sh:namespace triple you give in your example for gist be explicitly datatyped as xsd:anyURI, as per the SHACL spec itself (i.e., "The values of sh:namespace are literals of datatype xsd:anyURI")...?

@Jamie-SA
Copy link
Contributor

Hi @pmcb55, it probably should be. Interestingly, even the developers of SHACL made the same mistake in their original ontology... Also interesting that it was corrected 2 years ago by @pwin, why weren't you on the call that day Peter? :)

@rjyounes
Copy link
Collaborator

rjyounes commented Dec 9, 2022

This was completed and released.

@rjyounes rjyounes closed this as completed Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: patch No new functionality or changes in human-readable semantics (e.g,. fixing a typo in an annotation)
Projects
None yet
Development

No branches or pull requests

4 participants