Skip to content

Commit

Permalink
Merge pull request #666 from dgarijo/develop
Browse files Browse the repository at this point in the history
Version 1.4.21
  • Loading branch information
dgarijo authored Dec 31, 2023
2 parents d1d8ed5 + 71ce4fc commit 62e3820
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 31 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Just add the dependency and repository to your `pom.xml` file as follows. See th
<dependency>
<groupId>com.github.dgarijo</groupId>
<artifactId>Widoco</artifactId>
<version>v1.4.16</version>
<version>v1.4.21</version>
</dependency>
</dependencies>

Expand All @@ -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).
Expand All @@ -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:
```
Expand Down
1 change: 0 additions & 1 deletion doc/configuration/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions doc/configuration/configuration_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,15 +25,13 @@ DOI=
funder=
fundingGrant=
incompatibleWith=
issued=
images=image1.png;image2.png
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=Example
ontologyPrefix=exo
modified="15 April, 2023"
ontologyNamespaceURI=https://w3id.org/example
previousVersionURI=https://w3id.org/example/1.0.0
publisher=Ontology Engineering Group
Expand Down
14 changes: 7 additions & 7 deletions doc/metadataGuide/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]|
Expand All @@ -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]|
Expand Down Expand Up @@ -141,7 +141,7 @@ The following `Turtle` code block shows sample annotations for each of the metad
foaf:fundedBy <https://example.org/fundingOrganization> ;
schema:funding <https://example.org/fundingGrant> ;
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.
```
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>es.oeg</groupId>
<artifactId>widoco</artifactId>
<packaging>jar</packaging>
<version>1.4.20</version>
<version>1.4.21</version>
<name>Widoco</name>

<properties>
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/lode/LODEGeneration.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/widoco/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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());
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/widoco/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -498,15 +499,15 @@ private static String getAgents(ArrayList<Agent> auth) {
}
if (currAuth.getInstitutionName() != null && !"".equals(currAuth.getInstitutionName())) {
if (currAuth.getInstitutionURL() != null && !"".equals(currAuth.getInstitutionURL())) {
agents += ", (<a href=\"" + currAuth.getInstitutionURL() + "\">" + currAuth.getInstitutionName()
+ "</a>)";
agents += ", <a href=\"" + currAuth.getInstitutionURL() + "\">" + currAuth.getInstitutionName()
+ "</a>";
} else {
agents += ", " + currAuth.getInstitutionName();
}
} else {
if (currAuth.getInstitutionURL() != null && !"".equals(currAuth.getInstitutionURL())) {
agents += ", (<a href=\"" + currAuth.getInstitutionURL() + "\">" + currAuth.getInstitutionURL()
+ "</a>)";
agents += ", <a href=\"" + currAuth.getInstitutionURL() + "\">" + currAuth.getInstitutionURL()
+ "</a>";
}
}
if(currAuth.getEmail()!=null && !"".equals(currAuth.getEmail())){
Expand All @@ -518,7 +519,7 @@ private static String getAgents(ArrayList<Agent> auth) {
agents += "</dd>";
}
} 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;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/widoco/LoadOntologyInThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/widoco/gui/GuiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 62e3820

Please sign in to comment.