I have several questions on OWL + SWRL. Please note that I am a newbie either on all the science behind logics and ontologies. And newbie on protégé as well. I am currently using Protégé 5.6.1. I have an ontology where I model assemblies composed of parts. Thus I have a sort of tree structure, using a Transitive object property called hasPart
. And the inverse property is isPartOf
.
I attach a minimalistic ontology to explain my problem. You can download it here
I have created individuals and asserted properties such as :
assembly_1 hasPart part_01.
part_01 hasPart part_02.
and a more complex example :
assembly_2 hasPart part_10.
assembly_2 hasPart part_20.
assembly_2 hasPart part_30.
part_10 hasPart part_11.
part_30 hasPart part_31.
part_31 hasPart part_32.
Each part has a data property massKg
. Except for part_31
Starting Pellet reasonner, the transitive property behaves properly IMHO. For instance, with assertion and inference, assembly_2 has all parts >= part_10. And part_32 is part of part_31 and part_30 and assembly_2.
But now, that is where I am stucked...
I would like to know, with a SWRL (from my understanding), that a part is a leaf of the assembly tree. I was keen to code something like :
isPartOf(?object, ?parent) ^ not( hasPart(?object, ?noSubPart)) -> isLeaf(?object, true)
That is to say : "an object which is part of a parent object, but has no sub part, is a leaf". Saddly, negation seems not supported on object properties (looking at this FAQ).
How can I do ?
Similar question would be on data properties. For instance, how can I create a SWRL rule base on the condition that the individual has no data property massKg
?
Finally, I would like to create a rule / a way (maybe a SQWRL ? ) to get the total massKg
of an assembly. Either because this is the top most element of the tree. Or (because I will have this case in the future), because the individual is of a given class, and I want the sum of all parts that are part of it.
I am open to proposals. And open to openmindness. Because I am new to OWL and SWRL, and currently have not capitalized a lot. So I am even OK (and I would be happy to have your thoughts) if you propose me other ways to compute rules (forward and backward) and maths on ontologies or knowledge base / triplestores / whatever.
Do not hesitate to propose me websites / articles / books to improve myself.
Thanks in advance. Boris