On 28/07/14 14:10, Stefan Henke wrote:
I figured out that the validation error was not only caused by the fact
that the ontology is using OWL2 parts. Additionally, the way of creating
the literal was wrong:
model.createTypedLiteral(30.0, XSDDatatype.XSDfloat);
This will create a double type. Changing this to the following made it work:
model.createTypedLiteral(new Float(30.0), XSDDatatype.XSDfloat);

Hmm, yes xsd:float and xsd:double being disjont is a pain, though I hadn't realized the value type would override the explicitly given type in that case.

Another question: if you are saying, jena is not supporting OWL2. Is this
limited to the reasoner only or to jena in general? Would it be possible to
use my original ontology with an external reasoner that supports OWL2?

Yes.

The normative format for OWL2 is still an RDF encoding so you can read and write OWL2 in the format fine and if you have a reasoner that understand OWL2 it can validate it within Jena.

However, Jena does not support the other OWL2 syntaxes (the OWL2-specific XML format and Manchester syntax) and the OntAPI has no convenience methods to support OWL2 constructs that were not in OWL1.

Dave

Regards,
Stefan



2014-07-28 11:32 GMT+02:00 Dave Reynolds <[email protected]>:

On 28/07/14 10:28, Stefan Henke wrote:

Hi Dave,
thanks for pointing this out. I will modify the ontology accordingly.
However, do you have any clue why the validation fails only if a specify a
reasoner?


That's what validation is, you are asking the reasoner if it can find any
inconsistencies.

Dave


  2014-07-27 20:29 GMT+02:00 Dave Reynolds <[email protected]>:

  On 27/07/14 11:34, Stefan Henke wrote:

  Hi,
I´m experiencing an issue with model validation. I attached a snippet of
my ontology which contains the necessary parts. Whenever I use the
following code which is a simplified version of the real coding, I´m
getting the validation error from below.

InfModel inferredModel =
ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(),
ModelFactory.createDefaultModel());
URL weather = this.getClass().getResource("weatherontology.owl");
inferredModel.read(weather.toString());
ValidityReport report = inferredModel.validate();
Iterator<Report> it  = report.getReports();
while(it.hasNext()) {
Report rep = it.next();
System.out.println(rep.toString());
}
Assert.assertTrue(report.isValid());

However, if I change the very first line to the following, it is working
fine:

InfModel inferredModel = ModelFactory.createOntologyModel();

Validation error:

Error ("range check"): "Incorrectly typed literal due to range (prop,
value)"
Culprit =
https://www.auto.tuwien.ac.at/downloads/thinkhome/ontology/
WeatherOntology.owl#TEST_Wind071020131300
Implicated node:
https://www.auto.tuwien.ac.at/downloads/thinkhome/ontology/
WeatherOntology.owl#hasDirection
Implicated node: '339.5'^^http://www.w3.org/2001/XMLSchema#float

Any clue on this?


That ontology is used OWL 2 data range specifications, Jena does not
support OWL 2.

Dave







Reply via email to