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
2
votes
1 answer

Backward chaining Jena reasoner

I have been reading through the Jena documentation in order to try and create a simple pure backward chaining reasoner. I have a simple backward chaining rule that I am applying to a small ontology. I was wondering if there was anyway to do backward…
Colin
  • 267
  • 4
  • 11
2
votes
2 answers

Any way to inference with Jena without load all data into memory?

I have a great deal of RDF data to be inferred, and I need to develop my own inference rules. My question is that whether there is any method to do this? Is it ok to use Jena rule and SPARQL to do so? Do the Jena rule and sparql query have to…
Wang Ruiqi
  • 804
  • 6
  • 19
1
vote
0 answers

How do I create my own rules in Jena Fuseki from string content?

I am trying to create my own property rules in Jena Fuseki. To do so I am using the Generic Rule Reasoning that allows me to use my own rules. When I use this strategy with my rules from a file everything works fine: :model_inf a ja:InfModel ; …
Marcelo Machado
  • 1,179
  • 2
  • 13
  • 33
1
vote
0 answers

How to populating RDF data from RDBMS-based system

I am new to semantic-web and ontology. From few weeks ago I am start reading papers and online course about it. I have an idea to use ontology rule-based system for extending the feature on my existing reminder system, as can be seen in the…
MDGS
  • 11
  • 3
1
vote
1 answer

"For all" using Apache Jenas rule engine

I'm currently working on some small examples about Apache Jena. What I want to show is universal quantification. Let's say I have balls that each have a different color. These balls are stored within boxes. I now want to determine whether these…
zerqo
  • 11
  • 1
1
vote
1 answer

Use OCL for validation

I have a RDF dataset and a some OCL files which discribe the expected shape of the data. Is there a way verify the data with the OCL files with Jena?
1
vote
1 answer

Jena list statements with print builtin rule

I am trying to learn how Jena and GenericRuleReasoner works. I took this from Apache Jena tutorial. [transitiveRule: (?A demo:p ?B), (?B demo:p ?C) -> (?A > demo:p ?C) ] [symmetricRule: (?Y demo:p ?X) -> (?X demo:p ?Y) ] If I want to add another…
1
vote
0 answers

In Jena rules, how to select a literal according to the sorting of a specific property

For instance, I got all cat instance by (?c rdf:type eg:cat) firstly. So, how to get the oldest cat according to the property :has_age? Thank you!
yangz
  • 53
  • 5
1
vote
0 answers

How to auto generate RDF based inference rules in Jena?

Inference rules can apply on n3 dataset in Jena using rule file. these rules are user defined. What if we want to auto generate these rules using machine learning technique or else?
1
vote
1 answer

Why this exception occur com.hp.hpl.jena.reasoner.rulesys.Rule$ParserException: In Using Apache Jena Reasoner?

Here is my code: public class FunctionalityCheckTest1 { InfModel infModel; Model model = ModelFactory.createDefaultModel(); String NS = "http://myweb.com/vocab#"; @Test public void playingWithJenaReasoner() { …
Badman
  • 407
  • 5
  • 17
1
vote
1 answer

Check if property is defined in jena rules

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…
David Fernández
  • 494
  • 1
  • 6
  • 22
1
vote
1 answer

Jena API Rules Test : how many and what are the methods to write rules in Jena?

I succeeded in creating, modifying, merging ontologies with Jena API and Eclipse. I succeeded also in starting the OWL reasoner and Pellet reasoner in Eclipse. Now I would like to understand how can I write a simple rule in Eclipse using Jena API…
KeyPi
  • 516
  • 5
  • 20
1
vote
1 answer

Specifying class equivalence in Jena rules

Given an ontology with Class A and Class B I am stating a rule: [-> (ns:Class_A owl:equivalentClass ns:Class_B)] However the Jena generic rule reasoner is only applying the tag equivalentClass to Class A, i. e. it is not stating Class B…
Batman22
  • 376
  • 4
  • 25
1
vote
1 answer

semantic web rule use "all"

Assume that I have the following statements: A p B, A p C, B p C ( p is a symmetric property, i.e. B p A, C p A and C p B) A v 2, B v 1, C v 1, I want to use a rule to do something like: ?a p all(?b) if ?b v 1 than ?a q 'Yes' that means that you…
1
vote
1 answer

Writing a Jena rule to add properties to a resource with some specific property values?

I'm trying to write a Jena rule whose antecedent matches a location where the network's bandwith is 450^^xsd:float. I've tried the following two rules. The first gives me no results. The second matches for the networks labeled Gate 23 and Gate…
Fatma Fatma
  • 63
  • 1
  • 6