Skip to content

Commit

Permalink
fixed some javadoc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
irina-dragoste committed Dec 6, 2019
1 parent 36afeac commit 55ca9fe
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public static void printOutQueryAnswers(final PositiveLiteral queryAtom, final R
*
* @param queryAtom query to be answered
* @param reasoner reasoner to query on
*
* @return number of answers to the given query
*/
public static int getQueryAnswerCount(final PositiveLiteral queryAtom, final Reasoner reasoner) {
try (final QueryResultIterator answers = reasoner.answerQuery(queryAtom, true)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public PrintQueryResults(final boolean sizeOnly, final boolean complete) {
}

/**
* Check correct configuration of the class. @code{--print-query-result-size}
* and @code{--print-query-result} are mutually exclusive.
* Check correct configuration of the class. {@code --print-query-result-size}
* and {@code --print-query-result} are mutually exclusive.
*
* @return @code{true} if configuration is valid.
* @return {@code true} if configuration is valid.
*/
public boolean isValid() {
return !this.sizeOnly || !this.complete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public SaveModel(final boolean saveModel, final String outputDir) {
}

/**
* Check correct configuration of the class. If @code{--save-model} is true,
* then a non-empty @code{--output-model-directory} is required.
* Check correct configuration of the class. If {@code --save-model} is true,
* then a non-empty {@code --output-model-directory} is required.
*
* @return @code{true} if configuration is valid.
* @return {@code true} if configuration is valid.
*/
public boolean isConfigurationValid() {
return !this.saveModel || ((this.outputModelDirectory != null) && !this.outputModelDirectory.isEmpty());
Expand All @@ -75,7 +75,7 @@ public boolean isConfigurationValid() {
/**
* Check that the path to store the model is either non-existing or a directory.
*
* @return @code{true} if conditions are satisfied.
* @return {@code true} if conditions are satisfied.
*/
public boolean isDirectoryValid() {
final File file = new File(this.outputModelDirectory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public SaveQueryResults(final boolean saveResults, final String outputDir) {
}

/**
* Check correct configuration of the class. If @code{--save-query-results} is
* true, then a non-empty @code{--output-query-result-directory} is required.
* Check correct configuration of the class. If {@code --save-query-results} is
* true, then a non-empty {@code --output-query-result-directory} is required.
*
* @return @code{true} if configuration is valid.
* @return {@code true} if configuration is valid.
*/
public boolean isConfigurationValid() {
return !this.saveResults
Expand All @@ -78,7 +78,7 @@ public boolean isConfigurationValid() {
* Check that the path to store the query results is either non-existing or a
* directory.
*
* @return @code{true} if conditions are satisfied.
* @return {@code true} if conditions are satisfied.
*/
public boolean isDirectoryValid() {
final File file = new File(this.outputQueryResultDirectory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
*/

/**
* Interface for variables, i.e., terms of type {@link TermType#VARIABLE}.
* Variables are terms that can be quantified to create formulas that refer to
* some or all values of the domain.
* Interface for variables, i.e., terms of type
* {@link TermType#UNIVERSAL_VARIABLE} and
* {@link TermType#EXISTENTIAL_VARIABLE}. Variables are terms that can be
* quantified to create formulas that refer to some or all values of the domain.
*
* @author david.carral@tu-dresden.de
* @author Markus Krötzsch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,30 @@
import org.semanticweb.vlog4j.core.model.api.Term;

/**
* Standard implementation of the {@Fact} interface.
* Standard implementation of the {@link Fact} interface.
*
* @author Markus Kroetzsch
*
*/
public class FactImpl extends PositiveLiteralImpl implements Fact {

public FactImpl(Predicate predicate, List<Term> terms) {
public FactImpl(final Predicate predicate, final List<Term> terms) {
super(predicate, terms);
for (Term t : terms) {
if (t.isVariable())
for (final Term t : terms) {
if (t.isVariable()) {
throw new IllegalArgumentException("Facts cannot contain variables.");
}
}
}

@Override
public <T> T accept(StatementVisitor<T> statementVisitor) {
public <T> T accept(final StatementVisitor<T> statementVisitor) {
return statementVisitor.visit(this);
}

@Override
public String toString() {
return getSyntacticRepresentation();
return this.getSyntacticRepresentation();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private Serializer() {
/**
* Creates a String representation of a given {@link Rule}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param rule a {@link Rule}.
* @return String representation corresponding to a given {@link Rule}.
*
Expand All @@ -100,7 +100,7 @@ public static String getString(final Rule rule) {
/**
* Creates a String representation of a given {@link Conjunction}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param conjunction a {@link Conjunction}
* @return String representation corresponding to a given {@link Conjunction}.
*/
Expand All @@ -121,7 +121,7 @@ public static String getString(final Conjunction<? extends Literal> conjunction)
/**
* Creates a String representation of a given {@link Literal}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param literal a {@link Literal}
* @return String representation corresponding to a given {@link Literal}.
*/
Expand All @@ -148,7 +148,7 @@ public static String getString(final Literal literal) {
/**
* Creates a String representation of a given {@link Fact}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param fact a {@link Fact}
* @return String representation corresponding to a given {@link Fact}.
*/
Expand All @@ -159,7 +159,7 @@ public static String getFactString(final Fact fact) {
/**
* Creates a String representation of a given {@link Constant}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param constant a {@link Constant}
* @return String representation corresponding to a given {@link Constant}.
*/
Expand All @@ -171,7 +171,7 @@ public static String getString(final AbstractConstant constant) {
* Creates a String representation corresponding to the name of a given
* {@link LanguageStringConstant}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param languageStringConstant a {@link LanguageStringConstant}
* @return String representation corresponding to the name of a given
* {@link LanguageStringConstant}.
Expand All @@ -184,7 +184,7 @@ public static String getConstantName(final LanguageStringConstant languageString
* Creates a String representation corresponding to the name of a given
* {@link DatatypeConstant} without an IRI.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param datatypeConstant a {@link DatatypeConstant}
* @return String representation corresponding to a given
* {@link DatatypeConstant}.
Expand All @@ -207,7 +207,7 @@ public static String getString(final DatatypeConstant datatypeConstant) {
* Creates a String representation corresponding to the name of a given
* {@link DatatypeConstant} including an IRI.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param datatypeConstant a {@link DatatypeConstant}
* @return String representation corresponding to a given
* {@link DatatypeConstant}.
Expand All @@ -220,7 +220,7 @@ public static String getConstantName(final DatatypeConstant datatypeConstant) {
/**
* Creates a String representation of a given {@link ExistentialVariable}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param existentialVariable a {@link ExistentialVariable}
* @return String representation corresponding to a given
* {@link ExistentialVariable}.
Expand All @@ -232,7 +232,7 @@ public static String getString(final ExistentialVariable existentialVariable) {
/**
* Creates a String representation of a given {@link UniversalVariable}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param universalVariable a {@link UniversalVariable}
* @return String representation corresponding to a given
* {@link UniversalVariable}.
Expand All @@ -244,7 +244,7 @@ public static String getString(final UniversalVariable universalVariable) {
/**
* Creates a String representation of a given {@link NamedNull}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param namedNull a {@link NamedNull}
* @return String representation corresponding to a given {@link NamedNull}.
*/
Expand All @@ -255,7 +255,7 @@ public static String getString(final NamedNull namedNull) {
/**
* Creates a String representation of a given {@link Predicate}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param predicate a {@link Predicate}
* @return String representation corresponding to a given {@link Predicate}.
*/
Expand All @@ -266,7 +266,7 @@ public static String getString(final Predicate predicate) {
/**
* Creates a String representation of a given {@link DataSourceDeclaration}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki"> for wiki.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
* @param dataSourceDeclaration a {@link DataSourceDeclaration}
* @return String representation corresponding to a given
* {@link DataSourceDeclaration}.
Expand All @@ -279,7 +279,7 @@ public static String getString(final DataSourceDeclaration dataSourceDeclaration
/**
* Creates a String representation of a given {@link CsvFileDataSource}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki">.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> ..
*
* @param csvFileDataSource
* @return String representation corresponding to a given
Expand All @@ -292,7 +292,7 @@ public static String getString(final CsvFileDataSource csvFileDataSource) {
/**
* Creates a String representation of a given {@link RdfFileDataSource}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki">.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> ..
*
*
* @param rdfFileDataSource
Expand All @@ -307,7 +307,7 @@ public static String getString(final RdfFileDataSource rdfFileDataSource) {
* Creates a String representation of a given
* {@link SparqlQueryResultDataSource}.
*
* @see <"https://github.com/knowsys/vlog4j/wiki">.
* @see <a href="https://github.com/knowsys/vlog4j/wiki">Rule syntax</a> .
*
*
* @param dataSource
Expand Down Expand Up @@ -335,14 +335,8 @@ private static String getIRIString(final String string) {
}

private static String escape(final String string) {
return string
.replace("\\", "\\\\")
.replace("\"", "\\\"")
.replace("\t", "\\t")
.replace("\b", "\\b")
.replace("\n", "\\n")
.replace("\r", "\\r")
.replace("\f", "\\f");
return string.replace("\\", "\\\\").replace("\"", "\\\"").replace("\t", "\\t").replace("\b", "\\b")
.replace("\n", "\\n").replace("\r", "\\r").replace("\f", "\\f");
// don't touch single quotes here since we only construct double-quoted strings
}

Expand Down
Loading

0 comments on commit 55ca9fe

Please sign in to comment.