1

In apache jena (using rules), how do I print when finding an instance that does not have a specified object property (in a single rule)?

Example (print people without a job):

[ruleNoJob: (?p rdf:type :Person) ... -> print(?p, 'does not have a job')]

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
David Fernández
  • 494
  • 1
  • 6
  • 22

1 Answers1

1

You can use "noValue". Example code below:

[ruleNoJob: (?p rdf:type :Person), noValue(?p aa:job) -> print(?p, 'does not have a job')]
JamieA
  • 1,984
  • 4
  • 27
  • 38
Flekyy
  • 26
  • 1
  • Exactly what I needed. I kept skimming through the list of Jena built-ins and completely missed the `noValue(...)` for some reason. Thanks. – Robin Keskisarkka Mar 22 '17 at 10:52