On 18/04/14 12:52, [email protected] wrote:
Hi, could you help me on a problem i still stuck on ?

[The list doesn't support attachments so none of your images are visible and the formatting makes it really hard to read. Sticking to plain text messages is generally best if you can.]

                 I’ve got an FOAF ontology merged with another one :
photography.

                 People are linked with a “figureOnImage” object
property and I want to infere that they know (FOAF:Knows : object
Property) each other.

                                                1 – question :

                                                                               
With the rules files :

                                                                                            
   @prefix foaf: <http://xmlns.com/foaf/0.1/knows#>.   (or @prefix foaf: 
<http://xmlns.com/foaf/0.1#>.) same

@prefix exif: <http://www.w3.org/2003/12/exif/ns#>.

@prefix photo:
<http://www.photographyontology.org.uk/ontologies/photography/photography.owl#>.

[rule1: (?f photo:figureOnImage ?a) (?g photo:figureOnImage ?a) -> (?f
foaf:knows ?g) (?g foaf:knows ?f)]

                                                                               
Result seems to be correct except that each people knows himself (not wrong ;o) 
 ) but I would understand it with a rule like :

[rule1: (?f photo:figureOnImage ?a) (?g photo:figureOnImage ?a) -> (?f
foaf:knows ?*f*) ]

What’s wrong  with my rules ?

If you don't want the first version of rule1 to mean that people know themselves then you need to add to test to make sure ?f and ?g aren't the same:

 [rule1:
   (?f photo:figureOnImage ?a)
   (?g photo:figureOnImage ?a)
   notEqual(?f, ?g)
 ->
  (?f foaf:knows ?g) (?g foaf:knows ?f)]


                                                2 – question :  I try to
link two persons with an “FOAF:knows” object property and not with an
annotation. How can I infer and use object properties ?

Don't understand the question. What do you mean by "annotation" here? Your rule has asserted some foaf:knows triples, foaf:knows is an object property, so you have inferred some object properties. What else is there?

From the point of view of RDF and generic RDF rules there's just triples and it makes no difference whether the property in a triple is a owl:DatatypeProperty, owl:ObjectProperty, owl:AnnotationProperty, rdf:Property or just some resource whose type you don't know.

Dave

Reply via email to