Questions tagged [jena-rules]

Jena rules is Java-based framework for building Semantic Web applications. An environment for RDF, RDFS and OWL, SPARQL and includes a rule-based inference engine. Three kind of rules (according with their execution model): forward rules, backward rules and hybrid rules.

Jena Rules provides three mechanism of rule execution:

  1. Backward Chaining Rules - are identified by using <-. These rules are interpreted as queries and the rule head (the conclusion part) contains a single atom which cannot be a built-in. The body (the condition part) is a conjunction between one or more triple patterns and/or built-ins.

  2. Forward Chaining Rules - are identified by using ->. They are executed by a forward engine and both the head and body may contain of conjunction of atoms.

  3. Hybrid Rules - consists in using one or more backward chaining rules in the head of a forward chaining rule.

Official documentation.

80 questions
0
votes
1 answer

Jena GenericRuleReasoner

What happens if we put a variable in the head of a GenericRuleReasoner, which does not appear in the body of the rule? For instance if we have the following rule : rule1: (?x rdf:type :Person) -> (?y :father ?x) The rule says that every person has…
riad
  • 361
  • 1
  • 9
  • 19
0
votes
0 answers

Create function and call it from Jena Rule

I have created a function that perform some calculations between nodes. I would like to call this function from Jena rule? Is this possible? I found that built-in function can be called from jena rule, but I would like to call my own function. How…
0
votes
2 answers

Using Jena Rules File on inferred model to create a validator for an ontology

What I want to do: Create a validator for an ontology in Java. For this I want to use Jena Rules on a inferred model. Unfortunately I can't use both the standard reasoner (ReasonerRegistry.getOWLReasoner()) and after this my own reasoner (new…
msc
  • 43
  • 7
0
votes
0 answers

How to add Datalog rules to Pellet reasoner in Jena?

I've multiple personal inference rules in Datalog Form. I can extend Jena GenericRuleReasoner in order to take them into account during the inference step. Here is an example of code to do that : String rules = "[r1: (?e1 st:runningTask…
Fopa Léon Constantin
  • 11,863
  • 8
  • 48
  • 82
0
votes
0 answers

Jena rules: test a literal property to string

i am working about inferences on Jena. I would test that a property is a particular string. I have an ontology about servers, an individuals like this:
0
votes
1 answer

How to use blank node in Datalog rules for GenericRuleReasoner?

I'm using GenericRuleReasoner to infer virtual fact in my ontology. GenericRuleReasoner takes inference rules as Datalog rule in input as explain in jena inference support. here is an example of a DatalogRule attached to a generic reasoner : String…
Fopa Léon Constantin
  • 11,863
  • 8
  • 48
  • 82
0
votes
1 answer

How to write the result of a rule, into a model (in Jena)?

I am working on a project where I need to create some rules using the Jena freamwork. I have created the rules and they work as they should. I can see the output on the screen but what I would like to do is storing the result into the model of…
user3563844
  • 113
  • 1
  • 8
0
votes
1 answer

Recording derivations of previously asserted triples in Jena's rule reasoners?

I created a Jena Rule Reasoner as in the documentation final String rules = "[rule1: (?a urn:eg:p ?b) (?b urn:eg:p ?c) -> (?a urn:eg:p ?c)]"; final Reasoner reasoner = new…
riad
  • 361
  • 1
  • 9
  • 19
0
votes
1 answer

Create a library for new built-ins Jena

I have made some new built-ins for Jena. I would like to create a library where I can put all of them. How can I do that ? And how can I create my rules in this case ? Need I to import some files in the rule file?
user3563844
  • 113
  • 1
  • 8
0
votes
1 answer

Giving array as parameter to a Jena built-in

I need to create a new built-in for Jena. With this one I would like to be able to extract the minimum date from where it is. I just wondering if it is possible to give a class of datas to a built-in instead of just one parameter. Here is the…
user3563844
  • 113
  • 1
  • 8
0
votes
1 answer

Custom builtin in Jena

This is the code I have written but the new built-in does not seem to work. I get the error: Exception in thread "main" com.hp.hpl.jena.reasoner.rulesys.impl.LPRuleSyntaxException: Syntax error in backward rule: matematica Unknown builtin operation…
user3563844
  • 113
  • 1
  • 8
0
votes
1 answer

Jena's builtins primitives?

I have a question about the some built-in primitives. Is possible to use the built-ins: difference, min, max, sum also for DateTime types or it is better to create custom built-ins for this purpose? They work fine with integer and float but it…
user3563844
  • 113
  • 1
  • 8
0
votes
1 answer

What's mean 'fb' and 'b' in Jena rules //OWL, RDFS

There is a Jena rules I don't know prefix b and fb. What different things each OWL and RDFS files? PS. download URL is https://jena.apache.org/download/index.cgi and click jena-2.11.1-source-release.zip (MD5, PGP) rules dir ->…
isaac Lee
  • 111
  • 5
0
votes
0 answers

Jena reasoning: dynamically adding new resources in the conclusion

From what I have seen so far, all Jena reasoning rules are in the form below : [hirarchyExpansion: (?x dbo:isPartOf ?loc) (?loc dbo:isPartOf ?highloc) -> (?x dbo:isPartOf ?highloc) ] This implies that no new resource can be added in the conclusion.…
0
votes
1 answer

What kind of reasoner is produced by GenericRuleReasonerFactory?

I have designed some rules and am wondering what the reasoner is is returned by the Jena's GenericRuleReasonerFactory (as shown in the following code)? Is it Racer, Pellet, or HermiT? Reasoner reasoner =…