Skip to content

Commit

Permalink
Merge pull request #341 from dgarijo/develop
Browse files Browse the repository at this point in the history
Preparing for WIDOCO v1.4.10
  • Loading branch information
dgarijo authored Apr 29, 2019
2 parents 820866b + b3a9fb5 commit 318ff5e
Show file tree
Hide file tree
Showing 28 changed files with 322 additions and 399 deletions.
567 changes: 264 additions & 303 deletions pom.xml

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions src/main/java/diagram/DiagramGeneration.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package diagram;

import de.uni_stuttgart.vis.vowl.owl2vowl.Owl2Vowl;
Expand All @@ -19,10 +14,6 @@ public static void generateOntologyDiagram(String outFolder, Configuration c){
//extract resource to target folder
Owl2Vowl o = new Owl2Vowl(c.getMainOntology().getOWLAPIModel()); //TO DO: Use this function instead of reading the ontology again
o.writeToFile(new File(outFolder+File.separator+"webvowl"+File.separator+"data"+File.separator+"ontology.json"));
// IRI ontologyIRI = IRI.create(new File(c.getOntologyPath()));
// Converter converter = new IRIConverter(ontologyIRI);
// converter.convert();
// converter.export(new FileExporter(new File(outFolder+File.separator+"webvowl"+File.separator+"data"+File.separator+"ontology.json")));
} catch (Exception e) {
System.err.println("FAILED TO LOAD " + e.getMessage());
}
Expand Down
36 changes: 18 additions & 18 deletions src/main/java/diff/OntologyDifferencesRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,65 +267,65 @@ public static String differencesToHTML(CompareOntologies c, String ontologyNamep
if(changesInClasses>0){
changelog+="<h3 id=\"changeClass\" class=\"list\">"+language.getProperty(Constants.LANG_CLASSES)+"</h3>\n";//this will be on the lang file later
if(!c.getModifiedClasses().isEmpty()){
changelog+="<p><u>"+language.getProperty(Constants.LANG_MODIFIED_CLASS)+"</u></p>\n";
changelog+="<details><summary><u>"+language.getProperty(Constants.LANG_MODIFIED_CLASS)+"</u></summary>\n";
changelog+="<ul>";
changelog += axiomInfoSetToHTML(c.getModifiedClasses(), ontologyNamepsace, true, true, language);
changelog+="</ul>";
changelog+="</ul></details>";
}
if(!c.getNewClasses().isEmpty()){
changelog+="<p><u>"+language.getProperty(Constants.LANG_ADDED_CLASS)+"</u></p>\n";
changelog+="<details><summary><u>"+language.getProperty(Constants.LANG_ADDED_CLASS)+"</u></summary>\n";
changelog+="<ul>";
changelog += axiomInfoSetToHTML(c.getNewClasses(), ontologyNamepsace, true, false, language);
changelog+="</ul>";
changelog+="</ul></details>";
}
if(!c.getDeletedClasses().isEmpty()){
changelog+="<p><u>"+language.getProperty(Constants.LANG_DELETED_CLASS)+"</u></p>\n";
changelog+="<details><summary><u>"+language.getProperty(Constants.LANG_DELETED_CLASS)+"</u></summary>\n";
changelog+="<ul>";
changelog += axiomInfoSetToHTML(c.getDeletedClasses(), ontologyNamepsace, false, false, language);
changelog+="</ul>";
changelog+="</ul></details>";
}

}
if(changesInProps>0){
changelog+="<h3 id=\"changeProp\" class=\"list\">"+language.getProperty(Constants.LANG_OBJ_PROP)+"</h3>\n";
if(!c.getModifiedProperties().isEmpty()){
changelog+="<p><u>"+language.getProperty(Constants.LANG_MODIFIED_PROP)+"</u></p>\n";
changelog+="<details><summary><u>"+language.getProperty(Constants.LANG_MODIFIED_PROP)+"</u></summary>\n";
changelog+="<ul>";
changelog += axiomInfoSetToHTML(c.getModifiedProperties(), ontologyNamepsace, true, true, language);
changelog+="</ul>";
changelog+="</ul></details>";
}
if(!c.getNewProperties().isEmpty()){
changelog+="<p><u>"+language.getProperty(Constants.LANG_ADDED_PROP)+"</u></p>\n";
changelog+="<details><summary><u>"+language.getProperty(Constants.LANG_ADDED_PROP)+"</u></summary>\n";
changelog+="<ul>";
changelog += axiomInfoSetToHTML(c.getNewProperties(), ontologyNamepsace, true, false, language);
changelog+="</ul>";
changelog+="</ul></details>";
}
if(!c.getDeletedProperties().isEmpty()){
changelog+="<p><u>"+language.getProperty(Constants.LANG_DELETED_PROP)+"</u></p>\n";
changelog+="<details><summary><u>"+language.getProperty(Constants.LANG_DELETED_PROP)+"</u></summary>\n";
changelog+="<ul>";
changelog += axiomInfoSetToHTML(c.getDeletedProperties(), ontologyNamepsace, false, false, language);
changelog+="</ul>";
changelog+="</ul></details>";
}
}
if(changesInDataProps>0){
changelog+="<h3 id=\"changeDataProp\" class=\"list\">"+language.getProperty(Constants.LANG_DATA_PROP)+"</h3>\n";
if(!c.getModifiedDataProperties().isEmpty()){
changelog+="<p><u>"+language.getProperty(Constants.LANG_MODIFIED_DATA_PROP)+"</u></p>\n";
changelog+="<details><summary><u>"+language.getProperty(Constants.LANG_MODIFIED_DATA_PROP)+"</u></summary>\n";
changelog+="<ul>";
changelog += axiomInfoSetToHTML(c.getModifiedDataProperties(), ontologyNamepsace, true, true, language);
changelog+="</ul>";
changelog+="</ul></details>";
}
if(!c.getNewDataProperties().isEmpty()){
changelog+="<p><u>"+language.getProperty(Constants.LANG_ADDED_DATA_PROP)+"</u></p>\n";
changelog+="<details><summary><u>"+language.getProperty(Constants.LANG_ADDED_DATA_PROP)+"</u></summary>\n";
changelog+="<ul>";
changelog += axiomInfoSetToHTML(c.getNewDataProperties(), ontologyNamepsace, true, false, language);
changelog+="</ul>";
changelog+="</ul></details>";
}
if(!c.getDeletedDataProperties().isEmpty()){
changelog+="<p><u>"+language.getProperty(Constants.LANG_DELETED_DATA_PROP)+"</u></p>\n";
changelog+="<details><summary><u>"+language.getProperty(Constants.LANG_DELETED_DATA_PROP)+"</u></summary>\n";
changelog+="<ul>";
changelog += axiomInfoSetToHTML(c.getDeletedDataProperties(), ontologyNamepsace, false, false, language);
changelog+="</ul>";
changelog+="</ul></details>";
}
}
return changelog;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/licensius/GetLicense.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Polit�cnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/lode/LODEGeneration.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/oops/OOPSevaluation.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -199,7 +199,7 @@ public String printEvaluation (){
// title = ind.getPropertyValue(hasTitleDTP).asLiteral().getString();
// }

// c—digo y titulo
// codigo y titulo
evaluationOutput = evaluationOutput + "<div class=\"panel panel-default\">\n";
evaluationOutput = evaluationOutput + "<div class=\"panel-heading\">\n";
evaluationOutput = evaluationOutput + "<h4 class=\"panel-title\">\n";
Expand Down Expand Up @@ -246,7 +246,7 @@ else if (importanceLevel.equalsIgnoreCase("minor")){
evaluationOutput = evaluationOutput + "</div>\n";
evaluationOutput = evaluationOutput + "<div id=\"collapse"+i+"\" class=\"panel-collapse collapse\">\n";
evaluationOutput = evaluationOutput + "<div class=\"panel-body\">\n";
//descripci—n
//descripcion
evaluationOutput = evaluationOutput + "<p>" + description + "</p>";

// affected elements
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/widoco/Configuration.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -79,6 +79,7 @@ public class Configuration {
private String descriptionPath;
private String referencesPath;
private String googleAnalyticsCode = null;
private String contextURI; //not added with an ontology because it's independent

/**
* Property for including an ontology diagram (future work)
Expand Down Expand Up @@ -178,6 +179,7 @@ public final void initializeConfig(){
displaySerializations = true;
displayDirectImportsOnly = false;
rewriteBase = "/";
contextURI ="";
initializeOntology();
}

Expand Down Expand Up @@ -221,6 +223,7 @@ private void loadPropertyFile(String path){
propertyFile.load(new InputStreamReader(new FileInputStream(path), "UTF-8"));
//We try to load from the configuration file. If it fails, then we should try to load from the ontology. Then, if it fails, we should ask the user.
abstractSection = propertyFile.getProperty(Constants.ABSTRACT_SECTION_CONTENT);
contextURI = propertyFile.getProperty(Constants.CONTEXT_URI, "");
mainOntologyMetadata.setTitle (propertyFile.getProperty(Constants.ONT_TITLE,"Title goes here"));
mainOntologyMetadata.setReleaseDate(propertyFile.getProperty(Constants.DATE_OF_RELEASE, "Date of release"));
mainOntologyMetadata.setPreviousVersion(propertyFile.getProperty(Constants.PREVIOUS_VERSION));
Expand Down Expand Up @@ -1037,6 +1040,12 @@ public void setRewriteBase(String rewriteBase) {
}
this.rewriteBase = rewriteBase;
}

public String getContextURI() {
return contextURI;
}





Expand Down
7 changes: 6 additions & 1 deletion src/main/java/widoco/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public class Constants {
*/

public static final String ABSTRACT_SECTION_CONTENT="abstract";
public static final String CONTEXT_URI="contextURI";
public static final String ONT_TITLE="ontologyTitle";
public static final String ONT_NAME="ontologyName";
public static final String ONT_PREFIX="ontologyPrefix";
Expand Down Expand Up @@ -680,6 +681,10 @@ public static String getHeadSection(Configuration c, Properties l){
}
head+="</dd>";
}
String context= c.getContextURI();
if(context!=null && !context.equals("")){
head+="<dt>JSON-LD Context</dt><dd><a href=\""+context+"\">"+context+"</a></dd>";
}

if(c.getMainOntology().getLicense()!=null){
String lname = c.getMainOntology().getLicense().getName();//"license name goes here";
Expand Down Expand Up @@ -851,7 +856,7 @@ public static String getProvenanceRDF(Configuration c){

public static final String LODE_RESOURCES= "/lode.zip";
public static final String OOPS_RESOURCES = "/oops.zip";
public static final String WEBVOWL_RESOURCES = "/webvowl.zip";
public static final String WEBVOWL_RESOURCES = "/webvowl_1.1.4_patched.zip";

public static final String CONFIG_PATH = "config"+File.separator+"config.properties";

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/widoco/CreateDocInThread.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/widoco/CreateOOPSEvalInThread.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/widoco/CreateResources.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -72,15 +72,15 @@ public static void generateDocumentation(String outFolder, Configuration c, File
lodeContent = LODEGeneration.getLODEhtml(c, lodeResources);
LODEParser lode = new LODEParser(lodeContent,c,languageFile);
if(c.isCreateHTACCESS()){
File f = new File (folderOut);
if(!f.exists()){
f.mkdir();
File fOut = new File(folderOut);
if(!fOut.exists()){
fOut.mkdirs();
}
createHTACCESSFile(folderOut+File.separator+".htaccess",c);
//slash ontologies require a special type of redirection
if(!c.getMainOntology().isHashOntology()){
folderOut+=File.separator+"doc";
}
}
//slash ontologies require a special type of redirection
if(!c.getMainOntology().isHashOntology()){
folderOut+=File.separator+"doc";
}
createFolderStructure(folderOut,c,languageFile);
if(c.isIncludeAbstract()){
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/widoco/LODEParser.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/widoco/LoadOntologyInThread.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/widoco/WidocoUtils.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -66,7 +66,7 @@ public static void loadModelToDocument(Configuration c) throws Exception{
manager.getIRIMappers().add(jenaCatalogMapper);
((JenaCatalogIRIMapper) jenaCatalogMapper).printMap();
OWLOntologyLoaderConfiguration loadingConfig = new OWLOntologyLoaderConfiguration();
loadingConfig = loadingConfig.setMissingImportHandlingStrategy(MissingImportHandlingStrategy.THROW_EXCEPTION);
loadingConfig = loadingConfig.setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT);
OWLOntology ontology= manager.loadOntologyFromOntologyDocument(new FileDocumentSource(new File(c.getOntologyPath())),loadingConfig);
c.getMainOntology().setMainOntology(ontology);
c.getMainOntology().setMainOntologyManager(manager);
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/widoco/entities/Agent.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/widoco/entities/License.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/widoco/entities/Ontology.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/widoco/gui/AddProperty.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package widoco.gui;

import java.awt.Dimension;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/widoco/gui/BiggerTextArea.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package widoco.gui;

import java.awt.Dimension;
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/widoco/gui/EditProperty.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package widoco.gui;

import java.awt.Dimension;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/widoco/gui/GuiController.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politécnica de Madrid, Spain
* Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -239,7 +239,7 @@ public GuiController(String[] args){
config.vocabularySuccessfullyGenerated();
}
}catch(Exception e){
System.err.println("Error while generating the documentation " +e.getMessage());
logger.error("Error while generating the documentation: " +e.getMessage(), e);
errors = true;
}

Expand Down
5 changes: 0 additions & 5 deletions src/main/java/widoco/gui/SelectLanguage.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package widoco.gui;

import java.awt.Dimension;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/widoco/gui/TestInterface.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package widoco.gui;

import java.awt.Color;
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/widoco/gui/TestStep0.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package widoco.gui;

import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.image.BufferedImage;
Expand Down
Binary file removed src/main/resources/webvowl.zip
Binary file not shown.
Binary file added src/main/resources/webvowl_1.1.4.zip
Binary file not shown.
Binary file added src/main/resources/webvowl_1.1.4_patched.zip
Binary file not shown.
Binary file removed src/main/resources/webvowl_original.zip
Binary file not shown.

0 comments on commit 318ff5e

Please sign in to comment.