0

I have a question. I have a Jena rule like this:

[rule1:

(?if rdf:type p:InferredConfiguration)
(?if p:userName ?userEmail)
(?subProfile rdf:type u:PersonSubProfile)
(?subProfile u:hasUsername ?email)
equal(?userEmail, ?email)

(?subProfile u:hasName "")
(?subProfile u:hasLastname "")
(?subProfile u:hasPhone "")
(?subProfile u:hasEducation "Low")
->
(?subProfile u:hasPhone "00000")

print('**************** Phone defined - Rule 1 ***************')
]

The problem is that the rule above does not update the value of "hasPhone" property, but it adds one more value. How can I update the value or remove the old one and add the new one?

Thank you.

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
A.Sim
  • 91
  • 1
  • 10

1 Answers1

1

I found solution

[rule1:

(?if rdf:type p:InferredConfiguration)
(?if p:userName ?userEmail)
(?subProfile rdf:type u:PersonSubProfile)
(?subProfile u:hasUsername ?email)
equal(?userEmail, ?email)

(?subProfile u:hasName "")
(?subProfile u:hasLastname "")
(?subProfile u:hasPhone ?var)
equal (?var, "")
(?subProfile u:hasEducation "Low")
  ->
drop(7)
(?subProfile u:hasPhone "00000")

print('**************** Phone defined - Rule 1 ***************')
]
A.Sim
  • 91
  • 1
  • 10