diff --git a/README.md b/README.md index 5e3e36d..ceb698e 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Just add the dependency and repository to your `pom.xml` file as follows. See th com.github.dgarijo Widoco - v1.4.16 + v1.4.21 @@ -56,7 +56,7 @@ Just add the dependency and repository to your `pom.xml` file as follows. See th WIDOCO helps you to publish and create an enriched and customized documentation of your ontology, by following a series of steps in a wizard. We extend the LODE framework by Silvio Peroni to describe the classes, properties and data properties of the ontology, the OOPS! webservice by MarĂ­a Poveda to print an evaluation and the Licensius service by Victor Rodriguez Doncel to determine the license URI and title being used. In addition, we use WebVowl to visualize the ontology and have extended Bubastis to show a complete changelog between different versions of your ontology. Features of WIDOCO: -* Automatic documentation of the terms in your ontology (based on [LODE](http://www.essepuntato.it/lode/)). Now **you can use Markdown on your class descriptions** (see [example](doc/gallery/index.html)) +* Automatic documentation of the terms in your ontology (based on [LODE](http://www.essepuntato.it/lode/)). Now **you can use Markdown on your class descriptions** (see [example](https://dgarijo.github.io/Widoco/doc/gallery/index.html)) * Massive metadata extraction and support: WIDOCO will enhance your ontology documentation based on your ontology annotations. Now you can add custom logos and images, edit the content of your sections, etc. by just editing metadata. See our [supported metadata](https://github.com/dgarijo/Widoco/blob/master/doc/metadataGuide/guide.md) and [recommendations](https://dgarijo.github.io/Widoco/doc/bestPractices/index-en.html) for more information. * Automatic annotation in JSON-LD snippets of the html produced. * Association of a provenance page which includes the history of your vocabulary (W3C PROV-O compliant). @@ -75,7 +75,7 @@ Examples of the features of WIDOCO can be seen on [the gallery](https://dgarijo. A tutorial explaining the main features of the GUI can be found [here](https://dgarijo.github.io/Widoco/doc/tutorial/) ## Metadata usage -To see how WIDOCO recognizes metadata annotations in your ontology to create the documentation files, see [the WIDOCO metadata documentation](doc/metadataGuide/guide.md). To learn which metadata properties we recommend adding to your ontology for producing a nice-looking documentation, have a look at our [best practices guide](https://dgarijo.github.io/Widoco/doc/bestPractices/index-en.html). +To see how WIDOCO recognizes metadata annotations in your ontology to create the documentation files, see [the WIDOCO metadata documentation](https://dgarijo.github.io/Widoco/doc/metadataGuide/guide.md). To learn which metadata properties we recommend adding to your ontology for producing a nice-looking documentation, have a look at our [best practices guide](https://dgarijo.github.io/Widoco/doc/bestPractices/index-en.html). For example, in order to show your logo in your documentation you just need to use `foaf:logo` as an annotation, as follows: ``` diff --git a/doc/configuration/config.properties b/doc/configuration/config.properties index a152abc..5a7e410 100644 --- a/doc/configuration/config.properties +++ b/doc/configuration/config.properties @@ -26,7 +26,6 @@ licenseIconURL=https://i.creativecommons.org/l/by/2.0/88x31.png logo="https://example.org/logo.svg" ontologyName=Example ontologyPrefix=exo -modified="15 April, 2023" ontologyNamespaceURI=https://w3id.org/example previousVersionURI=https://w3id.org/example/1.0.0 publisher=Ontology Engineering Group diff --git a/doc/configuration/configuration_doc.md b/doc/configuration/configuration_doc.md index 86fb03d..9935407 100644 --- a/doc/configuration/configuration_doc.md +++ b/doc/configuration/configuration_doc.md @@ -9,6 +9,7 @@ abstract=An example ontology backwardCompatibleWith=https://w3id.org/example/1.0.0 citeAs="add some citattion text here." dateCreated="13 Nov, 2022" +dateIssued= dateModified="15 Nov, 2022" authors=First Author;Second Author authorsURI=http://example.org/author1;http://example.org/author2 @@ -24,7 +25,6 @@ DOI= funder= fundingGrant= incompatibleWith= -issued= images=image1.png;image2.png licenseURI=http://creativecommons.org/licenses/by/2.0/ licenseName=CC-BY @@ -32,7 +32,6 @@ licenseIconURL=https://i.creativecommons.org/l/by/2.0/88x31.png logo="https://example.org/logo.svg" ontologyName=Example ontologyPrefix=exo -modified="15 April, 2023" ontologyNamespaceURI=https://w3id.org/example previousVersionURI=https://w3id.org/example/1.0.0 publisher=Ontology Engineering Group diff --git a/doc/metadataGuide/guide.md b/doc/metadataGuide/guide.md index 2a04436..9481755 100644 --- a/doc/metadataGuide/guide.md +++ b/doc/metadataGuide/guide.md @@ -45,7 +45,7 @@ The table below shows which ontology metadata annotations are recognized in WIDO |Abstract |[dc:abstract], [dcterms:abstract]|abstract |[Sec 3.2.4] **[OPTIONAL]**|[Text]|[ontology](#onto), [config]| |Backwards compatible|[owl:backwardCompatibleWith] |backwardCompatibleWith|[Sec 3.3.3] **[OPTIONAL]**|[URI] |[ontology](#onto), [config]| |Bibliographic citation|[dcterms:bibliographicCitation], [schema:citation]|citeAs|[Sec 3.6.2] **[OPTIONAL]**|[Text]|[ontology](#onto), [config]| -|Creation date|[dcterms:created], [schema:dateCreated], [prov:generatedAtTime], [pav:createdOn], [doap:created]|creationDate|[Sec 3.4.2] **[OPTIONAL]**|[Text]|[ontology](#onto), [config]| +|Creation date|[dcterms:created], [schema:dateCreated], [prov:generatedAtTime], [pav:createdOn], [doap:created]|dateCreated|[Sec 3.4.2] **[OPTIONAL]**|[Text]|[ontology](#onto), [config]| |Creators|[dcterms:creator], [dc:creator], [schema:creator], [pav:createdBy], [pav:authoredBy], [prov:wasAttributedTo], [doap:developer], [foaf:maker]|authors, authorsURI, authorsInstitution, authorsInstitutionURI|[Sec 3.5.1] **[RECOMMENDED]**|[Text] or [Person] or [BNode]|[ontology](#onto), [config]| |Contributors|[dcterms:contributor], [dc:contributor], [schema:contributor], [pav:contributedBy], [doap:documenter], [doap:maintainer], [doap:helper], [doap:translator]|contributors, contributorsURI, contributorsInstitution, contributorsInstitutionURI|[Sec 3.5.2] **[RECOMMENDED]**|[Text] or [Person] or [BNode]|[ontology](#onto), [config]| |Description|[dc:description], [dcterms:description], [schema:description], [rdfs:comment], [skos:note], [doap:description], [doap:shortdesc]|description|[Sec 3.2.3] **[OPTIONAL]**|[Text]|[ontology](#onto), [config]| @@ -56,13 +56,13 @@ The table below shows which ontology metadata annotations are recognized in WIDO |Funding grants |[schema:funding] |fundingGrant|[Sec 3.5.5] **[OPTIONAL]**|[Text] or [URI]|[ontology](#onto), [config]| |Incompatible with |[owl:incompatibleWith] |incompatibleWith|[Sec 3.3.4] **[OPTIONAL]** |[URI] |[ontology](#onto), [config]| |Imported ontologies |[owl:imports] |importedOntologyNames, importedOntologyURIs|N/A **[RECOMMENDED]** (good practice in ontology engineering) | [URI] | [ontology](#onto), [config]| -|Issued date |[dcterms:issued], [schema:dateIssued] |issued |[Sec 3.4.4] **[OPTIONAL]** |[Text] |[ontology](#onto), [config]| +|Issued date |[dcterms:issued], [schema:dateIssued] |dateIssued |[Sec 3.4.4] **[OPTIONAL]** |[Text] |[ontology](#onto), [config]| |License|[dc:rights], [dcterms:license], [schema:license], [cc:license], [doap:license]|licenseName, licenseURI, licenseIconURL|[Sec 3.7] **[OPTIONAL]**|[Text] or [URI]|[ontology](#onto), [config]| |Logo |[foaf:logo], [schema:logo] |logo |[Sec 3.8.1] **[OPTIONAL]** |[URI] |[ontology](#onto), [config]| |Name|[rdfs:label], [mod:acronym], [schema:alternateName], [skos:prefLabel]|ontologyName|[Sec 3.2.1] **[RECOMMENDED]**|[Text]|[ontology](#onto), [config]| |Namespace prefix |[vann:preferredNamespacePrefix]|ontologyPrefix |[Sec 3.1.2] **[RECOMMENDED]**|[Text] |[ontology](#onto), [config]| |Namespace URI |[vann:preferredNamespaceUri] |ontologyNamespaceURI|[Sec 3.1.1] **[RECOMMENDED]**|[URI] |[ontology](#onto), [config]| -|Modification date|[dcterms:modified], [schema:dateModified] [pav:lastUpdatedOn]|modified|[Sec 3.4.3] **[OPTIONAL]**|[Text] |[ontology](#onto), [config]| +|Modification date|[dcterms:modified], [schema:dateModified] [pav:lastUpdatedOn]|dateModified|[Sec 3.4.3] **[OPTIONAL]**|[Text] |[ontology](#onto), [config]| |Previous version |[dc:replaces], [dcterms:replaces], [prov:wasRevisionOf], [pav:previousVersion], [owl:priorVersion]|previousVersionURI|[Sec 3.4.1] **[RECOMMENDED]**|[URI]|[ontology](#onto), [config]| |Publisher|[dcterms:publisher], [dc:publisher], [schema:publisher]|publisher, publisherURI, publisherInstitution, publisherInstitutionURI|[Sec 3.5.3] **[OPTIONAL]**|[Text] or [Organization] or [BNode]|[ontology](#onto), [config]| |Similar resources|[rdfs:seeAlso] | |[Sec 3.9] **[OPTIONAL]** |[Text] |[ontology](#onto), [config]| @@ -141,7 +141,7 @@ The following `Turtle` code block shows sample annotations for each of the metad foaf:fundedBy ; schema:funding ; widoco:introduction "A paragraph with the introduction section of the documentation about your resource"@en ; - widoco:rdfxmlSerialization "https://example.org/serialization/ontology.xml"^^xsd:anyURI ; + widoco:rdfxmlSerialization "https://example.org/serialization/ontology.xml"^^xsd:anyURI ; owl:versionInfo "1.0.1" . #If content negotiation is enabled, the widoco:rdfxmlSerialization annotation may not be needed. ``` @@ -214,7 +214,6 @@ Create a `config.properties` file and use the `-confFile` option to invoke Widoc abstract=An example ontology backwardCompatibleWith=https://w3id.org/example/1.0.0 citeAs="add some citattion text here." -creationDate="13 Nov, 2022" authors=First Author;Second Author authorsURI=http://example.org/author1;http://example.org/author2 authorsInstitution=First author institution;Second author institution @@ -224,6 +223,9 @@ contributorsURI=http://example.org/contributor1;http://example.org/contributor2 contributorsInstitution=First contributor institution;Second contributor institution contributorsInstitutionURI=https://isi.edu/;https://isi.edu/ description=A description of what the ontology does goes here +dateCreated="13 Nov, 2022" +dateIssued="14 Nov, 2022" +dateModified="15 April, 2023" diagram="https://example.org/diagram.svg" extendedOntologyNames=test1; test2 extendedOntologyURIs=http://example.org/test1; http://example.org/test2 @@ -234,14 +236,12 @@ incompatibleWith=https://w3id.org/example/0.0.1 importedOntologyNames=Imported Ontology 1; Imported Ontology 2 importedOntologyURIs=http://example.org/test11; http://example.org/test22 introduction=A brief text for the introduction section may be written here. -issued= licenseURI=http://creativecommons.org/licenses/by/2.0/ licenseName=CC-BY licenseIconURL=https://i.creativecommons.org/l/by/2.0/88x31.png logo="https://example.org/logo.svg" ontologyName=The Cohort Ontology ontologyPrefix=exo -modified="15 April, 2023" ontologyNamespaceURI=https://w3id.org/example previousVersionURI=https://w3id.org/example/1.0.0 publisher= diff --git a/pom.xml b/pom.xml index da0c4b7..fcbd88b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ es.oeg widoco jar - 1.4.20 + 1.4.21 Widoco diff --git a/src/main/java/lode/LODEGeneration.java b/src/main/java/lode/LODEGeneration.java index 5b4af5a..82ee47c 100644 --- a/src/main/java/lode/LODEGeneration.java +++ b/src/main/java/lode/LODEGeneration.java @@ -69,17 +69,11 @@ public static String getLODEhtml(Configuration c, File lodeResources) throws Exc c.getMainOntology().getOWLAPIModel()); content = applyXSLTTransformation(content, c.getOntologyURI(), lang, lodeResources); return (content); - } catch (OWLOntologyStorageException e) { - logger.error("Error while applying LODE. Error while applying the XLS file: " + e.getMessage()); - throw e; - } catch (TransformerException e) { - logger.error("Error while applying LODE. Error while applying the XLS file: " + e.getMessage()); - throw e; - } catch (UnsupportedEncodingException e) { + } catch (OWLOntologyStorageException | TransformerException | UnsupportedEncodingException e) { logger.error("Error while applying LODE. Error while applying the XLS file: " + e.getMessage()); throw e; } - } + } /** * Method that uses the loaded ontology and parses it in case there are imports diff --git a/src/main/java/widoco/Configuration.java b/src/main/java/widoco/Configuration.java index 86a0529..48255cf 100644 --- a/src/main/java/widoco/Configuration.java +++ b/src/main/java/widoco/Configuration.java @@ -240,8 +240,9 @@ private void loadPropertyFile(String path) throws IOException { abstractSection = propertyFile.getProperty(Constants.PF_ABSTRACT_SECTION_CONTENT); contextURI = propertyFile.getProperty(Constants.PF_CONTEXT_URI, ""); mainOntologyMetadata.setTitle(propertyFile.getProperty(Constants.PF_ONT_TITLE, "Title goes here")); - mainOntologyMetadata.setCreationDate(propertyFile.getProperty(Constants.PF_DATE_CREATED, "Creation date")); - mainOntologyMetadata.setModifiedDate(propertyFile.getProperty(Constants.PF_DATE_MODIFIED, "Modified date")); + mainOntologyMetadata.setCreationDate(propertyFile.getProperty(Constants.PF_DATE_CREATED, "Date created")); + mainOntologyMetadata.setModifiedDate(propertyFile.getProperty(Constants.PF_DATE_MODIFIED, "Date modified")); + mainOntologyMetadata.setIssuedDate(propertyFile.getProperty(Constants.PF_DATE_ISSUED, "Date issued")); mainOntologyMetadata.setPreviousVersion(propertyFile.getProperty(Constants.PF_PREVIOUS_VERSION)); mainOntologyMetadata.setThisVersion(propertyFile.getProperty(Constants.PF_THIS_VERSION_URI)); mainOntologyMetadata.setLatestVersion(propertyFile.getProperty(Constants.PF_LATEST_VERSION_URI)); @@ -512,6 +513,9 @@ public void loadPropertiesFromOntology(OWLOntology o) { mainOntologyMetadata.setCiteAs(cite.toString()); } + } + + public void loadNamespaceDeclarations(OWLOntology o){ //load all namespaces in the ontology document. this.namespaceDeclarations = new HashMap<>(); OWLOntologyXMLNamespaceManager nsManager = new OWLOntologyXMLNamespaceManager(o, o.getFormat()); diff --git a/src/main/java/widoco/Constants.java b/src/main/java/widoco/Constants.java index 046a5ba..10fcd0c 100644 --- a/src/main/java/widoco/Constants.java +++ b/src/main/java/widoco/Constants.java @@ -237,6 +237,7 @@ public class Constants { public static final String PF_CONTRIBUTORS_INSTITUTION = "contributorsInstitution"; public static final String PF_CONTRIBUTORS_INSTITUTION_URI = "contributorsInstitutionURI"; public static final String PF_DATE_CREATED = "dateCreated"; + public static final String PF_DATE_ISSUED = "dateIssued"; public static final String PF_DATE_MODIFIED = "dateModified"; public static final String PF_DESCRIPTION = "description"; public static final String PF_DOI = "DOI"; @@ -498,15 +499,15 @@ private static String getAgents(ArrayList auth) { } if (currAuth.getInstitutionName() != null && !"".equals(currAuth.getInstitutionName())) { if (currAuth.getInstitutionURL() != null && !"".equals(currAuth.getInstitutionURL())) { - agents += ", (" + currAuth.getInstitutionName() - + ")"; + agents += ", " + currAuth.getInstitutionName() + + ""; } else { agents += ", " + currAuth.getInstitutionName(); } } else { if (currAuth.getInstitutionURL() != null && !"".equals(currAuth.getInstitutionURL())) { - agents += ", (" + currAuth.getInstitutionURL() - + ")"; + agents += ", " + currAuth.getInstitutionURL() + + ""; } } if(currAuth.getEmail()!=null && !"".equals(currAuth.getEmail())){ @@ -518,7 +519,7 @@ private static String getAgents(ArrayList auth) { agents += ""; } } catch (Exception e) { - logger.error("Error while writing authors, their urls or their instititions."); + logger.error("Error while writing authors, their urls or their institutions."); } return agents; } diff --git a/src/main/java/widoco/LoadOntologyInThread.java b/src/main/java/widoco/LoadOntologyInThread.java index de2965a..a47d198 100644 --- a/src/main/java/widoco/LoadOntologyInThread.java +++ b/src/main/java/widoco/LoadOntologyInThread.java @@ -45,6 +45,7 @@ public void run() { try { WidocoUtils.loadModelToDocument(c); c.loadPropertiesFromOntology(c.getMainOntology().getOWLAPIModel()); + c.loadNamespaceDeclarations(c.getMainOntology().getOWLAPIModel()); if (showGui) { pointerToMain.switchState("finishedLoading"); } diff --git a/src/main/java/widoco/gui/GuiController.java b/src/main/java/widoco/gui/GuiController.java index 8b9fe29..d29eca7 100644 --- a/src/main/java/widoco/gui/GuiController.java +++ b/src/main/java/widoco/gui/GuiController.java @@ -210,12 +210,12 @@ public GuiController(String[] args) { } i++; } - // this creates the tmp files + // this creates tmp files for the conversion assets config = new Configuration(); try { this.config.reloadPropertyFile(confPath); } catch (Exception e) { - System.out.println("Configuration file could not be loaded: " + e.getMessage()); + logger.error("Configuration file could not be loaded: " + e.getMessage()); return; } @@ -291,6 +291,7 @@ public GuiController(String[] args) { // TO DO: improve this a little so language is passed on to load properties and generate doc. for (String l : config.getLanguagesToGenerateDoc()) { logger.info("Generating documentation for " + ontology + " in lang " + l); + config.loadNamespaceDeclarations(config.getMainOntology().getOWLAPIModel()); if (getOntoMetadata) { logger.info("Load properties from the ontology in lang " + l); config.loadPropertiesFromOntology(config.getMainOntology().getOWLAPIModel());