Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #262 #493

Merged
merged 1 commit into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ docker run -ti --rm \

`-uniteSections`: Write all HTML sections into a single HTML document.

`-noPlaceHolderText`: Do not add any placeholder text (this will remove intro, abstract (if empty) and description sections).

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


Expand Down
8 changes: 4 additions & 4 deletions src/main/java/widoco/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ public final void initializeConfig() {
displayDirectImportsOnly = false;
rewriteBase = "/";
contextURI = "";
//BY DEFAULT SHOULD BE FALSE
includeAllSectionsInOneDocument = true;
includeAllSectionsInOneDocument = false;
initializeOntology();
}

Expand Down Expand Up @@ -221,6 +220,8 @@ private void initializeOntology() {
mainOntologyMetadata.setDoi("");
mainOntologyMetadata.setStatus("");
mainOntologyMetadata.setBackwardsCompatibleWith("");
mainOntologyMetadata.setIncompatibleWith("");
mainOntologyMetadata.setImages(new ArrayList<>());
this.namespaceDeclarations = new HashMap<>();
}

Expand Down Expand Up @@ -368,6 +369,7 @@ private void loadPropertyFile(String path) throws IOException {
mainOntologyMetadata.addSerialization("JSON-LD", serializationJSONLD);
}
this.googleAnalyticsCode = propertyFile.getProperty("GoogleAnalyticsCode");
//TO DO: There is missing metadata here (incompatible, images, backwards compatibility)

} catch (IOException ex) {
// Only a warning, as we can continue safely without a property file.
Expand Down Expand Up @@ -587,13 +589,11 @@ private void completeOntologyMetadata(OWLAnnotation a, OWLOntology o) {
if (!a.getValue().asAnonymousIndividual().isEmpty()){
// dealing with a blank node, extract metadata from URL, name and organization (if available)
o.getAnnotationAssertionAxioms(a.getValue().asAnonymousIndividual().get()).stream().forEach(i -> {
// System.out.println("AP "+i);
completeAgentMetadata(i, ag, o);
});
}else{
IRI valueURI = a.getValue().asIRI().get();
o.getAnnotationAssertionAxioms(valueURI).stream().forEach(i -> {
// System.out.println("NAMED " + i);
completeAgentMetadata(i, ag, o);
});
if(ag.getName()==null || ag.getName().equals("")){
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/widoco/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ 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" +
" -noPlaceHolderText: Do not add any placeholder text (this will remove intro, abstract (if empty) and " +
"description sections)." +
" --help: Shows this message and exit.\n";

/**
Expand Down
26 changes: 20 additions & 6 deletions src/main/java/widoco/gui/GuiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ public GuiController(String[] args) {
boolean isFromFile = false, oops = false, rewriteAll = false, getOntoMetadata = true, useW3Cstyle = true,
includeImportedOntologies = false, htAccess = false, webVowl = false, errors = false, licensius = false,
generateOnlyCrossRef = false, includeNamedIndividuals = true, includeAnnotationProperties = false,
displaySerializations = true, displayDirectImportsOnly = false, excludeIntroduction = false, uniteSections = false;
displaySerializations = true, displayDirectImportsOnly = false, excludeIntroduction = false, uniteSections = false,
placeHolderText = true;
String confPath = "";
String code = null;// for tracking analytics.
String[] languages = null;
Expand Down Expand Up @@ -166,12 +167,15 @@ public GuiController(String[] args) {
case "-excludeIntroduction":
excludeIntroduction = true;
break;
case "-uniteSections":
case "-uniteSections":
uniteSections = true;
break;
case "--help":
System.out.println(Constants.HELP_TEXT);
return;
case "-noPlaceHolderText":
placeHolderText = false;
break;
case "--help":
System.out.println(Constants.HELP_TEXT);
return;
default:
System.out.println("Command" + s + " not recognized.");
System.out.println(Constants.HELP_TEXT);
Expand Down Expand Up @@ -212,10 +216,16 @@ public GuiController(String[] args) {
this.config.setIncludeAnnotationProperties(includeAnnotationProperties);
this.config.setDisplaySerializations(displaySerializations);
this.config.setDisplayDirectImportsOnly(displayDirectImportsOnly);
this.config.setIncludeAllSectionsInOneDocument(uniteSections);
this.config.setIncludeAllSectionsInOneDocument(uniteSections);
if (excludeIntroduction) {
this.config.setIncludeIntroduction(false);
}
if (!placeHolderText){
this.config.setIncludeIntroduction(false);
this.config.setIncludeDescription(false);
this.config.setIncludeReferences(false);
this.config.setIncludeAbstract(false);
}
if (code != null) {
this.config.setGoogleAnalyticsCode(code);
}
Expand Down Expand Up @@ -257,6 +267,10 @@ public GuiController(String[] args) {
if (getOntoMetadata) {
logger.info("Load properties from the ontology in lang " + l);
config.loadPropertiesFromOntology(config.getMainOntology().getOWLAPIModel());
if (config.getAbstractSection()!=null && !config.getAbstractSection().equals("") &&
placeHolderText == false){
config.setIncludeAbstract(true);
}
}
CreateResources.generateDocumentation(outFolder, config, config.getTmpFile());
config.vocabularySuccessfullyGenerated();
Expand Down