Skip to content

Commit

Permalink
Merge pull request #462 from dgarijo/develop
Browse files Browse the repository at this point in the history
Prepare for new release
  • Loading branch information
dgarijo authored Jun 26, 2021
2 parents 9c74c45 + 4412f4a commit 36a897d
Show file tree
Hide file tree
Showing 7 changed files with 1,272 additions and 17 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@ java -jar widoco-VERSION-jar-with-dependencies.jar [OPTIONS]
`-lang LANG1-LANG2`: Generate documentation in multiple languages (separated by "-"). Note that if the language is not supported, the system will load the labels in english. For example: en-pt-es

`-includeImportedOntologies`: Indicates whether the terms of the imported ontologies of the current ontology should be documented as well or not.
-htaccess: Create a bundle for publication ready to be deployed on your Apache server.

`-htaccess`: Create a bundle for publication ready to be deployed on your Apache server.

`-webVowl`: Create a visualization based on WebVowl (http://vowl.visualdataweb.org/webvowl/index.html#) in the documentation.

`-licensius`: Use the Licensius web services (http://licensius.com/apidoc/index.html) to retrieve license metadata. Only works if the -getOntologyMetadata flag is enabled.

`-ignoreIndividuals`: Individuals will not be included in the documentation.
-includeAnnotationProperties: Include annotation properties defined in your ontology in the documentation (by default they are not included)

`-includeAnnotationProperties`: Include annotation properties defined in your ontology in the documentation (by default they are not included)

`-analytics CODE`: Add a code snippet for Google analytics to track your HTML documentation. You need to add your CODE next to the flag. For example: UA-1234

Expand All @@ -130,10 +132,10 @@ java -jar widoco-VERSION-jar-with-dependencies.jar [OPTIONS]


## 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.
There are two alternative 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.
* 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).
* The recommended way: 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.
* Alternatively, 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?)
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:
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/widoco/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ private void initializeOntology() {
mainOntologyMetadata.setLicense(l);
mainOntologyMetadata.setSerializations(new HashMap<>());
// add default serializations: rdf/xml, n3, turtle and json-ld
mainOntologyMetadata.addSerialization("RDF/XML", "ontology.xml");
mainOntologyMetadata.addSerialization("RDF/XML", "ontology.rdf");
mainOntologyMetadata.addSerialization("TTL", "ontology.ttl");
mainOntologyMetadata.addSerialization("N-Triples", "ontology.nt");
mainOntologyMetadata.addSerialization("JSON-LD", "ontology.json");
mainOntologyMetadata.addSerialization("JSON-LD", "ontology.jsonld");
mainOntologyMetadata.setCreators(new ArrayList<>());
mainOntologyMetadata.setContributors(new ArrayList<>());
mainOntologyMetadata.setCiteAs("");
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/widoco/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class Constants {
// authors

public static final String PROP_VANN_PREFIX = NS_VANN + "preferredNamespacePrefix";
public static final String PROP_VANN_URI = NS_VANN + "preferredNamespaceURI";
public static final String PROP_VANN_URI = NS_VANN + "preferredNamespaceUri";

public static final String PROP_SKOS_NOTE = NS_SKOS + "note";

Expand Down Expand Up @@ -861,7 +861,7 @@ public static String getHeadSection(Configuration c, Properties l) {
+ "</dd>\n";
}
//add commented a reference in case the evaluation is to be included
head+="<!-- <dt>Evaluation:</dt><dd><a href=\"OOPSEvaluation/OOPSeval.html#\" target=\"_blank\"><img src=\"https://img.shields.io/badge/Evaluate_with-OOPS! (OntOlogy Pitfall Scanner!)-blue.svg\" alt=\"Evaluate with OOPS!\" /></a></dd> -->";
head+="<!-- <dt>Evaluation:</dt><dd><a href=\"OOPSEvaluation/oopsEval.html#\" target=\"_blank\"><img src=\"https://img.shields.io/badge/Evaluate_with-OOPS! (OntOlogy Pitfall Scanner!)-blue.svg\" alt=\"Evaluate with OOPS!\" /></a></dd> -->";
if (!"".equals(c.getMainOntology().getCiteAs()) && c.getMainOntology().getCiteAs() != null) {
head += "<dt>" + l.getProperty(LANG_CITE_AS) + "</dt>\n<dd>" + c.getMainOntology().getCiteAs() + "</dd>\n";
}
Expand Down Expand Up @@ -1150,7 +1150,7 @@ public static final String getHTACCESS(Configuration c) {
+ "# Directive to ensure *.rdf files served as appropriate content type,\n"
+ "# if not present in main apache config\n" + "AddType application/rdf+xml .rdf\n"
+ "AddType application/rdf+xml .owl\n" + "AddType text/turtle .ttl\n"
+ "AddType application/n-triples .n3\n" + "AddType application/ld+json .json\n"
+ "AddType application/n-triples .n3\n" + "AddType application/ld+json .jsonld\n"
+ "# Rewrite engine setup\n" + "RewriteEngine On\n" + "#Change the path to the folder here\n"
+ "RewriteBase " + c.getRewriteBase() + projectFolder + " \n\n";

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/widoco/CreateOOPSEvalInThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,20 @@ public void run() {
this.pointerToMain.switchState("savingResponse");
}
logger.info("Saving response...");
CreateResources.saveDocument(evalFolder.getAbsolutePath() + File.separator + "OOPSeval.html",
CreateResources.saveDocument(evalFolder.getAbsolutePath() + File.separator + "oopsEval.html",
Constants.getEvaluationText(evaluation, c), c);
//edit html file with the right pointer to the evaluation. For all languages
for (String lang: c.getLanguagesToGenerateDoc()){
Path path = Paths.get(pathOut+File.separator+"index-"+lang+".html");
Charset charset = StandardCharsets.UTF_8;
String htmlContent = new String(Files.readAllBytes(path), charset);
content = htmlContent.replace("<!-- <dt>Evaluation:</dt><dd><a href=\"OOPSevaluation/OOPSeval.html#\" target=\"_blank\"><img src=\"https://img.shields.io/badge/Evaluate_with-OOPS! (OntOlogy Pitfall Scanner!)-blue.svg\" alt=\"Evaluate with OOPS!\" /></a></dd> -->",
content = htmlContent.replace("<!-- <dt>Evaluation:</dt><dd><a href=\"OOPSEvaluation/OOPSeval.html#\" target=\"_blank\"><img src=\"https://img.shields.io/badge/Evaluate_with-OOPS! (OntOlogy Pitfall Scanner!)-blue.svg\" alt=\"Evaluate with OOPS!\" /></a></dd> -->",
"<dt>Evaluation:</dt><dd><a href=\"OOPSEvaluation/OOPSeval.html#\" target=\"_blank\"><img src=\"https://img.shields.io/badge/Evaluate_with-OOPS! (OntOlogy Pitfall Scanner!)-blue.svg\" alt=\"Evaluate with OOPS!\" /></a></dd>");
Files.write(path, content.getBytes(charset));
}
if (showGui) {
pointerToMain.openBrowser(
new File(evalFolder.getAbsolutePath() + File.separator + "OOPSeval.html").toURI());
new File(evalFolder.getAbsolutePath() + File.separator + "oopsEval.html").toURI());
}
} else {
throw new Exception("OOPS server did not return an evaluation report");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/widoco/CreateResources.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ public static void generateDocumentation(String outFolder, Configuration c, File
// serialize the model in different serializations.
OWLOntologyManager om = c.getMainOntology().getOWLAPIOntologyManager();
OWLOntology o = c.getMainOntology().getOWLAPIModel();
WidocoUtils.writeModel(om, o, new RDFXMLDocumentFormat(), folderOut + File.separator + "ontology.xml");
WidocoUtils.writeModel(om, o, new RDFXMLDocumentFormat(), folderOut + File.separator + "ontology.rdf");
WidocoUtils.writeModel(om, o, new TurtleDocumentFormat(), folderOut + File.separator + "ontology.ttl");
WidocoUtils.writeModel(om, o, new NTriplesDocumentFormat(), folderOut + File.separator + "ontology.nt");
WidocoUtils.writeModel(om, o, new RDFJsonLDDocumentFormat(), folderOut + File.separator + "ontology.json");
WidocoUtils.writeModel(om, o, new RDFJsonLDDocumentFormat(), folderOut + File.separator + "ontology.jsonld");
if (c.isIncludeIndex()) {
if(c.isIncludeAllSectionsInOneDocument()){
createUnifiedIndexDocument(abs,intro,overview,description,crossref,ref,changeLog, folderOut, c, lode, languageFile);
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/oops/OOPSevaluationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public OOPSevaluationTest() {
/**
* Test of printEvaluation method, of class OOPSevaluation.
*/
// @Test (Commented out because OOPS! WS seems to be down
@Test //(Commented out because OOPS! WS seems to be down
public void testPrintEvaluation() {
try{
System.out.println("printEvaluation with alo");
Expand Down Expand Up @@ -51,7 +51,7 @@ public void testPrintEvaluation() {
}
}

//@Test
@Test
public void testPrintEvaluation2() {
try{
System.out.println("printEvaluation with p-plan");
Expand Down
Loading

0 comments on commit 36a897d

Please sign in to comment.