1

Most of inference engine support SWRL which allows user to add their own inference rules. However, In my context those users rules can require inferencing a blank nodes in the consequence side of the rule.

Jena provides makeTemp a builtin method to do the work see details here.

Here is an example :

[r1: (?e1 st:runningTask st:gic_eth0), makeTemp(?p)
 ->
 (?p rdf:type st:dataFromEthernet2IP) ]

My question is:

Does SWRL supports blank nodes inferencing in the consequence side of a rules ? The SWRL w3c says nothing about this particular situation.

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
Fopa Léon Constantin
  • 11,863
  • 8
  • 48
  • 82

1 Answers1

1

The variables in SWRL rules take on values that are OWL individuals and RDF literals. A blank node cannot be an RDF literal, although a blank node could be an unnamed OWL individual. (I'm not sure whether SWRL will work with unnamed but declared individuals; it won't work with individuals that aren't declared (e.g., individuals whose existence can be inferred, but which don't actually have a declared representation.) In any case, SWRL variables won't be bound to just any arbitrary blank nodes.

The important insight here is that Jena rules work on RDF, which has a concept of URI node, blank nodes, and literals. SWRL rules work on OWL constructions. You don't actually need RDF in order to do OWL reasoning, and you can do SWRL reasoning without any underlying RDF representation. So if you're using SWRL, you shouldn't have to think about whether something is a blank node or not; OWL doesn't have blank nodes; blank nodes are an RDF construction.

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • @ Joshua Taylor, why do you think that a blank node cannot be an RDF literal (I'm not sure I understand you correctly)? Sorry for commenting more than two years old post. – Stanislav Kralin Jul 17 '17 at 08:16
  • @stanislav it's not a matter of whether a black mode "can be"a literal or not. RDF has three types of resources: IRIs, literals, and blank nodes. They're different kinds of things. See, e.g., https://www.w3.org/TR/2014/NOTE-rdf11-primer-20140624/#section-data-model. – Joshua Taylor Jul 17 '17 at 11:30
  • But SWRL is for writing rules about OWL, not (directly) RDF. Since an OWL ontology can be serialized in EFF, out may turn out that rules have an effect on some OWL constructs that get serialized in RDF in a particular way. But what's important here is that SWRL rules (as far as I remember; this is an old post) don't give you a way to create OWL individuals, and it's only OWL individuals that could be serialized as RDF blank nodes, so you can't create an RDF blank mode by using SWRL rules. – Joshua Taylor Jul 17 '17 at 11:35