You expect something from the reasoner here that OWL in general is not supposed to do: When you assert this: <e:A rdf:ID="_842CF986386E46E3E040E9E4E38A6337"> <e:A.integerProperty>21</e:A.integerProperty> </e:A> then you specifically assert the value of the property to be a *plain* literal. Plain literals may or may not have a language identifier, but a plain literal is different from a typed literal. A plain literal is NOT a literal with the type just missing, it is something entirely different from a typed literal. (e.g. it can have a language identifier while a typed literal cannot have one) An OWL reasonor that is able to reason about datatypes can only infer something *from* that information, so if you state elsewhere that that the range of that property has datatype integer, the reasoner would have to infer that your ontology is inconsistent. That is probably not what you want here :)
In order to actually assert a value of type xsd:integer you have to assert an apropriately typed literal each time, i.e. in your case, you would have to explicitly state the type xsd:integer for each literal. However in the context of OWLIM all this is really irrelevant as OWLIM does not do any datatype-based inference anyways. (See the OWLIM user-guide for more information on what kind of inference is done for which rule set). Cheers, Johann On 2013-01-03 18:30, Erik Boye wrote: > Hi, > > I want to OWLIM and Sesame to store and query power network models where I > neither control the ontology/OWL (industry standard) or the RDF/XML documents > (output from a off-the-shelf industry software product). > > Since the ontology and models I am working with are quite complex, I have > created a very simple setup to explain the problem I am facing: > > A simple dummy ontology (equivalent-ontology.owl): > <rdf:RDF > xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > xmlns:owl="http://www.w3.org/2002/07/owl#" > xmlns:equivalent="http://example.org/equivalent#" > xml:base="http://example.org/equivalent"> > > <rdf:Description rdf:about="#A"> > <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> > </rdf:Description> > <rdf:Description rdf:about="#A.integerProperty"> > <rdfs:domain rdf:resource="#A"/> > <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/> > <rdf:type > rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/> > <rdf:type > rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/> > <rdf:type > rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/> > </rdf:Description> > </rdf:RDF> > > And a simple dummy data file (rdf-data.xml): > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > xmlns:e="http://example.org/equivalent#"> > <e:A rdf:ID="_842CF986386E46E3E040E9E4E38A6337"> > <e:A.integerProperty>21</e:A.integerProperty> > </e:A> > </rdf:RDF> > > The problem I am facing is that OWLIM does not seem to infer the xsd:integer > type on the plain literal of "21", which results in a plain literal being > returned when querying for data. After searching for previous posts on the > mailing lists, I understand that the support for datatype reasoning in OWLIM > is limited, but I would expect simple things like this to work. Please excuse > me if I have too much expectations. :-) > > I have attached a simple TestNG based test to provide more details to what I > expect (DatatypeReasoningTest.java). This test currently fails: > java.lang.AssertionError: expected object to not be null > at org.testng.Assert.fail(Assert.java:94) > at org.testng.Assert.assertNotNull(Assert.java:404) > at org.testng.Assert.assertNotNull(Assert.java:389) > at > no.statnett.cim.model.DatatypeReasoningTest.testIntegerProperty(DatatypeReasoningTest.java:47) > as the literal returned is a plain literal (datatype is null). > > > With a file based repository I found a workaround by adding the datatype to > the plain literal on insert to the repository (using the ontology information > [rdfs:range]) - making it into a typed literal. But I do not see a way to > apply the same workaround with a http repository (that also will apply when > adding data though the Sesame Workbench). Is there any "hook" available for > performing tasks like this - if (simple) datatype reasoning is not supported > by OWLIM? > > Any comments or suggestions are welcomed. > > Best regards, > Erik > > > > _______________________________________________ > Owlim-discussion mailing list > Owlim-discussion@ontotext.com > http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion > _______________________________________________ Owlim-discussion mailing list Owlim-discussion@ontotext.com http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion