Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing owl-query error message and fixing owl doc bug
Browse files Browse the repository at this point in the history
melaasar committed Jul 9, 2024
1 parent e643aaa commit 2ecde3e
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions owl-doc/src/main/java/io/opencaesar/owl/doc/OwlDocApp.java
Original file line number Diff line number Diff line change
@@ -580,7 +580,7 @@ private Map<File, String> generateClassesFile(OwlModel owlModel) throws IOExcept

var image = getClassImage(path1, s);
var axioms = getAxioms(path1, s.listProperties());
var superClasses = getNodes(path1, "directSuperClassOf", IMG_CLASS, s.listSubClasses(true).toList());
var superClasses = getNodes(path1, "directSuperClassOf", IMG_CLASS, s.listSubClasses(true).filterDrop(i -> i.isAnon()).toList());
var properties = getNodes("directDomainOf", owlModel.ontModel.listSubjectsWithProperty(RDFS.domain, s).toList(), IMG_PROPERTY, i -> asString(path1, i)+" → "+asString(path1, owlModel.ontModel.getOntProperty(i.asResource().getURI()).listRange().toList()));
var restrictedProperties = getNodes("directHasRestrictionOn", s.listSuperClasses(true).filterKeep(i -> i.isRestriction()).mapWith(i -> i.asRestriction()).toList(), IMG_PROPERTY, restrictionFunc);
final var content = new StringBuffer(String.format(
@@ -671,7 +671,7 @@ private Map<File, String> generateClassHierarchyFile(OwlModel owlModel) throws I
getRelativePath(path, path1),
aClass.getLocalName()));

List<OntClass> subClasses = aClass.listSubClasses(true).toList();
List<OntClass> subClasses = aClass.listSubClasses(true).filterDrop(i -> i.isAnon()).toList();

for (OntClass subClass : subClasses) {
levels.put(subClass, indentLevel+1);
Original file line number Diff line number Diff line change
@@ -39,16 +39,16 @@ public OwlQueryTask() {
@Input
public abstract Property<String> getEndpointURL();

/**
* The short name of the query service (optional, default is 'sparql').
*
* @return String Property
*/
@Optional
@Input
public abstract Property<String> getQueryService();
/**
* The short name of the query service (optional, default is 'sparql').
*
* @return String Property
*/
@Optional
@Input
public abstract Property<String> getQueryService();

/**
/**
* The required gradle task input query path where to search for *.sparql files.
*
* @return File Property
@@ -142,17 +142,17 @@ private File replacePathAndExtension(File file, File newPath, String newExt) {
/**
* The gradle task action logic.
*/
@TaskAction
public void run() {
@TaskAction
public void run() {
final ArrayList<String> args = new ArrayList<>();
if (getEndpointURL().isPresent()) {
args.add("-e");
args.add(getEndpointURL().get());
}
if (getQueryService().isPresent()) {
args.add("-qs");
args.add(getQueryService().get());
}
if (getQueryService().isPresent()) {
args.add("-qs");
args.add(getQueryService().get());
}
if (getQueryPath().isPresent()) {
args.add("-q");
args.add(getQueryPath().get().getAbsolutePath());
@@ -173,5 +173,5 @@ public void run() {
} catch (Exception e) {
throw new GradleException(e.getLocalizedMessage(), e);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -335,7 +335,7 @@ private HashMap<String, Query> collectQueries(final File directory) throws Query
try {
queries.put(getFileName(file), QueryFactory.read(file.toURI().getPath()));
} catch (QueryException e) {
throw new QueryException("File: " + file.getName() + " . Error with parsing this file's query: ", e);
throw new QueryException("In file '" + file.getName() + "': " + e.getMessage());
}
}
} else if (file.isDirectory()) {

0 comments on commit 2ecde3e

Please sign in to comment.