1

I have developed an ontology and I want to add the following SWRL in protege:

Divider_intersection(?node), is_extent_of(?node, ?s), builds(?s, ?l),Segment(?s),Lane(?l),detailed_partition(?d), builds(?l, ?d)-> is_divided_at(?d, ?node)

with this I wish to add an object property, is_divided_at, between an individual from detailed_partition (?d) and a node that is classified as a divider_intersection if it is the extent of a segment (?s) that build a lane (?l) which then build the detailed?partition (?d). As noted here, I am looking for NamedIndividuals, hence I presume the SWRL should do the job.

Further research, I found Rolification (1, 2, 3) as a possible answer however I have never used it before, but I made the following chain:

r_Divider_intersection o is_extent_of o r_Segment o builds o r_Lane o builds o r_detailed_partition

still I do not get the answer. Any idea what is wrong?

Community
  • 1
  • 1
msc87
  • 943
  • 3
  • 17
  • 39
  • We can't see your ontology, and offsite links don't help much (e.g., they might expire). Can you post the ontology here please? – Joshua Taylor Jul 21 '15 at 14:06
  • 1
    That said, the property chain and SWRL rule look correct. There's probably some minor bug somewhere, but it looks like you've got the right approach, if you want to use rolification instead of a SWRL rule. – Joshua Taylor Jul 21 '15 at 14:07
  • 1
    by the way, since the chain starts with the node and ends with the detailed partition, shouldn't the conclusion be `is_divided_at(?node,?d)` (i.e., with ?node and ?d in the other order)? – Joshua Taylor Jul 21 '15 at 14:09
  • you are right... so If I want to change the order of args in my is_divided_at, I should inverse all the relations, right? – msc87 Jul 21 '15 at 15:05
  • You could do that, but if you don't want to do that, you could just add a new object property **dividesAt**, assert that it's the inverse of **isDividedAt**, and then make the subproperty chain axiom using **dividesAt**. – Joshua Taylor Jul 21 '15 at 15:32
  • @JoshuaTaylor: I tried to copy and past my ontology here but it is not possible as it is so big. how can I use onsite links to deliver my ontology to you? – msc87 Jul 21 '15 at 16:03
  • 1
    You shouldn't need a big ontology in order to illustrate the problem that you're having. You need to create a minimal example that demonstrates the problem. I know that it is possible in this case, as I pretty much did it in my answer. Post a minimal ontology that has just the parts you need to illustrate the problem. You might find [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) helpful. – Joshua Taylor Jul 21 '15 at 16:17

1 Answers1

1

Your approach works, and without seeing your ontology (your link requires permissions, and offsite links aren't very helpful anyhow) we can't see why your particular construction of it works. One thing that jumps out from your question is that the it looks like your is_divided_at property has its arguments (?d,?node) in the opposite order from what the property chain axiom would produce. Anyhow, here's a working example.

screenshot in protege

@prefix :      <urn:ex:#> .
@prefix ex:    <urn:ex:#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .

ex:isDividedAt  a               owl:ObjectProperty ;
        owl:propertyChainAxiom  ( ex:_DividerIntersection ex:isExtentOf ex:_Segment ex:builds ex:_Lane ex:builds ex:_DetailedPartition ) .

ex:Segment  a                owl:Class ;
        owl:equivalentClass  [ a               owl:Restriction ;
                               owl:hasSelf     true ;
                               owl:onProperty  ex:_Segment
                             ] .

ex:_DetailedPartition
        a       owl:ObjectProperty .

ex:DividerIntersection
        a                    owl:Class ;
        owl:equivalentClass  [ a               owl:Restriction ;
                               owl:hasSelf     true ;
                               owl:onProperty  ex:_DividerIntersection
                             ] .

ex:_Segment  a  owl:ObjectProperty .

ex:_Lane  a     owl:ObjectProperty .

ex:builds  a    owl:ObjectProperty .

ex:dividerIntersection0
        a              owl:NamedIndividual , ex:DividerIntersection ;
        ex:isExtentOf  ex:segment0 .

<urn:ex:>  a    owl:Ontology .

ex:detailedPartition0
        a       owl:NamedIndividual , ex:DetailedPartition .

ex:_DividerIntersection
        a       owl:ObjectProperty .

ex:segment0  a     owl:NamedIndividual , ex:Segment ;
        ex:builds  ex:lane0 .

ex:DetailedPartition  a      owl:Class ;
        owl:equivalentClass  [ a               owl:Restriction ;
                               owl:hasSelf     true ;
                               owl:onProperty  ex:_DetailedPartition
                             ] .

ex:isExtentOf  a  owl:ObjectProperty .

ex:lane0  a        owl:NamedIndividual , ex:Lane ;
        ex:builds  ex:detailedPartition0 .

ex:Lane  a                   owl:Class ;
        owl:equivalentClass  [ a               owl:Restriction ;
                               owl:hasSelf     true ;
                               owl:onProperty  ex:_Lane
                             ] .
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • I should add something here that the divider_intersection is also inferred. I actually need to know if a node is inferred to be a divider then the detailed_part is_divided_at that node. And to infer that the node needs to be the extend of a segment that builds a lane which then build that detailed_part :D... I think thats what makes it a bit complex for me – msc87 Jul 21 '15 at 15:53
  • 1
    I'm not sure what you mean. The inferences will still work even if something is *inferred* to be a DividerIntersection rather than being directly asserted to be one. – Joshua Taylor Jul 21 '15 at 16:15
  • Thank you so much Joshua Taylor you have been a great help to me. It works now. May I ask you something? I am a PhD student too, in Sweden, and recently started working with ontology in the field of spatial data, I am hoping maybe we can collaborate more. – msc87 Jul 21 '15 at 17:16