Date: 2013-01-03 17:30:35
From: Erik.Boye@statnett.no
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

asked 03 Apr '13, 12:12

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%


Date: 2013-01-09 10:57:19
From: johann.petrak@jpetrak.com
Just a few remarks in an attempt to deal with my own confusion ...
"or none":
This is what I originally thought, but if I understand
the RDF semantics document correctly, then a plain
literal entails type xsd:string.
Should that inference not carry over to OWL Lite and
OWL2 RL and others (at least for reasoners that
do all of OWL-Lite or OWL2 RL etc.)?
Where "extra membership" means "additional restriction" - which can
easily lead to inconsistency when the intersection of all ranges
is not compatible with any value any more.
As far as I understand, merely defining ranges such that the
set of possible values is empty does not yet make the ontology
inconsistent, but as soon as a triple tries to assert any value
for such a property, the ontology should be inconsistent.
Of course this is again all not relevant for OWLIM: as long
as those inferences are not made, no inconsistency will be
detected and therefore inference of other facts is unaffected.
Cheers,
johann
link

answered 03 Apr '13, 12:13

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%

Date: 2013-01-04 01:56:30
From: johann.petrak@jpetrak.com
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
link

answered 03 Apr '13, 12:12

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%

Date: 2013-01-08 14:57:04
From: Erik.Boye@statnett.no
Hi Johann,
Thank you for your response - it helped me understand what is going on here. But still, I am having difficulties understanding why? :-)
I like to think about OWL as analogue to XML schema (XSD) and "RDF data" as analogue to an XML (data) instance - even if this is probably not a fully correct analogy. In a XML schema, you can state that an element (or attribute) is of type X. In the XML data instance you do not have to repeat that a concrete element (or attribute) is of type X. But in OWL/RDF, you obviously have to repeat the type information in the data. Why?
As stated originally, I do not control the ontology/OWL (industry standard) or the RDF/XML documents. I suggested adding rdf:datatype="..." to all attributes that are not of type string in the RDF/XML documents, to solve my issue, but I didn't get an applause for that suggestion. The ones responsible for the RDF/XML documents considered this to be redundant information (as it is already stated in the OWL) that would potentially increase the size of the documents considerably. And I can agree with that....
When this is said, I created a simple workaround by stacking a Sesame Sail on top of OWLIM. This custom Sail intercepts all attempts to add a plain literal to the repository. It tries to look up the datatype from the repository (that also contains the metadata). If it can deduce the correct datatype, it converts the plain literal to a types literal - before it is added to the repository by the delegate Sail. All datatypes looked up from the repository is cached (by connection) for performance reasons. This workaround seems to solve my immediate issue.
But I still do not understand why simple datatype reasoning like this could be provided as a feature by OWLIM. It seems solve a lot of apparently more complex issues. Please correct me if I am wrong about how simple this is..... :-)
Regards,
Erik
link

answered 03 Apr '13, 12:13

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%

Date: 2013-01-08 19:31:57
From: johann.petrak@jpetrak.com
Hi Erik,
I think part of what I wrote in my last email was incorrect.
It is true that OWLIM does not do datatype-based inference
(it does state this in the manual).
It is also true that the simultaneous assertion of these
triples (Turtle syntax):
:propInt a owl:DatatypeProperty ;
rdfs:range xsd:integer .
:someInstance :propInt "1" .
should result in an inconsistent Ontology whenever
datatype-based inference is done. The reason, as far
as my current understanding goes, is this:
1) as defined in the RDF semantics document, a plain
literal (without a language tag) is the same as a typed
literal of type xsd:string - see rule "xsd 1b".
(this is what I was not aware of in my last email. Still
not sure what the type of a plain literal with a language
tag is).
2) Therefore, asserting :someInstance :propInt "1" will
assert that the type of the literal for this property
is xsd:string.
3) at the same time, the range axiom says that *all* values
of the property must (also) be integers (the range can be
the combination of several types, but then each value
must be an instance of ALL types, so the intersection
of all types is used).
4) the value "1" as a string is different from all integer
values and therefore contradicts the range axiom, which
means the ontology is inconsistent.
In other words, that ontology you are working with is
at least to my understanding, actually inconsistent when
interpreted according to OWL-Lite (and probably other
OWL sublanguages where datatype-based inference is
part of the semantics).
I am wondering if this ontology is ever used with
a reasoner that does datatype-based inference and how
that can work? If this is an "industry standard ontology",
how can this not be a problem?
For example if you load that ontology
into Pellet4 and run the reasoner, you should see if
it is found to be consistent or not.
So, in a way, the fact that OWLIM does not do datatype
based inference is a good thing here, because it saves
you from inconsistency.
Cheers,
johann
link

answered 03 Apr '13, 12:13

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%

Date: 2013-01-09 08:53:51
From: barry.bishop@ontotext.com
Hi Erik,
Just a few comments. You seem to confuse two separate things:
1. The data-type of literals
2. Membership (rdf:type) of classes
Data-type reasoning can be summarised by the rules in table 8 here:
http://www.w3.org/TR/owl2-profiles/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules
dt-type2 says that for every literal in the database, a triple should be 
inferred that specifies that type membership
e.g. if "21"^^xsd:integer is present somewhere then infer the following 
triple:
"21"^^xsd:integer rdf:type xsd:integer
This always confused me, because literals can not be in the subject 
position, so I always assumed that the RDF literal generalisation rule 
is to be used, i.e. that there exists a blank node allocated to each 
unique literal:
[]  rdf:type xsd:integer
Anyway, back to data-type reasoning, it is not done in OWLIM due to its 
forward-chaining nature, see rule dt-diff where every literal is 
inferred to be different from every other literal. Not sure how this 
would ever be helpful, but the computation of these inferences is 
nevertheless a large Cartesian product.
Last point, a literal has only one data type (or none), since the 
data-type is part of the literal value. However, an individual can be 
the member of any number of classes. The use of rdfs:range simply adds 
an extra membership for any individual that appears in the object 
position of a triple with the relevant property. It doesn't actually 
change the literal value itself.
I hope this helps,
barry
link

answered 03 Apr '13, 12:13

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k133156205
accept rate: 30%

Personally, I really like this forum because I got lots of good information which I need. Corrugatd Components I am regularly following this forum to get maximum information which can help me in the future.

link

answered 18 Nov '16, 06:49

Emily%20Burke's gravatar image

Emily Burke
(suspended)
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×261
×243

Asked: 03 Apr '13, 12:12

Seen: 1,099 times

Last updated: 18 Nov '16, 06:49

powered by BitNami OSQA