Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SAREF
saref-pipeline
Commits
589e589e
Commit
589e589e
authored
Jun 15, 2020
by
Maxime Lefrançois
Browse files
solved exception when even the OWL reasoner doesn't want to read a certain ontology
parent
c18780a6
Pipeline
#74
passed with stage
in 2 minutes and 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/emse/gitlab/saref/checkers/Clause_9_6_4_Checker.java
View file @
589e589e
...
...
@@ -52,7 +52,7 @@ import fr.emse.gitlab.saref.managers.RepositoryManager;
public
class
Clause_9_6_4_Checker
extends
AbstractClauseChecker
{
private
static
enum
MESSAGE
{
profile
,
consistent
,
satisfiable
;
profile
,
consistent
,
satisfiable
,
exception
;
}
private
final
SAREFExample
example
;
...
...
@@ -89,25 +89,29 @@ public class Clause_9_6_4_Checker extends AbstractClauseChecker {
OntologyManager
ontologyManager
=
pipeline
.
getOntologyManager
();
Set
<
Explanation
<
OWLAxiom
>>
incExplanation
=
ontologyManager
.
getInconsistenceExplanations
(
ontology
,
errorLogger
);
if
(
incExplanation
!=
null
&&
!
incExplanation
.
isEmpty
())
{
String
explanation
=
incExplanation
.
stream
().
map
(
e
->
e
.
getAxioms
().
toString
())
.
collect
(
Collectors
.
joining
(
"\n- "
,
"\n\n- "
,
"\n\n"
));
logError
(
getMessage
(
MESSAGE
.
consistent
,
explanation
));
}
else
{
ExplanationGenerator
<
OWLAxiom
>
generator
=
ontologyManager
.
getExplanationGenerator
(
ontology
);
ontology
.
classesInSignature
(
Imports
.
INCLUDED
).
forEach
(
c
->
{
if
(
c
.
isOWLNothing
())
{
return
;
}
Set
<
Explanation
<
OWLAxiom
>>
incExplanation2
=
ontologyManager
.
getIncoherenceExplanations
(
generator
,
c
);
if
(!
incExplanation2
.
isEmpty
())
{
String
explanation
=
incExplanation2
.
stream
().
map
(
e
->
e
.
getAxioms
().
toString
())
.
collect
(
Collectors
.
joining
(
"\n- "
,
"\n\n- "
,
"\n\n"
));
logError
(
getMessage
(
MESSAGE
.
satisfiable
,
c
,
explanation
));
}
});
try
{
Set
<
Explanation
<
OWLAxiom
>>
incExplanation
=
ontologyManager
.
getInconsistenceExplanations
(
ontology
,
errorLogger
);
if
(
incExplanation
!=
null
&&
!
incExplanation
.
isEmpty
())
{
String
explanation
=
incExplanation
.
stream
().
map
(
e
->
e
.
getAxioms
().
toString
())
.
collect
(
Collectors
.
joining
(
"\n- "
,
"\n\n- "
,
"\n\n"
));
logError
(
getMessage
(
MESSAGE
.
consistent
,
explanation
));
}
else
{
ExplanationGenerator
<
OWLAxiom
>
generator
=
ontologyManager
.
getExplanationGenerator
(
ontology
);
ontology
.
classesInSignature
(
Imports
.
INCLUDED
).
forEach
(
c
->
{
if
(
c
.
isOWLNothing
())
{
return
;
}
Set
<
Explanation
<
OWLAxiom
>>
incExplanation2
=
ontologyManager
.
getIncoherenceExplanations
(
generator
,
c
);
if
(!
incExplanation2
.
isEmpty
())
{
String
explanation
=
incExplanation2
.
stream
().
map
(
e
->
e
.
getAxioms
().
toString
())
.
collect
(
Collectors
.
joining
(
"\n- "
,
"\n\n- "
,
"\n\n"
));
logError
(
getMessage
(
MESSAGE
.
satisfiable
,
c
,
explanation
));
}
});
}
}
catch
(
Exception
ex
)
{
logError
(
getMessage
(
MESSAGE
.
exception
),
ex
);
}
}
...
...
src/main/resources/messages/Clause_9_6_4_Checker.properties
View file @
589e589e
profile
=
The dataset in the example document shall satisfy the OWL2 DL profile. Violations are: %s
consistent
=
The dataset in the example document shall be Consistent. Violations are: %s
satisfiable
=
OWL Class %s declared in the example document should be satisfiable. Violations are: %s
exception
=
An exception occurred while trying to reason with the ontology.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment