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
1
vote
1 answer

How to get Individual name from Node value in Jena RDF Inf Model

I am facing a problem extracting the Individual's name from the Jena Graph (RDF Inference Model with Generic Rule Reasoner and OntSpec is RDFS_MEM_RDFS_INF ). It may be a simple case but I am not able to find proper tutorial online to get this done…
user3747396
  • 141
  • 12
1
vote
2 answers

How to add Jena rule to OntModel

I am trying to add a Jena rule submitted as string to the below method. However the rule is not being added as I can verify no new change on the ontology written to E://1_1_1 Could someone help me how to do this. Other questions on SO that may be…
user3747396
  • 141
  • 12
1
vote
1 answer

Jena TDB after reason then update

I am using Jena and I want to update the new ontology into my tdb. For example. I have 100 rows in my ontology , after I add some rules and run the reasoner, there are 105 rows now. And I need to update these 5 additional rows in my tdb. How can I…
darrelltw
  • 1,734
  • 1
  • 10
  • 21
1
vote
1 answer

Using custom rule in Jena to assign individual to type

Is it possible to add a rule in Jena which defines the type of an individual? For example String r; r = "[rule1: (?a example:drives ?b), (?b rdf:type example:Truck) -> (?a rdf:type example:TruckDriver)]"; //then parse and send to…
Isaac
  • 35
  • 1
  • 9
1
vote
1 answer

Jena Custom Rules using Built-ins

I am currently messing around with Jena trying to create rules to add to my generic reasoner. I created the following simple rule: [rule1: (?x ?rdf:type ?y),(?y rdfs:subClassOf ?z)-> (?x rdfs:type ?z)] This works fine, and fires correctly, giving…
Colin
  • 267
  • 4
  • 11
1
vote
1 answer

rdf reasoning rules via Jena

I want to express this relation: if article X has author Y, and the author has the influenceFactor medium or high(3 classes: low , medium, high) then this article is regarded as highly recommended. (?x computer-science#hasAuthor ?y)(?y…
Sarotti
  • 65
  • 1
  • 3
  • 10
0
votes
0 answers

How to fix custom function class not registered in apache jena fuseki error?

I need a custom filter function in apache-jena-fuseki. I tried adding custom function class name to config.ttl. I added function class files to class path. But it's always throwing error that function is not registered. Can anyone please share a…
0
votes
0 answers

How to write Apache Jena Inference rule for given rdf data?

I am trying to build a Apache Jena reasoner node over the below rdf data instance. I want to write a rule such that the inference api can tell if certain sensor values were out of range. e.g. print statement whose sensor measurement (value of…
Akshay Patel
  • 85
  • 10
0
votes
1 answer

how to replace the VALUES from SPARQL with the Builtin listContains from the general purpose rule engine

In SPARQL, Data can be directly written in a graph pattern or added to a query using VALUES: SELECT ... WHERE { VALUES ?l {"no" "neg"} ?a delph:hasLemma ?l. } In Jena, I found the listContains(?l, ?x) in…
Alexandre Rademaker
  • 2,683
  • 2
  • 19
  • 21
0
votes
1 answer

How to deal with class instances in Jena?

In an ontology, suppose we have a class named "function" it has two instances "func1" and "func2" and suppose that the class has a data property "d". My first problem is: how can I create individuals corresponding to either "func1" or "func2" ? My…
Ihab TALEB
  • 57
  • 1
  • 1
  • 10
0
votes
0 answers

How to add Triples to graph for further query in customed builtin primitives?

i'v tried this code Triple t = NodeFactory.createURI(s,p,o); context.add(t); However, I cannot get this triple using sparql.
0
votes
1 answer

Jena Rule: How to use now(?x) Builtin primitive

Can please someone explain about now(?x) Builtin primitive in jena rule. I need to understand about this but not found resource on internet. Like example etc. Only found information about this from Apache jean website which is that: now(?x):Binds…
Ehsanur
  • 21
  • 5
0
votes
0 answers

Jena: How to update (not added) RDF triple in ontology graph using jena rules

How to update the RDF triple (not added new one) using jena rule. I am using generic rule reasoner and rules are in separate file as shown case 1: @prefix fa: http://www.smarthome_haier.com#. Rule1: (?a fa:setTimer “0”)(?a fa:windvolume…
Ehsanur
  • 21
  • 5
0
votes
1 answer

Does JENA API support OWL 2?

May I know if Apahe JENA supports OWL 2 syntax in Java? It does mentioned that in the documentation (https://jena.apache.org/documentation/ontology/) it only provide limited cardinality restrictions. I would like to confirm this from the experts.
0
votes
1 answer

How to change the rules for inference

I am using Eclipse with Jena framework to develop a Web Application. My application does the following: Register the new users with the information of name, email, interest(C language, Java, etc),Occupation, Username and password. This information…
Archana
  • 237
  • 3
  • 9
  • 17