jena-rules

Ho to achieve Mapping between namespaces in Apache Jena thru Reasoning?

久未见 提交于 2020-01-04 11:13:07
问题 Goal: I wan´t to achieve a rule based Mapping between ontologies in order to fulfill a common task of data migration. Way to achieve the goal: To achieve this i developed a abstract data structure which is capable to store all information provided by the xml representation of any datatype. Then i wrote a parser, which constructs a ontology out of targeted document-type definition. Now when i read the data in it is first associated to the abstractDatatype namespace, lets call it aS . The

Ho to achieve Mapping between namespaces in Apache Jena thru Reasoning?

删除回忆录丶 提交于 2020-01-04 11:12:48
问题 Goal: I wan´t to achieve a rule based Mapping between ontologies in order to fulfill a common task of data migration. Way to achieve the goal: To achieve this i developed a abstract data structure which is capable to store all information provided by the xml representation of any datatype. Then i wrote a parser, which constructs a ontology out of targeted document-type definition. Now when i read the data in it is first associated to the abstractDatatype namespace, lets call it aS . The

Create a library for new built-ins Jena

匆匆过客 提交于 2019-12-25 02:22:14
问题 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? 回答1: Please note that, as this question is extremely broad, my answer is merely a set of suggestions towards an overall design. First, we'll begin with how Jena does it. Apache Jena stores its rule files as classpath resources within its distribution jars. jena-core has a package

How to write Jena rule to query class and get individuals for a property

久未见 提交于 2019-12-25 01:15:00
问题 How to extract all actuators that are switched off when there are no users at home. I tried to write Jena rule but am unable to get proper output. I have added desired result that I want. Need help with writing rule. [rule1: noValue(:users :hasLocation :home) -> (:actuators :hasLocation :home) (:actuators :state "OFF"^^xsd:boolean)] [rule2: noValue(:users :hasLocation :home) -> (?x rdf:type :actuators) (?x :hasLocation :home) (?x :state "OFF"^^xsd:boolean)] { rulex: [noValue(:subject1

printing InfModel earlier changes printed representation later?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 22:33:32
问题 I'm getting a strange effect in Jena 2.5.5 (on Linux) where I am playing around with the inference API. The following code is a stripped down version. I am creating an initially empty Model and a generic rule reasoner. I add a reflexivity rule for a certain statement. I attach the reasoner to the model to get an InfModel. Then I create the matching statement and add it to the Model. Result: InfModel contains both the statement and its reverse. So far so good, that's what it's supposed to do.

Jena Rule for Validation af a Ontology

人走茶凉 提交于 2019-12-23 20:07:05
问题 I want to validate an ontology and throw an error if anything is incorrect. The most validation I have to do looks like this: I have a class like this: <owl:Class rdf:about="&schema;ExampleClass"> <rdfs:subClassOf rdf:resource="&schema;SuperClass"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="&schema;myProperty"/> <owl:onClass rdf:resource="&schema;OtherClass"/> <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality> </owl

Problems with inference examples from Apache Jena framework

孤者浪人 提交于 2019-12-23 02:36:10
问题 I have a serious problem to get any reasoner up and running. Also the examples from the documentation: https://jena.apache.org/documentation/inference/ does not work here. I transferred the example into a unit test, so that the problem might be easier reproduced. Is reasoning limited to certain environment like a spatial JDK or so on, or am i getting something wrong? Thanks Here the example code (as java unit test): import static org.junit.Assert.assertNotNull; import java.io.PrintWriter;

Once I've written a builtin, what do I need to do to make the reasoners aware of it?

五迷三道 提交于 2019-12-17 17:05:57
问题 I have written a custom builtin to use in my Project but I do not really know how I can use it. I have written two classes. In one of them there is the builtin I have made (using BaseBuiltin ) and in the other one I have registered the new builtin (using BuiltinRegistry ). I have already tried to use default builtins, writing rules that use them in a text file readable from Eclipse using Java. In this case I do not have any problems. How can I use the builtin I have built? Should I import (or

Giving array as parameter to a Jena built-in

£可爱£侵袭症+ 提交于 2019-12-14 03:16:58
问题 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 bodyCall of my function : @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { System.out.println("Entra"); checkArgs(length, context); BindingEnvironment env = context.getEnv(); Node n1 = getArg(0, args, context); Node n2 =

No output for rule in Jena using generic rule reasoner

[亡魂溺海] 提交于 2019-12-12 02:56:09
问题 I created an ontology in Protege and imported that ontology in Eclipse using Jena. I have written rules in rule file and want the output of the rules to be displayed in Jena but its not showing output. Program is getting executed without errors. The details of ontology are Thing Children 0-12Months 1-3Years 4-7Years 7-12Years Toys Bikes Building_Blocks Dolls Skates Stuffed_toys Added one datatype property playWith domain children and range Toys whose inverse is playedBy Added four inviduals