Ejemplo n.º 1
0
 /// <summary>
 /// Gets the version IRI of the ontology, if it is defined, or the ontology
 /// IRI if it is not. If neither is defined (i.e. the ontology is anonymous),
 /// throws an exception.
 /// </summary>
 /// <param name="ontology"></param>
 /// <returns></returns>
 public static Uri GetVersionOrOntologyIri(this Ontology ontology)
 {
     if (ontology.HasVersionIri())
     {
         return(ontology.GetVersionIri());
     }
     return(ontology.GetIri());
 }
Ejemplo n.º 2
0
        public static Uri GetVersionIri(this Ontology ontology)
        {
            if (!ontology.HasVersionIri())
            {
                throw new RdfException($"Ontology {ontology} does not have an owl:versionIRI annotation");
            }

            IUriNode versionIri = ontology.Graph.CreateUriNode(VocabularyHelper.OWL.versionIRI);
            return ontology.GetNodesViaProperty(versionIri).UriNodes().First().Uri;
        }