Skip to content

Commit

Permalink
Merge pull request #417 from dgarijo/develop
Browse files Browse the repository at this point in the history
Preparing for 1.4.15
  • Loading branch information
dgarijo authored Jul 19, 2020
2 parents 46472f9 + a073d8b commit 5fba712
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 58 deletions.
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,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/))
* 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 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).
* Metadata extraction from the ontology plus the means to complete it on the fly when generating your ontology. Check the [best practice document](http://dgarijo.github.io/Widoco/doc/bestPractices/index-en.html) to know more about the terms recognized by WIDOCO.
Expand All @@ -71,9 +71,9 @@ Examples of the features of WIDOCO can be seen on [the gallery](http://dgarijo.g
A tutorial explaining the main features of the GUI can be found [here](http://dgarijo.github.io/Widoco/doc/tutorial/)

## How to use WIDOCO
Download all the files of the "JAR" folder into the same folder. Then just double click the .jar file.
Download the latest `.jar` [WIDOCO available release](https://github.com/dgarijo/WIDOCO/releases/latest) (it will be something like `widoco-VERSION-jar-with-dependencies.jar`). Then just double click the `.jar` file.

Now you can execute WIDOCO through the console. Usage:
You may also execute WIDOCO through the command line. Usage:
```bash
java -jar widoco-VERSION-jar-with-dependencies.jar [OPTIONS]
```
Expand All @@ -89,7 +89,8 @@ java -jar widoco-VERSION-jar-with-dependencies.jar [OPTIONS]
`-confFile PATH`: Load your own configuration file for the ontology metadata. Incompatible with -getOntologyMetadata

`-getOntologyMetadata`: Extract ontology metadata from the given ontology
-oops: Create an html page with the evaluation from the OOPS service (http://oops.linkeddata.es/)

`-oops`: Create an html page with the evaluation from the OOPS service (http://oops.linkeddata.es/)

`-rewriteAll`: Replace any existing files when documenting an ontology (e.g., from a previous execution)

Expand Down Expand Up @@ -122,27 +123,22 @@ java -jar widoco-VERSION-jar-with-dependencies.jar [OPTIONS]
`-excludeIntroduction`: Skip the introduction section in the documentation.
-uniteSections: Write all HTML sections into a single HTML document.

`-- help`: Shows a help message and exits.
`--help`: Shows a help message and exits.


## How can I make WIDOCO automatically recognize my vocabulary annotations?
There are two ways for making WIDOCO get your vocabulary metadata annotations and use them automatically to document the ontology.

* Add them in your OWL file. For guidelines on which ones to include, follow our [Best Practices document](https://w3id.org/widoco/bestPractices), which indicates which ones we recommend.
* Add them in your OWL file. For guidelines on which ones to include, follow our [best practices document](https://w3id.org/widoco/bestPractices), which indicates which ones we recommend.
* Edit the project properties of /config/config.properties. This is a key-value pair file with metadata properties. Some people consider it easier than adding the property annotations to the OWL file, although I recommend doing the former option. Note that the character ";" is used for lists (for instance first author; second author; third author).

## Browser issues (Why can't I see the generated documentation / visualization?)
The result of executing WIDOCO is an HTML file. We have successfully tested it in Mozilla, IE, Safari and Chrome. **When the page is stored in a server, WIDOCO's HTML works correctly in all browsers**. If you view the file **on your local browser**, we recommend you to use Mozilla Firefox, Safari or Internet Explorer. Google Chrome will not show the contents correctly, as it doesn't allow XMLHttpRequest without HTTP. If you want to view the page locally with Google Chrome you have two possibilities:

a) Place the file in a server and access it via its URL (for example, put it in dropbox and access through its public url, or on a Github page).

b) Execute Chrome with the following commands (Thanks to Alejandro Fernandez Carrera):

(WIN) chrome.exe --allow-file-access-from-files,
WIDOCO separates the contents of different sections in HTML files, which are then loaded in the `index.html` file. WIDOCO was designed this way because it's easier to edit your introduction or description sections independently without being all aggregated together in a huge HTML document. **When all the contents generated by WIDOCO are stored in a server, you will be able to see the documentation of your ontology using any browser**. However, if you open the `index.html` file **on your local browser**, you may see a document missing most of the sections in your documentation. This happens because browsers don't allow loading separate content when opening a file locally for security reasons. If you want to explore how your ontology would look locally, you have two options:

(OSX) open /Applications/Google\ Chrome.app/ --args --allow-file-access-from-files
* a) Execute WIDOCO with the `-uniteSections` flag; or select the option `add al sections in a single document` in the "load sections" step in the WIDOCO GUI. This will make all the sections of WIDOCO to be in the `index.html`; and you will be able to see it in your browser. Note that the **LODE visualization will not be available** when exploring your ontology locally.
* b) Create a local server: Set up a local server (e.g., using XAMPP or Tomcat) and serve the files WIDOCO generates (in the `htdocs` folder for Apache servers).

(UNX) /usr/bin/google-chrome --allow-file-access-from-files
If you place the files generated by WIDOCO in a server and access them via its URL (for example, a Github page), you should be able to see your documentation appropriately.

## Current improvements
For a complete list of the current improvements and next features, check the [project open issues](https://github.com/dgarijo/Widoco/issues) and [milestones](https://github.com/dgarijo/Widoco/milestones) in the repository.
Expand Down
Binary file added doc/gallery/images/md.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/gallery/images/md.pptx
Binary file not shown.
16 changes: 14 additions & 2 deletions doc/gallery/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h3 >WIDOCO's gallery </h3>
<p> This page illustrates examples of the main features of <a href="https://w3id.org/widoco">WIDOCO</a>, a <u>WI</u>zard for <u>DOC</u>umenting <u>O</u>ntologies.
</p>
<div class="row">
<div class="col-sm-6 col-md-6">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/doc2.png" alt="documentation" width="80%">
<div class="caption">
Expand All @@ -37,7 +37,7 @@ <h4>Documentation of ontology concepts</h4>
</div>
</div>

<div class="col-sm-6 col-md-6">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/visualization.png" alt="visualization">
<div class="caption">
Expand All @@ -49,6 +49,18 @@ <h4>Dynamic visualization</h4>
</div>
</div>
</div>

<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/md.png" alt="markdown support">
<div class="caption">
<h4>Markdown support</h4>
<p>
You can write your class descriptions using markdown, and they will automatically render in your ontology documentation.
</p>
</div>
</div>
</div>

</div>

Expand Down
13 changes: 8 additions & 5 deletions src/main/java/widoco/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class Constants {
*/

public static final String NS_RDFS = "http://www.w3.org/2000/01/rdf-schema#";
public static final String NS_SCHEMA = "http://schema.org/";
public static final String NS_SCHEMA = "https://schema.org/";
public static final String NS_DC = "http://purl.org/dc/elements/1.1/";
public static final String NS_DCTERMS = "http://purl.org/dc/terms/";
public static final String NS_OWL = "http://www.w3.org/2002/07/owl#";
Expand Down Expand Up @@ -297,7 +297,7 @@ public class Constants {
+ " This flag can only be used with the htaccess option.\n" +
" -excludeIntroduction: Skip the introduction section in the documentation. \n" +
" -uniteSections: Write all HTML sections into a single HTML document. \n" +
" -- help: Shows this message and exit.\n";
" --help: Shows this message and exit.\n";

/**
* Head section of the HTML document.
Expand Down Expand Up @@ -345,7 +345,7 @@ public static String getReferencesSection(Configuration c, Properties lang) {
}

public static String getAcknowledgementsSection(Configuration c, Properties lang) {
String s = "<div id=\"acknowledgements\">\n" + "<h2 id=\"ack\" class=\"list\">"
String s = "<div id=\"acknowledgments\">\n" + "<h2 id=\"ack\" class=\"list\">"
+ lang.getProperty(LANG_AC_TEXT) + "\n";
return s;
}
Expand Down Expand Up @@ -496,7 +496,7 @@ public static String getNameSpaceDeclaration(HashMap<String, String> namesp, Con
*/
public static String getJSONLDSnippet(Configuration c) {
Ontology o = c.getMainOntology();
String metadata = "\n\n<!-- SCHEMA.ORG METADATA -->\n<script type=\"application/ld+json\">{\"@context\":\"http://schema.org\",\"@type\":\"TechArticle\","
String metadata = "\n\n<!-- SCHEMA.ORG METADATA -->\n<script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"TechArticle\","
+ "\"url\":\"" + o.getNamespaceURI() + "\"," + "\"image\":\"" + WEBVOWL_SERVICE
+ c.getMainOntology().getNamespaceURI() + "\",";
// name (mandatory)
Expand All @@ -509,7 +509,7 @@ public static String getJSONLDSnippet(Configuration c) {
// headline (mandatory)
metadata += ", \"headline\":";
if (c.getAbstractSection() != null && !"".equals(c.getAbstractSection())) {
metadata += "\"" + c.getAbstractSection() + "\"";
metadata += "\"" + c.getAbstractSection().replace("\n", "").trim() + "\"";
} else {
metadata += "\"Document describing the ontology " + o.getNamespaceURI() + "\"";
}
Expand Down Expand Up @@ -743,6 +743,9 @@ public static String getUnifiedIndexDocument(String resourcesFolderName, Configu
+ " t+='<ul>';\n" + " }\n" + " j++;\n"
+ " t+= '<li>'+(i-1)+'.'+j+'. '+'<a href=#'+ jQuery(this).attr('id')+'>'+ jQuery(this).ignore(\"span\").text()+'</a></li>';\n"
+ " }\n" + " });\n" + " t+='</ul>';\n" + " $(\"#toc\").html(t); \n" + "}\n"
+ "$(function(){\n"
+ " loadHash();\n"
+ "});"
+ " $.fn.ignore = function(sel){\n" + " return this.clone().find(sel||\">*\").remove().end();\n"
+ " };" + " \n";
document += " </script> \n" + " </head> \n" + "\n" + "<body>\n";
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/widoco/CreateResources.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ public static void generateDocumentation(String outFolder, Configuration c, File
logger.info("- ontology IRI: " + c.getOntologyURI());
lodeContent = LODEGeneration.getLODEhtml(c, lodeResources);
LODEParser lode = new LODEParser(lodeContent, c, languageFile);

if (c.isCreateHTACCESS()) {
File fOut = new File(folderOut);
if (!fOut.exists()) {
fOut.mkdirs();
}
File fOut = new File(folderOut);
if (!fOut.exists()) {
fOut.mkdirs();
}
createHTACCESSFile(folderOut + File.separator + ".htaccess", c);
}
// slash ontologies require a special type of redirection
Expand All @@ -88,7 +89,6 @@ public static void generateDocumentation(String outFolder, Configuration c, File
abs = createAbstractSection(folderOut + File.separator + "sections", c, languageFile);
}
if (c.isIncludeIntroduction()) {
//to do
intro = createIntroductionSection(folderOut + File.separator + "sections", lode.getNamespaceDeclarations(), c,
languageFile);
}
Expand Down Expand Up @@ -404,7 +404,7 @@ private static void createFolderStructure(String s, Configuration c, Properties
File f = new File(s);
if(!c.isIncludeAllSectionsInOneDocument()){
File sections = new File(s + File.separator + "sections");
sections.mkdir();
sections.mkdirs();
}
File img = new File(s + File.separator + "img");
File provenance = new File(s + File.separator + "provenance");
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/widoco/gui/GuiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,17 @@ public void openBrowser(URI uri) {

public static void main(String[] args) {
GuiController guiController;
if (args.length > 0) {
guiController = new GuiController(args);
} else {
guiController = new GuiController();
}
try{
if (args.length > 0) {
guiController = new GuiController(args);
} else {
guiController = new GuiController();
}
}catch(Exception e){
logger.error("It looks like WIDOCO could not run in your machine. "
+ "Please check that your Java version is 1.8 or higher. "
+ "Java version found: "+System.getProperty("java.version"));
}
}

}
Binary file modified src/main/resources/lode.zip
Binary file not shown.
6 changes: 6 additions & 0 deletions src/main/resources/lode/extraction.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
<xsl:variable name="label" select="f:getLabel(.)" as="xs:string" />
<xsl:choose>
<xsl:when test="$anchor = ''">
<!-- Change to make the external links open in a new window
instead of being dotted
<span class="dotted" title="{.}">
<xsl:value-of select="$label" />
</span>
-->
<a href="{.}" title="{.}" target="_blank">
<xsl:value-of select="$label" />
</a>
</xsl:when>
<xsl:otherwise>
<a href="#{$anchor}" title="{.}">
Expand Down
Binary file modified src/main/resources/webvowl_1.1.4_patched.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions src/main/resources/widoco/en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ annProp=Annotation Properties
namedIndiv=Named Individuals
referencesTitle=References
referencesPlaceHolder=References <span class=\"backlink\"> back to <a href=\"#toc\">ToC</a></span></h2>\n<span class=\"markdown\">\nAdd your references here. It is recommended to have them as a list.</span>\n
ackTitle=Acknowledgements
ackText=Acknowledgements <span class=\"backlink\"> back to <a href=\"#toc\">ToC</a></span></h2>\n<p>\nThe authors would like to thank <a href=\"http://www.essepuntato.it/\">Silvio Peroni</a> for developing <a href=\"http://www.essepuntato.it/lode\">LODE</a>, a Live OWL Documentation Environment, which is used for representing the Cross Referencing Section of this document and <a href=\"https://w3id.org/people/dgarijo\">Daniel Garijo</a> for developing <a href=\"https://github.com/dgarijo/Widoco\">Widoco</a>, the program used to create the template used in this documentation.</p>\n</div>\n
ackTitle=Acknowledgments
ackText=Acknowledgments <span class=\"backlink\"> back to <a href=\"#toc\">ToC</a></span></h2>\n<p>\nThe authors would like to thank <a href=\"http://www.essepuntato.it/\">Silvio Peroni</a> for developing <a href=\"http://www.essepuntato.it/lode\">LODE</a>, a Live OWL Documentation Environment, which is used for representing the Cross Referencing Section of this document and <a href=\"https://w3id.org/people/dgarijo\">Daniel Garijo</a> for developing <a href=\"https://github.com/dgarijo/Widoco\">Widoco</a>, the program used to create the template used in this documentation.</p>\n</div>\n
prov1=Provenance for
prov2=Documentation
createdBy=Ontology created by:
Expand Down
23 changes: 23 additions & 0 deletions src/main/resources/widoco/it.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

title=Questa versione:
name=Ultima versione:
ontologyPrefix=Versione precedente:
ontologyNamespaceURI=Revisione:
dateOfRelease= Autori:
thisVersion=Collaboratori:
latestVersion=Ontologie Estese:
previousVersion=Ontologie Importate:
revision=1.0
authors=Primo Autore;Secondo Autore
authorURL=http://example.org/author1;http://example.org/author2
authorInstitution=Istituzione del primo autore;Istituzione del secondo autore
contributors=Primo collaboratore;Secondo collaboratore
contributorsURL=http://example.org/contributor1;http://example.org/contributor2
contributorsInstitution=Istituzione del primo collaboratore;Istituzione del secondo collaboratore
importsNames=Ontologia Importata 1; Ontologia Importata 2
importsURLs=http://example.org/test11; http://example.org/test22
extendsNames=test1; test2
extendsURLS=http://example.org/test1; http://example.org/test2
license=Nome della Licenza. ex: Licenza Creative COmmons - Attribuzione - Non commerciale - Condividi allo stesso modo 2.0 Italia
licenseURL=https://creativecommons.org/licenses/by-nc-sa/2.0/it/
licenseIconURL=http://i.creativecommons.org/l/by-nc-sa/2.0/88x31.png
23 changes: 0 additions & 23 deletions src/main/resources/widoco/it.properties (to do)

This file was deleted.

49 changes: 49 additions & 0 deletions test/multipleImports.owl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0"?>
<rdf:RDF xmlns="https://example.org/multipleImports#"
xml:base="https://example.org/multipleImports"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:ns="http://www.w3.org/2003/06/sw-vocab-status/ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:wot="http://xmlns.com/wot/0.1/"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:dcat="http://www.w3.org/ns/dcat#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:prov="http://www.w3.org/ns/prov#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:terms="http://purl.org/dc/terms/"
xmlns:schema="http://schema.org/">
<owl:Ontology rdf:about="https://example.org/multipleImports#">
<owl:imports rdf:resource="http://www.w3.org/ns/sosa/"/>
<owl:imports rdf:resource="http://www.w3.org/ns/ssn/"/>
<owl:imports rdf:resource="http://xmlns.com/foaf/0.1/"/>
<rdfs:comment xml:lang="en">Ontology designed to test multiple imported ontologies</rdfs:comment>
</owl:Ontology>



<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->




<!-- https://example.org/multipleImports#ExampleClass -->

<owl:Class rdf:about="https://example.org/multipleImports#ExampleClass">
<rdfs:comment xml:lang="en">A class from the imported example ontology</rdfs:comment>
<rdfs:label xml:lang="en">Example class</rdfs:label>
</owl:Class>
</rdf:RDF>



<!-- Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi -->

0 comments on commit 5fba712

Please sign in to comment.