Re: SPARQL vs Jena rules

2017-08-31 Thread tina sani
There is also something called SPIN (SPARQL Inferencing Notation). Can we
use it as the best possible alternative of Jena rules?

On Thu, Aug 31, 2017 at 10:48 AM, Dave Reynolds 
wrote:

> On 30/08/17 15:10, baran...@gmail.com wrote:
>
> PS: I wonder why Dave doesn't comment in this thread. Perhaps because he
>> thinks, Lorenz is ok, i myself cannot stand the low-level-knowledge of the
>> users in this thread or no matter what you do, by some heavy data-input an
>> app with InfModel would hang anyway? Lorenz is ofcourse ok, but i 'guess'
>> Jena users are also very curious about Dave's comments...
>>
>
> I didn't comment on this thread because, as Andy has already pointed out,
> this seems to be a repeat of a recent similar thread (on which I did
> comment). That in turn was a near repeat of another similar thread. All
> from the same group.
>
> Also I think Lorenz has covered it all, with admirable patience.
>
> However, in an attempt to clarify the trade-offs in more depth maybe the
> following would be helpful:
>
> When comparing a rule system against a set of SPARQL Update queries there
> are several factors that affect the trade-offs including (1) the specific
> nature of the rules/queries, (2) the data flow and, (3) preferences on
> syntax and machinery.
>
> 1a. For a single (forward) Jena rule then you can always achieve the same
> with a SPARQL Update. For a single set of input data then SPARQL has the
> benefit of being a standard [1] and offering better performance over a
> store like TDB. Conversely SPARQL is much richer than Jena rules so there
> are things that you could achieve with a single SPARQL Update query using,
> say, property paths that would require multiple Jena rules.
>
> 1b. If you have a set of rules, but they don't create loops/recursion,
> then you can "stratify" them into groups of rules than can be run one after
> the other. In that case, for a single set of input data, then again you can
> implement it as a sequence of SPARQL Updates with similar benefits.
>
> 1c. If your rules can't be stratified, i.e. one rule can indirectly
> trigger itself, then it's more complex. In that case you would have to e.g.
> run the set of SPARQL Updates repeatedly until nothing new is deduced.
> Depending on the specifics of the rules and the data that may be quite
> expensive and you would be better off with something Jena rules. However,
> in some cases you may be able to use things like SPARQL property paths to
> achieve the desired effect without have to recurse.
>
> 2. If you have a single data set and just want to run your rules on it
> then the above applies. If you are repeatedly adding new data and want to
> keep your deductions up to date then the Jena forward rules engine has the
> advantage that it keeps all the partial matches around. So addition of one
> more triple may cause a rule to fire without it having to search for all
> the other triples in the body. This is also why "recursive" rules work
> relatively efficiently.
>
> This doesn't apply if you delete data. In that case Jena rules have to
> start over and can't reuse state across data deletions.
>
> If you keeping changing your data but very rarely ask questions of it, and
> then only limited questions, then Jena back rules have advantages. The
> backward engine will only run the rules needed for the specific query. If
> that's a lot fewer than the overall rules then that should be cheaper than
> running a full forward deduction using SPARQL Updates. In this situation it
> may be possible to achieve the same effects through SPARQL query (not
> update) by query rewriting but that's a whole different ball game.
>
> 3. With Jena rules you have some prebuilt machinery for running the rules
> (InfGraphs and all that) and some support for externalizing the rules in
> separate files. With SPARQL you have to create all that (though it's easy)
> and you have a nicer syntax.
>
> So fundamentally, like all "X vs Y" questions it depends on the specifics
> of what you are trying to do.
>
> Dave
>
> [1] There is a standard for rules, RIF, but it is not aimed at
> particularly RDF processing and post-dates Jena rules.
>


Re: SPARQL vs Jena rules

2017-08-25 Thread tina sani
Hello Lorenz, thank you for your detailed response.

 I know Construct query can not be the alternative of Jena rules, may be
not better than it either. But SPARQL is W3C recommended and provide
disjunction in shape of UNION which Jena rules dont. . Also, we can delete
new knowledge inferred using SPARQL which we cant using Jena rules, due to
its monotonic nature.

In my previous project, rules created problem for me ( and for some of my
mates) when the rules fired and generated new triples but I was unable to
delete it again because rules are monotonic.

Currently, I am on a project to study how much "inference " we can get via
CONSTRUCT query, if we dont use rules or make its use limited .

On Fri, Aug 25, 2017 at 5:35 PM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

>
>
>
> >  how to get inference
> > (as Jena rule do) from CONSTRUCT query
> You should really start to understand how a rule engine works. (By the
> way, Apache Jena uses the RETE engine as core).
> And then, let me ask you some questions:
>
> * how are multiple rules processed?
> * what happens if one rule r1 "depends on" another rule r2, i.e. r2
> produces some triples that are used by r1?
> * what happens if there are cyclic dependencies?
>
> Once you answered those questions, think about how a single SPARQL query
> can resp. should solve this problem?
> > and why the inference of CONSTRUCT
> > is better than Jena rules.
> How do you come to this conclusion? Or why do you think so? Did somebody
> tell you this? You should start with the comparison of the
> expressiveness of SPARQL vs. a rule engine - by the way, Apache Jena
> rules is not a standardized rule language.
> What about recursion in rules? For example, SPARQL 1.0 can be translated
> from/to nonrecursive Datalog with negation.
>
> Again, why do you compare those two Jena mechanisms? What is the
> expected outcome?
> >
> > On Fri, Aug 25, 2017 at 12:52 PM, Lorenz Buehmann <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> You should try to talk to and collaborate with your team members, Javed
> >> Khan and Sidrah Shah...
> >>
> >> Next, you're comparing a query language with a rule engine - those are
> >> obviously different things  (although you can do some things also in
> >> SPARQL that you can do with Jena rules.)
> >>
> >> Regarding performance, there is no answer. Obviously in Jena both is
> >> executed in Java probably using some shared Jena core functionalities.
> >> Nevertheless, there is no need for comparison.
> >>
> >> The question that comes up here in the mailing list - why are you still
> >> asking those basic questions? What is the task of the project? I
> >> remember that you used Jena rules all the time - now you're think about
> >> using SPARQL? Why? Inferencing and querying are totally different
> >> things. So why are you thinking about refactoring the whole project? How
> >> much time do you need for this academic project? I mean, it sounds like
> >> you're working on it for almost one year now? Is this really necessary
> >> and useful to spend so much time on it?
> >>
> >>
> >> Lorenz
> >>
> >>
> >> On 24.08.2017 13:25, tina sani wrote:
> >>> Andy, I need some points in which SPARQL query can be better than rules
> >> to
> >>> get the desired result?
> >>>
> >>> Is it fast (in terms of time) than jena rules to be executed by the
> >> engine?
> >>> Second, in terms of expressiveness, how SPARQL is better than the
> rules?
> >>> One point I think is jena rules does not support dis-junction while
> >> SPARQL
> >>> does (UNION). ,
> >>>
> >>> On Thu, Aug 24, 2017 at 2:07 PM, Andy Seaborne <a...@apache.org>
> wrote:
> >>>
> >>>> This has been asked before, most recently 2017-08-14.
> >>>>
> >>>> https://lists.apache.org/thread.html/ae4c1f5dfbacfb9bf4294a4
> >>>> cf2967e0c7050c81b20f80e6c425a9aa8@%3Cusers.jena.apache.org%3E
> >>>>
> >>>> Please search the archives before asking questions.
> >>>>
> >>>> Andy
> >>>>
> >>>> On 24/08/17 08:50, tina sani wrote:
> >>>>
> >>>>> What are some of advantages of SPARQL over (Jena) rules? I know only
> >> that
> >>>>> SPARQL is W3C recommendation and jena rules are not. Similarly, Jena
> >> rules
> >>>>> are monotonic which does not add/remove any data just infer new
> >> knowledge.
> >>>>> How SPARQL is more expressive than rules?
> >>>>>
> >>>>> If we get some inference using SPARQL, how it differs (better) than
> >>>>> inference using rules.
> >>>>>
> >>>>> <https://www.avast.com/sig-email?utm_medium=email_source
> >>>>> =link_campaign=sig-email_content=webmail_term=icon>
> >>>>> Virus-free.
> >>>>> www.avast.com
> >>>>> <https://www.avast.com/sig-email?utm_medium=email_source
> >>>>> =link_campaign=sig-email_content=webmail_term=link>
> >>>>> <#m_-5991634784996563873_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >>>>>
> >>>>>
> >>
>
>


Re: SPARQL vs Jena rules

2017-08-25 Thread tina sani
Thank you Lorenz.

We are working on different small projects. Currently, how to get inference
(as Jena rule do) from CONSTRUCT query and why the inference of CONSTRUCT
is better than Jena rules.

On Fri, Aug 25, 2017 at 12:52 PM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> You should try to talk to and collaborate with your team members, Javed
> Khan and Sidrah Shah...
>
> Next, you're comparing a query language with a rule engine - those are
> obviously different things  (although you can do some things also in
> SPARQL that you can do with Jena rules.)
>
> Regarding performance, there is no answer. Obviously in Jena both is
> executed in Java probably using some shared Jena core functionalities.
> Nevertheless, there is no need for comparison.
>
> The question that comes up here in the mailing list - why are you still
> asking those basic questions? What is the task of the project? I
> remember that you used Jena rules all the time - now you're think about
> using SPARQL? Why? Inferencing and querying are totally different
> things. So why are you thinking about refactoring the whole project? How
> much time do you need for this academic project? I mean, it sounds like
> you're working on it for almost one year now? Is this really necessary
> and useful to spend so much time on it?
>
>
> Lorenz
>
>
> On 24.08.2017 13:25, tina sani wrote:
> > Andy, I need some points in which SPARQL query can be better than rules
> to
> > get the desired result?
> >
> > Is it fast (in terms of time) than jena rules to be executed by the
> engine?
> > Second, in terms of expressiveness, how SPARQL is better than the rules?
> > One point I think is jena rules does not support dis-junction while
> SPARQL
> > does (UNION). ,
> >
> > On Thu, Aug 24, 2017 at 2:07 PM, Andy Seaborne <a...@apache.org> wrote:
> >
> >> This has been asked before, most recently 2017-08-14.
> >>
> >> https://lists.apache.org/thread.html/ae4c1f5dfbacfb9bf4294a4
> >> cf2967e0c7050c81b20f80e6c425a9aa8@%3Cusers.jena.apache.org%3E
> >>
> >> Please search the archives before asking questions.
> >>
> >> Andy
> >>
> >> On 24/08/17 08:50, tina sani wrote:
> >>
> >>> What are some of advantages of SPARQL over (Jena) rules? I know only
> that
> >>> SPARQL is W3C recommendation and jena rules are not. Similarly, Jena
> rules
> >>> are monotonic which does not add/remove any data just infer new
> knowledge.
> >>> How SPARQL is more expressive than rules?
> >>>
> >>> If we get some inference using SPARQL, how it differs (better) than
> >>> inference using rules.
> >>>
> >>> <https://www.avast.com/sig-email?utm_medium=email_source
> >>> =link_campaign=sig-email_content=webmail_term=icon>
> >>> Virus-free.
> >>> www.avast.com
> >>> <https://www.avast.com/sig-email?utm_medium=email_source
> >>> =link_campaign=sig-email_content=webmail_term=link>
> >>> <#m_-5991634784996563873_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >>>
> >>>
>
>


SPARQL vs Jena rules

2017-08-24 Thread tina sani
What are some of advantages of SPARQL over (Jena) rules? I know only that
SPARQL is W3C recommendation and jena rules are not. Similarly, Jena rules
are monotonic which does not add/remove any data just infer new knowledge.
How SPARQL is more expressive than rules?

If we get some inference using SPARQL, how it differs (better) than
inference using rules.


Virus-free.
www.avast.com

<#m_-5991634784996563873_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


Re: SWRL vs Jena rules

2017-07-15 Thread tina sani
Many thanks Lorenz

On Sat, Jul 15, 2017 at 8:09 AM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> By using a reasoner that supports SWRL? Pellet and HermiT support (parts
> of) SWRL. And for Pellet there is a Jena implementation. Thus, you
> should use the Pellet reasoner in Jena. Otherwise, you have to use the
> OWL API.
>
>
> On 14.07.2017 23:00, tina sani wrote:
> > I still did not get can that we use SWRL using Jena API? The inference we
> > use in SWRL will be in our Ontology so how can we use it in our
> application?
> >
> > On Fri, Jul 14, 2017 at 7:10 PM, tina sani <tinamadri...@gmail.com>
> wrote:
> >
> >> It means SWRL is better than Jena rules. I like this "no non-monotonic
> >> inference" because some time Jena rules makes problems when it does nor
> >> replace data over other.
> >>
> >> On Fri, Jul 14, 2017 at 5:09 PM, Lorenz Buehmann
> <buehm...@informatik.uni-
> >> leipzig.de> wrote:
> >>
> >>> Are you sure that you can achieve the same?
> >>>
> >>>
> >>> some points regarding SWRL:
> >>>
> >>> * W3C recommendation
> >>>
> >>> * OWL-based rule language, i.e. rules are part of the OWL ontology in
> >>> forms of OWL axioms
> >>>
> >>> * Open World Assumption
> >>>
> >>> * built on the same description logic foundation as OWL
> >>>
> >>> * deductive reasoning
> >>>
> >>> * reasoning in SWRL is undecidable (thus, most reasoner limit the
> >>> supported SWRL features to remain decidability)
> >>>
> >>> * no negation as failure
> >>>
> >>> * similar to OWL no non-monotonic inference
> >>>
> >>> * no disjunction of atoms
> >>>
> >>>
> >>>
> >>>
> >>> On 14.07.2017 13:02, tina sani wrote:
> >>>> Usually we achieve the same result with Jena rules we achieve using
> SWRL
> >>>> rules. So is there any advantage of using one on another? Second, can
> we
> >>>> use both SWRL rules along side the Jena rules in our Semantic web
> >>>> application(s)?
> >>>>
> >>>
>
>


Re: Construct query

2017-06-26 Thread tina sani
Hello Lorenz, I have read these plus some other too. I read the following
query but already we have Steve Jobs nationality on DBpedia, why we needed
Construct query here. We could easily get this data using Select:
dbr:Steve_Jobs dbp:nationality ?nationality

Why we need Construct query here.

CONSTRUCT {
 <
http://dbpedia.org/property/nationality> ?nationality.
}
WHERE{
 <
http://dbpedia.org/property/nationality> ?nationality.



On Sun, Jun 25, 2017 at 2:36 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> As always, read the SPARQL 1.1 documentation [1]
>
> And to answer it, it generates exactly the data that you define in the
> first part of the CONSTRUCT query such that if there are variables those
> are bound in the WHERE part.
>
> [1] https://www.w3.org/TR/sparql11-query/#construct
> > Hi
> >
> > How a SPARQL construct query works? How it generate data which is not
> > existed in our ontologies? Is it just create the instances of classes
> which
> > does not exist?
> >
> > A simple example will be appreciated as I am reading literature about it
> > from past few days but could not understand how exactly it works.
> >
> > Warm regards
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Construct query

2017-06-24 Thread tina sani
Hi

How a SPARQL construct query works? How it generate data which is not
existed in our ontologies? Is it just create the instances of classes which
does not exist?

A simple example will be appreciated as I am reading literature about it
from past few days but could not understand how exactly it works.

Warm regards


Web 3 vs Web 2

2017-06-04 Thread tina sani
Greetings

I want to ask how Semantic Web provides meaning to our data? How it differs
from the current web.
I will appreciate if some one provide with a simple examples: If we write
an Ontology and develop Semantic Web application, how it differs from a
simple Java application (without Semantic Web) and a traditional database
system?


Nested SPARQL query

2017-05-09 Thread tina sani
In which which situation one should use nested SPARQL queries? I mean, how
we could know in this situation we should use SPARQL queries?


Re: How to put one model in another

2017-05-01 Thread tina sani
Hi Lorenz "I think I already told you that the rule engine is monotonic,
i.e. no data will be removed or changed but only new data will be added
if the data matches a premise of a rule."

I think you told me that the problem can be solved if we put the model into
another model or something like this?

On Mon, May 1, 2017 at 10:47 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
> > Hi Dave, if we have a rule like
> >
> > if Person publications less than 10, Person is JuniorResearcher
> > if Person publications greater than 10, Person is SeniorResearcher
> >
> > If person publication is first less than 10, rules will assign him to
> > JuniorResearcher class but when it exceeds 10, becomes SeniorResearcher
> but
> > the JuniorResearcher also be there as rules does not replace the existed
> > value with new one.
> >
> > This was my query if we put the inferred model to a new model, will the
> > rules then be able to replace the previous data?
>
> No no no, I think I already told you that the rule engine is monotonic,
> i.e. no data will be removed or changed but only new data will be added
> if the data matches a premise of a rule.
> Anything else has to be done by yourself in the application code.
> >
> >
> > On Sun, Apr 30, 2017 at 4:38 PM, Dave Reynolds <
> dave.e.reyno...@gmail.com>
> > wrote:
> >
> >> On 30/04/17 10:30, tina sani wrote:
> >>
> >>> I have a model Model1 with all data, having Jena rules. How can I put
> it
> >>> in
> >>> another model Model2 which may or may not have any data?
> >>>
> >> The way to add triples from one model to another is to use the
> >> unsurprisingly named "add" as any glance at the javadoc would tell you.
> >>
> >>  model2.add( model1 )
> >>
> >> If model1 is actually an InfModel with forward rules then what will get
> >> added to model2 is the base triples plus all inferred triples.
> >>
> >> Second, after putting the model in another model, would we able to
> replace
> >>> previous values/data with new one, generated using Jena rules?
> >>>
> >> Question is unclear.
> >>
> >> Once you have a model you and add or remove triples from it.
> >>
> >> You can use rules to generate triples.
> >>
> >> How you connect whatever bit of your code is using rules to whatever bit
> >> of your code is holding the data is up to you. There are no
> out-of-the-box
> >> rule builtins to allow you to fire a rule in one model and assert
> results
> >> into another model if that's what you mean.
> >>
> >> Dave
> >>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: How to put one model in another

2017-04-30 Thread tina sani
Hi Dave, if we have a rule like

if Person publications less than 10, Person is JuniorResearcher
if Person publications greater than 10, Person is SeniorResearcher

If person publication is first less than 10, rules will assign him to
JuniorResearcher class but when it exceeds 10, becomes SeniorResearcher but
the JuniorResearcher also be there as rules does not replace the existed
value with new one.

This was my query if we put the inferred model to a new model, will the
rules then be able to replace the previous data?


On Sun, Apr 30, 2017 at 4:38 PM, Dave Reynolds <dave.e.reyno...@gmail.com>
wrote:

> On 30/04/17 10:30, tina sani wrote:
>
>> I have a model Model1 with all data, having Jena rules. How can I put it
>> in
>> another model Model2 which may or may not have any data?
>>
>
> The way to add triples from one model to another is to use the
> unsurprisingly named "add" as any glance at the javadoc would tell you.
>
>  model2.add( model1 )
>
> If model1 is actually an InfModel with forward rules then what will get
> added to model2 is the base triples plus all inferred triples.
>
> Second, after putting the model in another model, would we able to replace
>> previous values/data with new one, generated using Jena rules?
>>
>
> Question is unclear.
>
> Once you have a model you and add or remove triples from it.
>
> You can use rules to generate triples.
>
> How you connect whatever bit of your code is using rules to whatever bit
> of your code is holding the data is up to you. There are no out-of-the-box
> rule builtins to allow you to fire a rule in one model and assert results
> into another model if that's what you mean.
>
> Dave
>
>


How to put one model in another

2017-04-30 Thread tina sani
I have a model Model1 with all data, having Jena rules. How can I put it in
another model Model2 which may or may not have any data?

Second, after putting the model in another model, would we able to replace
previous values/data with new one, generated using Jena rules?


Re: Fuzzy Protege and Jena

2017-04-22 Thread tina sani
*unless you try to extract the values and do something with it in your
client code*

All of the data in our ontology should be either as data property or object
property. So cant we just use .getPropertyValue() to extract the data?

For example, a person belongs to 0.8% to ClassA and 0.2% to ClassB, can we
simply get the instances of ClassA in membership function?



On Sat, Apr 22, 2017 at 5:29 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Yes. But you will not be able to  use the features of fuzzy OWL unless
> you try to extract the values and do something with it in your client code.
>
> > Hi Lorenz, thank you.
> >
> > So it means we could use it with same Jena methods and SPARQL queries
> > without any changes and need of any plugin?
> >
> >
> >
> > On Sat, Apr 22, 2017 at 1:19 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> The ontologies created by the fuzzy OWL plugin in Protege are still OWL
> >> ontologies - they just add the fuzzy values to OWL annotation
> properties.
> >>
> >>> I am not sure if Jena classes/API supports Fuzzy ontologies in Protege?
> >>> Like we read an ontology in our application and query it using Jena
> >> syntax,
> >>> is it possible for Fuzzy ontologies created in Protege?
> >>>
> >>> Any idea?
> >>>
> >> --
> >> Lorenz Bühmann
> >> AKSW group, University of Leipzig
> >> Group: http://aksw.org - semantic web research center
> >>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Fuzzy Protege and Jena

2017-04-22 Thread tina sani
Hi Lorenz, thank you.

So it means we could use it with same Jena methods and SPARQL queries
without any changes and need of any plugin?



On Sat, Apr 22, 2017 at 1:19 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> The ontologies created by the fuzzy OWL plugin in Protege are still OWL
> ontologies - they just add the fuzzy values to OWL annotation properties.
>
> > I am not sure if Jena classes/API supports Fuzzy ontologies in Protege?
> > Like we read an ontology in our application and query it using Jena
> syntax,
> > is it possible for Fuzzy ontologies created in Protege?
> >
> > Any idea?
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Fuzzy Protege and Jena

2017-04-22 Thread tina sani
I am not sure if Jena classes/API supports Fuzzy ontologies in Protege?
Like we read an ontology in our application and query it using Jena syntax,
is it possible for Fuzzy ontologies created in Protege?

Any idea?


Re: Remove class

2017-02-19 Thread tina sani
Hello Lorenz, should we add inferred model to default like this?


//m is an empty default model and infmodel is inference model
m.add(infmodel);

On Thu, Feb 16, 2017 at 11:29 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Put the inferred model in a default model
>
> > *materialize the model M1 to M2
> >
> > Lorenz, I do not understand it. How to materialize model 1 to 2.?
> >
> > On Wed, Feb 15, 2017 at 6:08 PM, Lorenz Buehmann <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> As I said, materialize the model M1 to M2 and then you can change the
> >> triples in M2. But understand, if you run the inferencing step again,
> >> the "old" classes will be added in addition to what you added manually.
> >>
> >>
> >> On 15.02.2017 14:06, tina sani wrote:
> >>> Hello Lorenz, so no way to remove or replace these classes?
> >>> setOntClass also not working, I have tried it.
> >>>
> >>>
> >>> On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
> >>>> In general, you cannot remove inferred statements - those are given by
> >>>> data + rules.
> >>>>
> >>>> Indeed, you can remove statements on a materialized inferred model,
> but
> >>>> implicitly the class assertion does still exist.
> >>>>
> >>>>
> >>>> On 15.02.2017 13:11, tina sani wrote:
> >>>>> For example, I have added some classes for an individual using rules.
> >>>>> emplyee 1 is type of Manager, Programmer, Worker.
> >>>>>
> >>>>> Can I replace these classes with one class like
> >>>>> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> >>>>> (emp1.hasOntClass(worker)  then emp1 should be type of one class
> >> Employee
> >>>>> and replace/remove these three classes.?
> >>>>>
> >>>>> There is one method, I dont know if it is suitable here to apply?
> >>>>>
> >>>>> Individual.removeOntClass(Resource)
> >>>>> <https://jena.apache.org/documentation/javadoc/jena/
> >>>> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
> >>>> jena.rdf.model.Resource->
> >>>>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Remove class

2017-02-15 Thread tina sani
*materialize the model M1 to M2

Lorenz, I do not understand it. How to materialize model 1 to 2.?

On Wed, Feb 15, 2017 at 6:08 PM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> As I said, materialize the model M1 to M2 and then you can change the
> triples in M2. But understand, if you run the inferencing step again,
> the "old" classes will be added in addition to what you added manually.
>
>
> On 15.02.2017 14:06, tina sani wrote:
> > Hello Lorenz, so no way to remove or replace these classes?
> > setOntClass also not working, I have tried it.
> >
> >
> > On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> In general, you cannot remove inferred statements - those are given by
> >> data + rules.
> >>
> >> Indeed, you can remove statements on a materialized inferred model, but
> >> implicitly the class assertion does still exist.
> >>
> >>
> >> On 15.02.2017 13:11, tina sani wrote:
> >>> For example, I have added some classes for an individual using rules.
> >>> emplyee 1 is type of Manager, Programmer, Worker.
> >>>
> >>> Can I replace these classes with one class like
> >>> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> >>> (emp1.hasOntClass(worker)  then emp1 should be type of one class
> Employee
> >>> and replace/remove these three classes.?
> >>>
> >>> There is one method, I dont know if it is suitable here to apply?
> >>>
> >>> Individual.removeOntClass(Resource)
> >>> <https://jena.apache.org/documentation/javadoc/jena/
> >> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
> >> jena.rdf.model.Resource->
> >>
>
>


Re: Remove class

2017-02-15 Thread tina sani
yes,

On Wed, Feb 15, 2017 at 4:55 PM, A. Soroka <aj...@virginia.edu> wrote:

> Can you tell us something about this project? Is this a school assignment?
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Feb 15, 2017, at 8:54 AM, tina sani <tinamadri...@gmail.com> wrote:
> >
> > Lorenz, using rules in my project is mandatory part so need to stick with
> > it.
> >
> > On Wed, Feb 15, 2017 at 4:50 PM, Chris Dollin <
> chris.dol...@epimorphics.com>
> > wrote:
> >
> >> On 15 February 2017 at 13:06, tina sani <tinamadri...@gmail.com> wrote:
> >>
> >>> Hello Lorenz, so no way to remove or replace these classes?
> >>> setOntClass also not working, I have tried it.
> >>>
> >>
> >> If you don't want inference to add back the statements
> >> you have deleted
> >>
> >> Then don't use inference to add the statements in
> >> the first place
> >>
> >> Then you can add and remove statements as you like
> >>
> >> Chris
> >>
> >>
> >>> On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
> >>>> In general, you cannot remove inferred statements - those are given by
> >>>> data + rules.
> >>>>
> >>>> Indeed, you can remove statements on a materialized inferred model,
> but
> >>>> implicitly the class assertion does still exist.
> >>>>
> >>>>
> >>>> On 15.02.2017 13:11, tina sani wrote:
> >>>>> For example, I have added some classes for an individual using rules.
> >>>>> emplyee 1 is type of Manager, Programmer, Worker.
> >>>>>
> >>>>> Can I replace these classes with one class like
> >>>>> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> >>>>> (emp1.hasOntClass(worker)  then emp1 should be type of one class
> >>> Employee
> >>>>> and replace/remove these three classes.?
> >>>>>
> >>>>> There is one method, I dont know if it is suitable here to apply?
> >>>>>
> >>>>> Individual.removeOntClass(Resource)
> >>>>> <https://jena.apache.org/documentation/javadoc/jena/
> >>>> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
> >>>> jena.rdf.model.Resource->
> >>>>>
> >>>>
> >>>>
> >>>
> >>
>
>


Re: Remove class

2017-02-15 Thread tina sani
Lorenz, using rules in my project is mandatory part so need to stick with
it.

On Wed, Feb 15, 2017 at 4:50 PM, Chris Dollin <chris.dol...@epimorphics.com>
wrote:

> On 15 February 2017 at 13:06, tina sani <tinamadri...@gmail.com> wrote:
>
> > Hello Lorenz, so no way to remove or replace these classes?
> > setOntClass also not working, I have tried it.
> >
>
> If you don't want inference to add back the statements
> you have deleted
>
> Then don't use inference to add the statements in
> the first place
>
> Then you can add and remove statements as you like
>
> Chris
>
>
> > On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> > > In general, you cannot remove inferred statements - those are given by
> > > data + rules.
> > >
> > > Indeed, you can remove statements on a materialized inferred model, but
> > > implicitly the class assertion does still exist.
> > >
> > >
> > > On 15.02.2017 13:11, tina sani wrote:
> > > > For example, I have added some classes for an individual using rules.
> > > > emplyee 1 is type of Manager, Programmer, Worker.
> > > >
> > > > Can I replace these classes with one class like
> > > > if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> > > > (emp1.hasOntClass(worker)  then emp1 should be type of one class
> > Employee
> > > > and replace/remove these three classes.?
> > > >
> > > > There is one method, I dont know if it is suitable here to apply?
> > > >
> > > > Individual.removeOntClass(Resource)
> > > > <https://jena.apache.org/documentation/javadoc/jena/
> > > org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
> > > jena.rdf.model.Resource->
> > > >
> > >
> > >
> >
>


Remove class

2017-02-15 Thread tina sani
For example, I have added some classes for an individual using rules.
emplyee 1 is type of Manager, Programmer, Worker.

Can I replace these classes with one class like
if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
(emp1.hasOntClass(worker)  then emp1 should be type of one class Employee
and replace/remove these three classes.?

There is one method, I dont know if it is suitable here to apply?

Individual.removeOntClass(Resource)



Re: Getting multiple classes for an Individual

2017-01-27 Thread tina sani
My individual employee is a type of Technical, Manager and Programmer. I
want to replace all these classes with only one class Worker.  I used the
following code, it supposed to replace it but it does not.
All these classes are defined in the code.

 if ((employee.hasOntClass(technical)) &&
(employee.hasOntClass(programmer)) && (employee.hasOntClass(manager)))
  {
  employee.setOntClass(worker);
  JOptionPane.showMessageDialog(null, "here are the three  classes");
  }

Though it display the message in the Dialog.

On Fri, Jan 27, 2017 at 12:57 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Why should a method called "listOntClasses" just return a single class?
> The usage of the plural form should be clear enough. And Javadoc Javadoc
> Javadoc,...
> > Dave, I have read some where that Individual#listOntClasses will only
> list
> > one class at one time.
> >
> > And yes employee is individual and programmer, manager and worker are
> class
> > variables.
> >
> > On Fri, Jan 27, 2017 at 12:23 AM, Dave Reynolds <
> dave.e.reyno...@gmail.com>
> > wrote:
> >
> >> On 26/01/2017 21:08, tina sani wrote:
> >>
> >>> Hi Dave, Will this work?
> >>>
> >>> if ((employee1.hasOntClass(programmer)) &&
> >>> ((employee1.hasOntClass(manager)) &&((employee1.hasOntClass(worker))
> >>> {
> >>>
> >>> }
> >>>
> >> Try it and see!
> >>
> >> There's not enough there for us to tell for sure. If the variable
> >> employee1 is an Individual and if variables programmer, manager and
> worker
> >> are all Resources correctly corresponding to your classes then that will
> >> test if that Individual has all three of those classes in the model
> >> (whether asserted or inferred by rules).
> >>
> >> To add to my earlier answer, if you have an Individual rather than just
> >> and OntResource then Individual#listOntClasses will enable you to
> enumerate
> >> the classes conveniently.
> >>
> >> Dave
> >>
> >>
> >> On Thu, Jan 26, 2017 at 11:32 PM, Dave Reynolds <
> dave.e.reyno...@gmail.com
> >>> wrote:
> >>>
> >>> On 26/01/2017 15:20, tina sani wrote:
> >>>> How can I get all the classes of which an individual is a type? After
> >>>>> Jena
> >>>>> rules executed, my individual has multiple class like:
> >>>>> Employee001 is of type: Worker, Programmer, Manager.
> >>>>>
> >>>>> So can I get all these three classes in Jena ? I have read somewhere
> >>>>> that
> >>>>> getOntClass() only return one class at a time and that is on random
> >>>>> basis.
> >>>>>
> >>>>> See OntResource#listRDFTypes or, if you just have a Resource then
> >>>>>
> >>>> Resource#listProperties(RDF.type) or, as Charles says, use SPARQL.
> >>>>
> >>>> Dave
> >>>>
> >>>>
> >>>>
> >>>> ---
> >>>> This email has been checked for viruses by Avast antivirus software.
> >>>> https://www.avast.com/antivirus
> >>>>
> >>>>
> >>>>
> >> ---
> >> This email has been checked for viruses by Avast antivirus software.
> >> https://www.avast.com/antivirus
> >>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Getting multiple classes for an Individual

2017-01-26 Thread tina sani
Dave, I have read some where that Individual#listOntClasses will only list
one class at one time.

And yes employee is individual and programmer, manager and worker are class
variables.

On Fri, Jan 27, 2017 at 12:23 AM, Dave Reynolds <dave.e.reyno...@gmail.com>
wrote:

> On 26/01/2017 21:08, tina sani wrote:
>
>> Hi Dave, Will this work?
>>
>> if ((employee1.hasOntClass(programmer)) &&
>> ((employee1.hasOntClass(manager)) &&((employee1.hasOntClass(worker))
>> {
>>
>> }
>>
>
> Try it and see!
>
> There's not enough there for us to tell for sure. If the variable
> employee1 is an Individual and if variables programmer, manager and worker
> are all Resources correctly corresponding to your classes then that will
> test if that Individual has all three of those classes in the model
> (whether asserted or inferred by rules).
>
> To add to my earlier answer, if you have an Individual rather than just
> and OntResource then Individual#listOntClasses will enable you to enumerate
> the classes conveniently.
>
> Dave
>
>
> On Thu, Jan 26, 2017 at 11:32 PM, Dave Reynolds <dave.e.reyno...@gmail.com
>> >
>> wrote:
>>
>> On 26/01/2017 15:20, tina sani wrote:
>>>
>>> How can I get all the classes of which an individual is a type? After
>>>> Jena
>>>> rules executed, my individual has multiple class like:
>>>> Employee001 is of type: Worker, Programmer, Manager.
>>>>
>>>> So can I get all these three classes in Jena ? I have read somewhere
>>>> that
>>>> getOntClass() only return one class at a time and that is on random
>>>> basis.
>>>>
>>>> See OntResource#listRDFTypes or, if you just have a Resource then
>>>>
>>> Resource#listProperties(RDF.type) or, as Charles says, use SPARQL.
>>>
>>> Dave
>>>
>>>
>>>
>>> ---
>>> This email has been checked for viruses by Avast antivirus software.
>>> https://www.avast.com/antivirus
>>>
>>>
>>>
>>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>


Re: Getting multiple classes for an Individual

2017-01-26 Thread tina sani
Hi Dave, Will this work?

if ((employee1.hasOntClass(programmer)) &&
((employee1.hasOntClass(manager)) &&((employee1.hasOntClass(worker))
{

}

On Thu, Jan 26, 2017 at 11:32 PM, Dave Reynolds <dave.e.reyno...@gmail.com>
wrote:

> On 26/01/2017 15:20, tina sani wrote:
>
>> How can I get all the classes of which an individual is a type? After Jena
>> rules executed, my individual has multiple class like:
>> Employee001 is of type: Worker, Programmer, Manager.
>>
>> So can I get all these three classes in Jena ? I have read somewhere that
>> getOntClass() only return one class at a time and that is on random basis.
>>
>> See OntResource#listRDFTypes or, if you just have a Resource then
> Resource#listProperties(RDF.type) or, as Charles says, use SPARQL.
>
> Dave
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>


Re: Rules

2017-01-21 Thread tina sani
Lorenz, I am not very expert in Jena and thinking about it from few hours.
If we do something like this after the Jena rule,

 If (salary>10k)
employee.setOntClass(Programmer class)
else
employee.setOntClass(Manager class);

I dont know what this code will work, will work or not, but it is my
thinking in very abstract way.



On Sat, Jan 21, 2017 at 3:03 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Of course you have to handle it in your application code. And that's
> your task to solve this problem
> Again, rules infer new facts based on the existing facts. Nothing more,
> nothing less. No deletion or replacement of facts.
>
> > Lorenz, question arises then how to cope with it?
> >
> > On Fri, Jan 20, 2017 at 8:39 PM, Lorenz Buehmann <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> Rules do not replace values - that's the nature of Jena rules and also
> >> other rule languages like SWRL - called monotonicity.
> >>
> >> More is not to say.
> >>
> >>
> >> On 20.01.2017 17:29, tina sani wrote:
> >>> I am asking why the Jena rules some times lead to duplicate values. By
> >>> duplicate values, I mean it does not over write the old values when
> >> certain
> >>> new values comes in.
> >>> I have a rule which says if an employee salary exceeds 10k usd, the
> >> emplyee
> >>> should be assigned to a Manager class else to Programmer class.
> >>>
> >>> In the early stages of the system, my rules assign her to Programmer
> when
> >>> salary is less than 10k and works fine.
> >>> When later the same employee salary exceeds the threshold, it assign it
> >> to
> >>> Manager class, again fine. But the problem is that it did not replace
> the
> >>> old value and I can see both the values in my file:
> >>> *Jim Type Programmer*
> >>> *Jim  Type  Manager*
> >>>
> >>> *Now should it be avoided and if yes how? From week, I am working on it
> >> but
> >>> so far failed.*
> >>>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Rules

2017-01-20 Thread tina sani
Lorenz, question arises then how to cope with it?

On Fri, Jan 20, 2017 at 8:39 PM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> Rules do not replace values - that's the nature of Jena rules and also
> other rule languages like SWRL - called monotonicity.
>
> More is not to say.
>
>
> On 20.01.2017 17:29, tina sani wrote:
> > I am asking why the Jena rules some times lead to duplicate values. By
> > duplicate values, I mean it does not over write the old values when
> certain
> > new values comes in.
> > I have a rule which says if an employee salary exceeds 10k usd, the
> emplyee
> > should be assigned to a Manager class else to Programmer class.
> >
> > In the early stages of the system, my rules assign her to Programmer when
> > salary is less than 10k and works fine.
> > When later the same employee salary exceeds the threshold, it assign it
> to
> > Manager class, again fine. But the problem is that it did not replace the
> > old value and I can see both the values in my file:
> > *Jim Type Programmer*
> > *Jim  Type  Manager*
> >
> > *Now should it be avoided and if yes how? From week, I am working on it
> but
> > so far failed.*
> >
>
>


Rules

2017-01-20 Thread tina sani
I am asking why the Jena rules some times lead to duplicate values. By
duplicate values, I mean it does not over write the old values when certain
new values comes in.
I have a rule which says if an employee salary exceeds 10k usd, the emplyee
should be assigned to a Manager class else to Programmer class.

In the early stages of the system, my rules assign her to Programmer when
salary is less than 10k and works fine.
When later the same employee salary exceeds the threshold, it assign it to
Manager class, again fine. But the problem is that it did not replace the
old value and I can see both the values in my file:
*Jim Type Programmer*
*Jim  Type  Manager*

*Now should it be avoided and if yes how? From week, I am working on it but
so far failed.*


Re: Semantic Of Jena rule

2017-01-12 Thread tina sani
You said it Lorenz, I just wanted to confirm this syntax is allowed in Jena
rules or not?

Thanks

On Fri, Jan 13, 2017 at 12:22 AM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> And trying it out is no option for you?!
>
> What is so confusing about greaterThan and lessThan? I'm totally puzzled
> by this question as it's some kind of too obvious.
>
> greaterThan(?x, 1000) - what do you think does it mean? "?x is greater
> than 1000"
>
> lessThan(?x, 2000) - what do you think does it mean? "?x is less than 2000"
>
> greaterThan(?x, 1000), lessThan(?x, 2000)  - what do you think does it
> mean? "?x is greater than 1000 AND ?x is less than 2000"
>
>
> On 12.01.2017 20:15, tina sani wrote:
> > Well, I am not sure about greaterThan and lessThan keywords. Will this
> rule
> > execute if it encounters salary b/w 5000 and 10,000?
> >
> > On Thu, Jan 12, 2017 at 8:53 PM, Joint <dandh...@gmail.com> wrote:
> >
> >>
> >> Have you tried it? What happened?
> >> "Of course this will not execute because I skip proper syntax"
> >> So you know the syntax isn't correct but still ask if it is correct..
> >> Dick
> >>
> >>  Original message 
> >> From: tina sani <tinamadri...@gmail.com>
> >> Date: 12/01/2017  14:47  (GMT+00:00)
> >> To: users@jena.apache.org
> >> Subject: Semantic Of Jena rule
> >>
> >> The syntax and semantic of this rule is correct?
> >>
> >> ?emp rdf:type URI:Employee + ?emp URI:NetSalary ?salary+
> >> greaterThan(?salary, 5000), lessThan(?salary, 1)-> ?emp rdf:type
> >> URI:Manager
> >>
> >> Of course this will not execute because I skip proper syntax, but I
> wonder
> >> this rule will work or not if some employee have salary between 5000 and
> >> 1.
> >> I am confuse in greaterThan and lessThan part of the rule, if it will
> work
> >> or not?
> >>
>
>


Re: Semantic Of Jena rule

2017-01-12 Thread tina sani
Thank you Dick but I also want the salary to be less than 1. Because in
another rule I have condition if salary is greater than 1, then
employee is type of NS:ChiefExective.
So in that case, Manager instance will also be assigned to ChiefExecutive.

It means lowe and upper bound should be declared in rules.

On Thu, Jan 12, 2017 at 10:48 PM, Dick Murray <dandh...@gmail.com> wrote:

> An example rule which you can test and then expand on is;
>
> [Manager: (?E rdf:type NS:Employee), (?E NS:netSalary ?S), greaterThan (?S,
> 5000) -> (?X rdf:type NS:Manager)]
>
> Also see https://jena.apache.org/documentation/inference/
>
>
> On 12 Jan 2017 19:15, "tina sani" <tinamadri...@gmail.com> wrote:
>
> Well, I am not sure about greaterThan and lessThan keywords. Will this rule
> execute if it encounters salary b/w 5000 and 10,000?
>
> On Thu, Jan 12, 2017 at 8:53 PM, Joint <dandh...@gmail.com> wrote:
>
> >
> >
> > Have you tried it? What happened?
> > "Of course this will not execute because I skip proper syntax"
> > So you know the syntax isn't correct but still ask if it is correct..
> > Dick
> >
> >  Original message 
> > From: tina sani <tinamadri...@gmail.com>
> > Date: 12/01/2017  14:47  (GMT+00:00)
> > To: users@jena.apache.org
> > Subject: Semantic Of Jena rule
> >
> > The syntax and semantic of this rule is correct?
> >
> > ?emp rdf:type URI:Employee + ?emp URI:NetSalary ?salary+
> > greaterThan(?salary, 5000), lessThan(?salary, 1)-> ?emp rdf:type
> > URI:Manager
> >
> > Of course this will not execute because I skip proper syntax, but I
> wonder
> > this rule will work or not if some employee have salary between 5000 and
> > 1.
> > I am confuse in greaterThan and lessThan part of the rule, if it will
> work
> > or not?
> >
>


Re: Semantic Of Jena rule

2017-01-12 Thread tina sani
Well, I am not sure about greaterThan and lessThan keywords. Will this rule
execute if it encounters salary b/w 5000 and 10,000?

On Thu, Jan 12, 2017 at 8:53 PM, Joint <dandh...@gmail.com> wrote:

>
>
> Have you tried it? What happened?
> "Of course this will not execute because I skip proper syntax"
> So you know the syntax isn't correct but still ask if it is correct..
> Dick
>
> ---- Original message 
> From: tina sani <tinamadri...@gmail.com>
> Date: 12/01/2017  14:47  (GMT+00:00)
> To: users@jena.apache.org
> Subject: Semantic Of Jena rule
>
> The syntax and semantic of this rule is correct?
>
> ?emp rdf:type URI:Employee + ?emp URI:NetSalary ?salary+
> greaterThan(?salary, 5000), lessThan(?salary, 1)-> ?emp rdf:type
> URI:Manager
>
> Of course this will not execute because I skip proper syntax, but I wonder
> this rule will work or not if some employee have salary between 5000 and
> 1.
> I am confuse in greaterThan and lessThan part of the rule, if it will work
> or not?
>


Semantic Of Jena rule

2017-01-12 Thread tina sani
The syntax and semantic of this rule is correct?

?emp rdf:type URI:Employee + ?emp URI:NetSalary ?salary+
greaterThan(?salary, 5000), lessThan(?salary, 1)-> ?emp rdf:type
URI:Manager

Of course this will not execute because I skip proper syntax, but I wonder
this rule will work or not if some employee have salary between 5000 and
1.
I am confuse in greaterThan and lessThan part of the rule, if it will work
or not?


Re: OR Operation

2017-01-03 Thread tina sani
Thank you Dave and Lorenz.

On Tue, Jan 3, 2017 at 11:38 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> No. It's the same as for SWRL, no native disjunction support.
>
> > Thank you Dave, Isn't there any operator we use for OR operation like we
> > use + for AND.
> >
> > On Mon, Jan 2, 2017 at 6:18 PM, Dave Reynolds <dave.e.reyno...@gmail.com
> >
> > wrote:
> >
> >> On 02/01/17 14:56, tina sani wrote:
> >>
> >>> How can we declare/specify an Or operation in our Jena rules. For
> >>> instance,
> >>> if we have something like this
> >>>
> >>> If ?x rdf:type emp:Managers  OR  ?x rdf:type emp:Programmer --> ?x
> >>> rdf:type
> >>> emp:Employee
> >>>
> >>>
> >> Expand the OR out to two rules:
> >>
> >>  ?x rdf:type emp:Managers -> ?x rdf:type emp:Employee
> >>  ?x rdf:type emp:Programmer -> ?x rdf:type emp:Employee
> >>
> >> Dave
> >>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: OR Operation

2017-01-02 Thread tina sani
Thank you Dave, Isn't there any operator we use for OR operation like we
use + for AND.

On Mon, Jan 2, 2017 at 6:18 PM, Dave Reynolds <dave.e.reyno...@gmail.com>
wrote:

> On 02/01/17 14:56, tina sani wrote:
>
>> How can we declare/specify an Or operation in our Jena rules. For
>> instance,
>> if we have something like this
>>
>> If ?x rdf:type emp:Managers  OR  ?x rdf:type emp:Programmer --> ?x
>> rdf:type
>> emp:Employee
>>
>>
> Expand the OR out to two rules:
>
>  ?x rdf:type emp:Managers -> ?x rdf:type emp:Employee
>  ?x rdf:type emp:Programmer -> ?x rdf:type emp:Employee
>
> Dave
>
>


OR Operation

2017-01-02 Thread tina sani
How can we declare/specify an Or operation in our Jena rules. For instance,
if we have something like this

If ?x rdf:type emp:Managers  OR  ?x rdf:type emp:Programmer --> ?x rdf:type
emp:Employee


Re: Fuzzy rules

2016-12-22 Thread tina sani
"I'm not aware of any native fuzzy Jena support"

Hi Lorenz, is it possible we use fuzzy rules separately and Jena rules
separately, applying them on same data?

On Thu, Dec 22, 2016 at 12:52 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> I'm not aware of any native fuzzy Jena support, but maybe there is some
> 3rd party extension somewhere.
>
> There are approaches and reasoners like FuzzyOWL resp. FuzzyDL, but
> those work on the OWL API and do not support rules (afaik).
>
> Lorenz
>
> > Is it possible we use fuzzy and jena rules together in our semantic web
> > application?
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Fuzzy rules

2016-12-22 Thread tina sani
Is it possible we use fuzzy and jena rules together in our semantic web
application?


Re: Super classes/Sub classes in Jena rules

2016-12-02 Thread tina sani
Thanks Lorenz I have fixed it. Yes its projects of last semester, but each
have different domain. The complexity of the project increases each month
as our adviser demands for more and more.

On Fri, Dec 2, 2016 at 11:16 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> I don't understand why people think that "^" is the conjunction of rule
> atoms?  The documentation [1] says ","  has to be used as functor in
> Jena. Note, that this is just implementation dependent and other
> frameworks might use a different symbol.
>
> One question from my side:
> Somebody else was asking the same quite recently [2]. Is it some
> exercise of a computer science lecture at your university? If so, people
> should try to work together and share there experience and knowledge. At
> least that's how we did it during studies.
>
>
> [1] https://jena.apache.org/documentation/inference/#rules
> [2]
> http://jena.markmail.org/search/#query:+page:1+mid:
> azf7ksmpxnhlzdrp+state:results
>
> Lorenz
>
> >  Hello Lorenz, Dave, I have used the above method and suddenly I get this
> > exception:
> >
> >  WARN [AWT-EventQueue-0] (Rule.java:947) - Rule references unimplemented
> > functor: ^
> >
> > Where it comes from?
> >
> > On Sun, Nov 27, 2016 at 2:59 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >>
> >>> Hi Dave,
> >>>
> >>> So in that case we dont need to add non-inference model to the generic
> >>> reasoner because after all, our whole data is in the model.
> >> Yes, it is simply nested:
> >> Raw model A is "contained" in the inferred RDFS model B.
> >> B is "contained" in your user-defined rule model C.
> >> Thus, A is "contained" in C.
> >>>
> >>> On Sat, Nov 26, 2016 at 11:55 AM, Dave Reynolds <
> >> dave.e.reyno...@gmail.com>
> >>> wrote:
> >>>
> >>>> On 25/11/16 13:54, tina sani wrote:
> >>>>
> >>>>> I have something like this after my Jena forward chain rules and
> SPARQL
> >>>>> query:
> >>>>>
> >>>>>  Reasoner reasoner1 = new GenericRuleReasoner(Rule.
> parseRules(rule));
> >>>>> InfModel inf = ModelFactory.createInfModel(reasoner1,
> model);
> >>>>>
> >>>>> Reasoner reasoner2 = ReasonerRegistry.getRDFSReasoner();
> >>>>>
> >>>>> InfModel inf2 = ModelFactory.createRDFSModel(model);
> >>>>>
> >>>> If you want your rules to see the results of the RDFS closure then you
> >>>> need something more like:
> >>>>
> >>>> InfModel inf = ModelFactory.createRDFSModel(model);
> >>>> Reasoner reasoner1 = new GenericRuleReasoner(Rule.
> >> parseRules(rule));
> >>>> InfModel inf2 = ModelFactory.createInfModel(reasoner1, inf);
> >>>>
> >>>> Dave
> >>>>
> >>>>
> >>>> On Fri, Nov 25, 2016 at 4:46 PM, tina sani <tinamadri...@gmail.com>
> >> wrote:
> >>>>> So all I should so is to create rdfs model:
> >>>>>> InfModel inf2 = ModelFactory.createRDFSModel();
> >>>>>>
> >>>>>> What would be the arguments of the ModelFactory.createRDFSModel().
> I
> >>>>>> have two models here, one the simple non inference model and other
> the
> >>>>>> inference model : InfModel inf = ModelFactory.createInfModel(
> >> reasoner,
> >>>>>> model);
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On Fri, Nov 25, 2016 at 3:59 PM, Lorenz B. <buehm...@informatik.uni-
> >>>>>> leipzig.de> wrote:
> >>>>>>
> >>>>>>
> >>>>>>> Yes I use GenericRuleReasoner, so using the following rules along
> >> with
> >>>>>>> my
> >>>>>>>
> >>>>>>>> own rules will solve the problem?
> >>>>>>>>
> >>>>>>>> ?x rdfs:subClassOf emp:ContractEmployee--> ?x rdfs:subClassOf
> >>>>>>>>
> >>>>>>> emp:Employee
> >>>>>>>
> >>>>>>>> ?x rdfs:subClassOf emp:PermanantEmployee--> ?x rdfs:subClassOf
> >>>>>>

Re: Super classes/Sub classes in Jena rules

2016-12-01 Thread tina sani
 Hello Lorenz, Dave, I have used the above method and suddenly I get this
exception:

 WARN [AWT-EventQueue-0] (Rule.java:947) - Rule references unimplemented
functor: ^

Where it comes from?

On Sun, Nov 27, 2016 at 2:59 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
>
> > Hi Dave,
> >
> > So in that case we dont need to add non-inference model to the generic
> > reasoner because after all, our whole data is in the model.
> Yes, it is simply nested:
> Raw model A is "contained" in the inferred RDFS model B.
> B is "contained" in your user-defined rule model C.
> Thus, A is "contained" in C.
> >
> >
> > On Sat, Nov 26, 2016 at 11:55 AM, Dave Reynolds <
> dave.e.reyno...@gmail.com>
> > wrote:
> >
> >> On 25/11/16 13:54, tina sani wrote:
> >>
> >>> I have something like this after my Jena forward chain rules and SPARQL
> >>> query:
> >>>
> >>>  Reasoner reasoner1 = new GenericRuleReasoner(Rule.parseRules(rule));
> >>> InfModel inf = ModelFactory.createInfModel(reasoner1, model);
> >>>
> >>> Reasoner reasoner2 = ReasonerRegistry.getRDFSReasoner();
> >>>
> >>> InfModel inf2 = ModelFactory.createRDFSModel(model);
> >>>
> >> If you want your rules to see the results of the RDFS closure then you
> >> need something more like:
> >>
> >> InfModel inf = ModelFactory.createRDFSModel(model);
> >> Reasoner reasoner1 = new GenericRuleReasoner(Rule.
> parseRules(rule));
> >> InfModel inf2 = ModelFactory.createInfModel(reasoner1, inf);
> >>
> >> Dave
> >>
> >>
> >> On Fri, Nov 25, 2016 at 4:46 PM, tina sani <tinamadri...@gmail.com>
> wrote:
> >>> So all I should so is to create rdfs model:
> >>>> InfModel inf2 = ModelFactory.createRDFSModel();
> >>>>
> >>>> What would be the arguments of the ModelFactory.createRDFSModel(). I
> >>>> have two models here, one the simple non inference model and other the
> >>>> inference model : InfModel inf = ModelFactory.createInfModel(
> reasoner,
> >>>> model);
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On Fri, Nov 25, 2016 at 3:59 PM, Lorenz B. <buehm...@informatik.uni-
> >>>> leipzig.de> wrote:
> >>>>
> >>>>
> >>>>> Yes I use GenericRuleReasoner, so using the following rules along
> with
> >>>>> my
> >>>>>
> >>>>>> own rules will solve the problem?
> >>>>>>
> >>>>>> ?x rdfs:subClassOf emp:ContractEmployee--> ?x rdfs:subClassOf
> >>>>>>
> >>>>> emp:Employee
> >>>>>
> >>>>>> ?x rdfs:subClassOf emp:PermanantEmployee--> ?x rdfs:subClassOf
> >>>>>>
> >>>>> emp:Employee
> >>>>> That might be incomplete as rdfs:subClassOf is transitive. Simply use
> >>>>> the RDFS reasoning.
> >>>>>
> >>>>>> On Thu, Nov 24, 2016 at 11:39 AM, Lorenz B. <
> >>>>>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>>>>
> >>>>>>  If I pass OntModelSpec.OWL_MEM_MICRO_RULE_INF” to the OntModel,
> will
> >>>>>>> it do
> >>>>>>>
> >>>>>>>> the RDFS reasoning?
> >>>>>>>>
> >>>>>>> See [1] in general and in particular [2] which shows how to setup
> an
> >>>>>>> RDFS reasoner
> >>>>>>>
> >>>>>>> InfModel inf = ModelFactory.createRDFSModel(rdfsExample);
> >>>>>>>
> >>>>>>> or
> >>>>>>>
> >>>>>>> Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
> >>>>>>> InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
> >>>>>>>
> >>>>>>> [1] https://jena.apache.org/documentation/inference/ [2]
> >>>>>>> https://jena.apache.org/documentation/inference/#generalExamples
> >>>>>>>
> >>>>>>>> b) adding the particular rules to your set of rules
> >>>>>>>>  I have already created the rules, mentioned in my first email.
> You
> >>>>>>>

Re: Super classes/Sub classes in Jena rules

2016-11-26 Thread tina sani
Hi Dave,

So in that case we dont need to add non-inference model to the generic
reasoner because after all, our whole data is in the model.


On Sat, Nov 26, 2016 at 11:55 AM, Dave Reynolds <dave.e.reyno...@gmail.com>
wrote:

> On 25/11/16 13:54, tina sani wrote:
>
>> I have something like this after my Jena forward chain rules and SPARQL
>> query:
>>
>>  Reasoner reasoner1 = new GenericRuleReasoner(Rule.parseRules(rule));
>> InfModel inf = ModelFactory.createInfModel(reasoner1, model);
>>
>> Reasoner reasoner2 = ReasonerRegistry.getRDFSReasoner();
>>
>> InfModel inf2 = ModelFactory.createRDFSModel(model);
>>
>
> If you want your rules to see the results of the RDFS closure then you
> need something more like:
>
> InfModel inf = ModelFactory.createRDFSModel(model);
> Reasoner reasoner1 = new GenericRuleReasoner(Rule.parseRules(rule));
> InfModel inf2 = ModelFactory.createInfModel(reasoner1, inf);
>
> Dave
>
>
> On Fri, Nov 25, 2016 at 4:46 PM, tina sani <tinamadri...@gmail.com> wrote:
>>
>> So all I should so is to create rdfs model:
>>>
>>> InfModel inf2 = ModelFactory.createRDFSModel();
>>>
>>> What would be the arguments of the ModelFactory.createRDFSModel(). I
>>> have two models here, one the simple non inference model and other the
>>> inference model : InfModel inf = ModelFactory.createInfModel(reasoner,
>>> model);
>>>
>>>
>>>
>>>
>>> On Fri, Nov 25, 2016 at 3:59 PM, Lorenz B. <buehm...@informatik.uni-
>>> leipzig.de> wrote:
>>>
>>>
>>>>
>>>> Yes I use GenericRuleReasoner, so using the following rules along with
>>>>>
>>>> my
>>>>
>>>>> own rules will solve the problem?
>>>>>
>>>>> ?x rdfs:subClassOf emp:ContractEmployee--> ?x rdfs:subClassOf
>>>>>
>>>> emp:Employee
>>>>
>>>>> ?x rdfs:subClassOf emp:PermanantEmployee--> ?x rdfs:subClassOf
>>>>>
>>>> emp:Employee
>>>> That might be incomplete as rdfs:subClassOf is transitive. Simply use
>>>> the RDFS reasoning.
>>>>
>>>>>
>>>>> On Thu, Nov 24, 2016 at 11:39 AM, Lorenz B. <
>>>>> buehm...@informatik.uni-leipzig.de> wrote:
>>>>>
>>>>>  If I pass OntModelSpec.OWL_MEM_MICRO_RULE_INF” to the OntModel, will
>>>>>>>
>>>>>> it do
>>>>>>
>>>>>>> the RDFS reasoning?
>>>>>>>
>>>>>> See [1] in general and in particular [2] which shows how to setup an
>>>>>> RDFS reasoner
>>>>>>
>>>>>> InfModel inf = ModelFactory.createRDFSModel(rdfsExample);
>>>>>>
>>>>>> or
>>>>>>
>>>>>> Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
>>>>>> InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
>>>>>>
>>>>>> [1] https://jena.apache.org/documentation/inference/ [2]
>>>>>> https://jena.apache.org/documentation/inference/#generalExamples
>>>>>>
>>>>>>> b) adding the particular rules to your set of rules
>>>>>>>  I have already created the rules, mentioned in my first email. You
>>>>>>>
>>>>>> means
>>>>
>>>>> rules other than that?
>>>>>>>
>>>>>> I don't know how you setup your rules, but if you use the
>>>>>> GenericRuleReasoner it does only apply your rules and you would have
>>>>>> to
>>>>>> add the rules that do the rdfs:subClass/rdf:type inference.
>>>>>>
>>>>>>> On Wed, Nov 23, 2016 at 11:50 AM, Lorenz B. <
>>>>>>> buehm...@informatik.uni-leipzig.de> wrote:
>>>>>>>
>>>>>>> Dave meant that you need an additional layer of reasoning like RDFS
>>>>>>>>
>>>>>>> or
>>>>
>>>>> even less to get the inferences that you describe.
>>>>>>>> This can be done by
>>>>>>>>
>>>>>>>> a) nesting two InfModels one that works on your specific rules and
>>>>>>>>
>>>>>>> one
>>>>
>>>>> that uses some kind of RDFS or
>>>>&g

Re: Super classes/Sub classes in Jena rules

2016-11-25 Thread tina sani
I have something like this after my Jena forward chain rules and SPARQL
query:

 Reasoner reasoner1 = new GenericRuleReasoner(Rule.parseRules(rule));
InfModel inf = ModelFactory.createInfModel(reasoner1, model);

Reasoner reasoner2 = ReasonerRegistry.getRDFSReasoner();

InfModel inf2 = ModelFactory.createRDFSModel(model);



On Fri, Nov 25, 2016 at 4:46 PM, tina sani <tinamadri...@gmail.com> wrote:

> So all I should so is to create rdfs model:
>
> InfModel inf2 = ModelFactory.createRDFSModel();
>
> What would be the arguments of the ModelFactory.createRDFSModel(). I have two 
> models here, one the simple non inference model and other the inference model 
> : InfModel inf = ModelFactory.createInfModel(reasoner, model);
>
>
>
>
> On Fri, Nov 25, 2016 at 3:59 PM, Lorenz B. <buehm...@informatik.uni-
> leipzig.de> wrote:
>
>>
>>
>> > Yes I use GenericRuleReasoner, so using the following rules along with
>> my
>> > own rules will solve the problem?
>> >
>> > ?x rdfs:subClassOf emp:ContractEmployee--> ?x rdfs:subClassOf
>> emp:Employee
>> > ?x rdfs:subClassOf emp:PermanantEmployee--> ?x rdfs:subClassOf
>> emp:Employee
>> That might be incomplete as rdfs:subClassOf is transitive. Simply use
>> the RDFS reasoning.
>> >
>> > On Thu, Nov 24, 2016 at 11:39 AM, Lorenz B. <
>> > buehm...@informatik.uni-leipzig.de> wrote:
>> >
>> >>>  If I pass OntModelSpec.OWL_MEM_MICRO_RULE_INF” to the OntModel, will
>> >> it do
>> >>> the RDFS reasoning?
>> >> See [1] in general and in particular [2] which shows how to setup an
>> >> RDFS reasoner
>> >>
>> >> InfModel inf = ModelFactory.createRDFSModel(rdfsExample);
>> >>
>> >> or
>> >>
>> >> Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
>> >> InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
>> >>
>> >> [1] https://jena.apache.org/documentation/inference/ [2]
>> >> https://jena.apache.org/documentation/inference/#generalExamples
>> >>> b) adding the particular rules to your set of rules
>> >>>  I have already created the rules, mentioned in my first email. You
>> means
>> >>> rules other than that?
>> >> I don't know how you setup your rules, but if you use the
>> >> GenericRuleReasoner it does only apply your rules and you would have to
>> >> add the rules that do the rdfs:subClass/rdf:type inference.
>> >>> On Wed, Nov 23, 2016 at 11:50 AM, Lorenz B. <
>> >>> buehm...@informatik.uni-leipzig.de> wrote:
>> >>>
>> >>>> Dave meant that you need an additional layer of reasoning like RDFS
>> or
>> >>>> even less to get the inferences that you describe.
>> >>>> This can be done by
>> >>>>
>> >>>> a) nesting two InfModels one that works on your specific rules and
>> one
>> >>>> that uses some kind of RDFS or
>> >>>> b) adding the particular rules to your set of rules
>> >>>>
>> >>>>> Ok sorry Dave, actually I did not completely understand your answer.
>> >>>>>
>> >>>>> "You could have an inference model with the appropriate
>> configuration
>> >> to
>> >>>>> deduce membership of employee"
>> >>>>>
>> >>>>> Yes I have the inference model:
>> >>>>>  Reasoner reasoner = new GenericRuleReasoner(Rule.parse
>> Rules(rule));
>> >>>>> InfModel infer = ModelFactory.createInfModel(reasoner,
>> model);
>> >>>>>
>> >>>>> Query query = QueryFactory.create(queryString);
>> >>>>>
>> >>>>>  QueryExecution qe = QueryExecutionFactory.create(query,
>> infer);
>> >>>>>
>> >>>>> What additionally I have to do apart from my Jena rule (Forward
>> Chain)
>> >>>>> mentioned in previous email and the inference model.
>> >>>>>
>> >>>>> And of course, I will have a SPARQL query :
>> >>>>> Select *
>> >>>>> where{ ?x rdf:type emp:QualifiedEmployee }
>> >>>>>
>> >>>>> On Tue, Nov 22, 2016 at 6:03 PM, Dave Reynolds <
>> >>>> dave.e.reyno...@gmail.com>
>> >>>>> wrote:
&

Re: Super classes/Sub classes in Jena rules

2016-11-25 Thread tina sani
So all I should so is to create rdfs model:

InfModel inf2 = ModelFactory.createRDFSModel();

What would be the arguments of the ModelFactory.createRDFSModel(). I
have two models here, one the simple non inference model and other the
inference model : InfModel inf = ModelFactory.createInfModel(reasoner,
model);




On Fri, Nov 25, 2016 at 3:59 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
>
> > Yes I use GenericRuleReasoner, so using the following rules along with my
> > own rules will solve the problem?
> >
> > ?x rdfs:subClassOf emp:ContractEmployee--> ?x rdfs:subClassOf
> emp:Employee
> > ?x rdfs:subClassOf emp:PermanantEmployee--> ?x rdfs:subClassOf
> emp:Employee
> That might be incomplete as rdfs:subClassOf is transitive. Simply use
> the RDFS reasoning.
> >
> > On Thu, Nov 24, 2016 at 11:39 AM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >>>  If I pass OntModelSpec.OWL_MEM_MICRO_RULE_INF” to the OntModel, will
> >> it do
> >>> the RDFS reasoning?
> >> See [1] in general and in particular [2] which shows how to setup an
> >> RDFS reasoner
> >>
> >> InfModel inf = ModelFactory.createRDFSModel(rdfsExample);
> >>
> >> or
> >>
> >> Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
> >> InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
> >>
> >> [1] https://jena.apache.org/documentation/inference/ [2]
> >> https://jena.apache.org/documentation/inference/#generalExamples
> >>> b) adding the particular rules to your set of rules
> >>>  I have already created the rules, mentioned in my first email. You
> means
> >>> rules other than that?
> >> I don't know how you setup your rules, but if you use the
> >> GenericRuleReasoner it does only apply your rules and you would have to
> >> add the rules that do the rdfs:subClass/rdf:type inference.
> >>> On Wed, Nov 23, 2016 at 11:50 AM, Lorenz B. <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
> >>>> Dave meant that you need an additional layer of reasoning like RDFS or
> >>>> even less to get the inferences that you describe.
> >>>> This can be done by
> >>>>
> >>>> a) nesting two InfModels one that works on your specific rules and one
> >>>> that uses some kind of RDFS or
> >>>> b) adding the particular rules to your set of rules
> >>>>
> >>>>> Ok sorry Dave, actually I did not completely understand your answer.
> >>>>>
> >>>>> "You could have an inference model with the appropriate configuration
> >> to
> >>>>> deduce membership of employee"
> >>>>>
> >>>>> Yes I have the inference model:
> >>>>>  Reasoner reasoner = new GenericRuleReasoner(Rule.parseRules(rule));
> >>>>> InfModel infer = ModelFactory.createInfModel(reasoner,
> model);
> >>>>>
> >>>>> Query query = QueryFactory.create(queryString);
> >>>>>
> >>>>>  QueryExecution qe = QueryExecutionFactory.create(query, infer);
> >>>>>
> >>>>> What additionally I have to do apart from my Jena rule (Forward
> Chain)
> >>>>> mentioned in previous email and the inference model.
> >>>>>
> >>>>> And of course, I will have a SPARQL query :
> >>>>> Select *
> >>>>> where{ ?x rdf:type emp:QualifiedEmployee }
> >>>>>
> >>>>> On Tue, Nov 22, 2016 at 6:03 PM, Dave Reynolds <
> >>>> dave.e.reyno...@gmail.com>
> >>>>> wrote:
> >>>>>
> >>>>>> On 22/11/16 14:56, tina sani wrote:
> >>>>>>
> >>>>>>> Let me explain a bit.
> >>>>>>>
> >>>>>>> String rule = "[rule1:(?x http://www.w3.org/1999/02/22-
> >>>> rdf-syntax-ns#type
> >>>>>>> http://www.semanticweb.org#Employee) "
> >>>>>>> + "( ?x http://www.semanticweb.org#Salary  ?salary
> >> )"
> >>>>>>> + "greaterThan(?salary, 10,00) "
> >>>>>>> + " ->  (?x http://www.w3.org/1999/02/22-r
> >>>>>>> df-syntax-ns#type
> >>>>>>&

Re: Super classes/Sub classes in Jena rules

2016-11-25 Thread tina sani
Yes I use GenericRuleReasoner, so using the following rules along with my
own rules will solve the problem?

?x rdfs:subClassOf emp:ContractEmployee--> ?x rdfs:subClassOf emp:Employee
?x rdfs:subClassOf emp:PermanantEmployee--> ?x rdfs:subClassOf emp:Employee

On Thu, Nov 24, 2016 at 11:39 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
> >  If I pass OntModelSpec.OWL_MEM_MICRO_RULE_INF” to the OntModel, will
> it do
> > the RDFS reasoning?
> See [1] in general and in particular [2] which shows how to setup an
> RDFS reasoner
>
> InfModel inf = ModelFactory.createRDFSModel(rdfsExample);
>
> or
>
> Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
> InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
>
> [1] https://jena.apache.org/documentation/inference/ [2]
> https://jena.apache.org/documentation/inference/#generalExamples
> >
> > b) adding the particular rules to your set of rules
> >  I have already created the rules, mentioned in my first email. You means
> > rules other than that?
> I don't know how you setup your rules, but if you use the
> GenericRuleReasoner it does only apply your rules and you would have to
> add the rules that do the rdfs:subClass/rdf:type inference.
> >
> > On Wed, Nov 23, 2016 at 11:50 AM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> Dave meant that you need an additional layer of reasoning like RDFS or
> >> even less to get the inferences that you describe.
> >> This can be done by
> >>
> >> a) nesting two InfModels one that works on your specific rules and one
> >> that uses some kind of RDFS or
> >> b) adding the particular rules to your set of rules
> >>
> >>> Ok sorry Dave, actually I did not completely understand your answer.
> >>>
> >>> "You could have an inference model with the appropriate configuration
> to
> >>> deduce membership of employee"
> >>>
> >>> Yes I have the inference model:
> >>>  Reasoner reasoner = new GenericRuleReasoner(Rule.parseRules(rule));
> >>> InfModel infer = ModelFactory.createInfModel(reasoner, model);
> >>>
> >>> Query query = QueryFactory.create(queryString);
> >>>
> >>>  QueryExecution qe = QueryExecutionFactory.create(query, infer);
> >>>
> >>> What additionally I have to do apart from my Jena rule (Forward Chain)
> >>> mentioned in previous email and the inference model.
> >>>
> >>> And of course, I will have a SPARQL query :
> >>> Select *
> >>> where{ ?x rdf:type emp:QualifiedEmployee }
> >>>
> >>> On Tue, Nov 22, 2016 at 6:03 PM, Dave Reynolds <
> >> dave.e.reyno...@gmail.com>
> >>> wrote:
> >>>
> >>>> On 22/11/16 14:56, tina sani wrote:
> >>>>
> >>>>> Let me explain a bit.
> >>>>>
> >>>>> String rule = "[rule1:(?x http://www.w3.org/1999/02/22-
> >> rdf-syntax-ns#type
> >>>>> http://www.semanticweb.org#Employee) "
> >>>>> + "( ?x http://www.semanticweb.org#Salary  ?salary
> )"
> >>>>> + "greaterThan(?salary, 10,00) "
> >>>>> + " ->  (?x http://www.w3.org/1999/02/22-r
> >>>>> df-syntax-ns#type
> >>>>> http://www.semanticweb.org#QualifiedEmployee. )]"
> >>>>>
> >>>>>
> >>>>> Classes in my ontology are
> >>>>>
> >>>>> Employee (Super class of all employees)
> >>>>>* ContractEmployee*  (Subclass of Employee)
> >>>>>FinanceManager
> >>>>> ITManager  (Subclasses of ContractEmployee)
> >>>>>* PermanantEmployee   *(Subclass of Employee)
> >>>>> Analyst
> >>>>> Programmer
> >>>>>
> >>>>> In this case, will I use ?x rdf:type Employee  or  ?x rdf:type
> >>>>>  ContractEmployee
> >>>>> All the instances are either from subclasses  * FinanceManager ,
> >> ITManager
> >>>>> or Analyst, Programmer*
> >>>>>
> >>>>> *Is it must that if I use ?x rdf:type Employee, then FinanceManager &
> >>>>> ITManager should also be sub classes of general super class
> "Employ

Re: Super classes/Sub classes in Jena rules

2016-11-22 Thread tina sani
Ok sorry Dave, actually I did not completely understand your answer.

"You could have an inference model with the appropriate configuration to
deduce membership of employee"

Yes I have the inference model:
 Reasoner reasoner = new GenericRuleReasoner(Rule.parseRules(rule));
InfModel infer = ModelFactory.createInfModel(reasoner, model);

Query query = QueryFactory.create(queryString);

 QueryExecution qe = QueryExecutionFactory.create(query, infer);

What additionally I have to do apart from my Jena rule (Forward Chain)
mentioned in previous email and the inference model.

And of course, I will have a SPARQL query :
Select *
where{ ?x rdf:type emp:QualifiedEmployee }

On Tue, Nov 22, 2016 at 6:03 PM, Dave Reynolds <dave.e.reyno...@gmail.com>
wrote:

>
>
> On 22/11/16 14:56, tina sani wrote:
>
>> Let me explain a bit.
>>
>> String rule = "[rule1:(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
>> http://www.semanticweb.org#Employee) "
>> + "( ?x http://www.semanticweb.org#Salary  ?salary )"
>> + "greaterThan(?salary, 10,00) "
>> + " ->  (?x http://www.w3.org/1999/02/22-r
>> df-syntax-ns#type
>> http://www.semanticweb.org#QualifiedEmployee. )]"
>>
>>
>> Classes in my ontology are
>>
>> Employee (Super class of all employees)
>>* ContractEmployee*  (Subclass of Employee)
>>FinanceManager
>> ITManager  (Subclasses of ContractEmployee)
>>* PermanantEmployee   *(Subclass of Employee)
>> Analyst
>> Programmer
>>
>> In this case, will I use ?x rdf:type Employee  or  ?x rdf:type
>>  ContractEmployee
>> All the instances are either from subclasses  * FinanceManager , ITManager
>> or Analyst, Programmer*
>>
>> *Is it must that if I use ?x rdf:type Employee, then FinanceManager &
>> ITManager should also be sub classes of general super class "Employee" ?*
>>
>
> I don't think any of these details change my earlier answer, quoted below.
>
> Dave
>
>
> On Tue, Nov 22, 2016 at 5:30 PM, Dave Reynolds <dave.e.reyno...@gmail.com>
>> wrote:
>>
>> On 22/11/16 10:12, tina sani wrote:
>>>
>>> Inline image 1
>>>>
>>>>
>>> The mail list doesn't support attachments so the image didn't come
>>> through.
>>>
>>> However, I'm guessing it included a class Employee with sub-classes
>>> ContractEmployee and PermanantEmployee.
>>>
>>> I have this ontology: Now if I want to use some rules like
>>>
>>>>
>>>> if x rdf:type Employee and ?x salary>Euro10,000. then ?x
>>>> QualifiedEmployee.
>>>>
>>>> My question here is should I use ?x rdf:type Employee or ?x rdf:type
>>>> ContractEmployee or PermanantEmployee
>>>>
>>>>
>>> Depends on your set up.
>>>
>>> You could have an inference model with the appropriate configuration to
>>> deduce membership of employee and then query that with SPARQL or with a
>>> second inference model with your own rules in.
>>>
>>> If you want just one layer of rules and want to combine OWL/RDFS with
>>> your
>>> custom rules then that's possible (so long as you set all the appropriate
>>> flags, see documentation) but make sure that your own rules are backward
>>> not forward rules. [The default Jena rule sets for RDFS and OWL are
>>> hybrid
>>> rules so some of the inferences are only available to backward rules in
>>> the
>>> same rule set.]
>>>
>>> Or if you don't want the cost of full inference then you can indeed
>>> rewrite the "natural" query to explicitly check for the base memberships.
>>>
>>> Dave
>>>
>>>
>>


Re: Super classes/Sub classes in Jena rules

2016-11-22 Thread tina sani
Let me explain a bit.

String rule = "[rule1:(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.semanticweb.org#Employee) "
+ "( ?x http://www.semanticweb.org#Salary  ?salary )"
+ "greaterThan(?salary, 10,00) "
+ " ->  (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.semanticweb.org#QualifiedEmployee. )]"


Classes in my ontology are

Employee (Super class of all employees)
   * ContractEmployee*  (Subclass of Employee)
   FinanceManager
ITManager  (Subclasses of ContractEmployee)
   * PermanantEmployee   *(Subclass of Employee)
Analyst
Programmer

In this case, will I use ?x rdf:type Employee  or  ?x rdf:type
 ContractEmployee
All the instances are either from subclasses  * FinanceManager , ITManager
or Analyst, Programmer*

*Is it must that if I use ?x rdf:type Employee, then FinanceManager &
ITManager should also be sub classes of general super class "Employee" ?*

On Tue, Nov 22, 2016 at 5:30 PM, Dave Reynolds <dave.e.reyno...@gmail.com>
wrote:

> On 22/11/16 10:12, tina sani wrote:
>
>> Inline image 1
>>
>
> The mail list doesn't support attachments so the image didn't come through.
>
> However, I'm guessing it included a class Employee with sub-classes
> ContractEmployee and PermanantEmployee.
>
> I have this ontology: Now if I want to use some rules like
>>
>> if x rdf:type Employee and ?x salary>Euro10,000. then ?x
>> QualifiedEmployee.
>>
>> My question here is should I use ?x rdf:type Employee or ?x rdf:type
>> ContractEmployee or PermanantEmployee
>>
>
> Depends on your set up.
>
> You could have an inference model with the appropriate configuration to
> deduce membership of employee and then query that with SPARQL or with a
> second inference model with your own rules in.
>
> If you want just one layer of rules and want to combine OWL/RDFS with your
> custom rules then that's possible (so long as you set all the appropriate
> flags, see documentation) but make sure that your own rules are backward
> not forward rules. [The default Jena rule sets for RDFS and OWL are hybrid
> rules so some of the inferences are only available to backward rules in the
> same rule set.]
>
> Or if you don't want the cost of full inference then you can indeed
> rewrite the "natural" query to explicitly check for the base memberships.
>
> Dave
>


Super classes/Sub classes in Jena rules

2016-11-22 Thread tina sani
[image: Inline image 1]

I have this ontology: Now if I want to use some rules like

if x rdf:type Employee and ?x salary>Euro10,000. then ?x QualifiedEmployee.

My question here is should I use ?x rdf:type Employee or ?x rdf:type
ContractEmployee or PermanantEmployee

ContractEmployee or PermanantEmployee does not have any instances, all
instances will be either FinanceManager, ITManager, Developer or Analyst..


Re: Queries against rules

2016-11-09 Thread tina sani
Hello Lorenz, I know rules generate new tripls based on existed data, but I
have to questions:

(1) We have a model i-e model before Jena rules executes and then after
inference/rules, our model will be inf, right? If we want to write a model,
we will use inf.write()?

(2) My second query is, after rules, I will have several SPARQL queries run
against the rules so what will be the order in which we write/run queries.
It will be like queryString, execute query, then another queryString,
execute query?

Regards

On Wed, Nov 9, 2016 at 10:37 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
> > Hello
> > I have a text file, having more than twenty Jena rules. Usually we need
> > SPARQL queries to execute and display the inference results.
> >
> > For my twenty rules, I need more or less ten queries, so what will be the
> > sequence and proper way to use SPARQL queries?
> What means "query for a rule"?
> Rules are used to infer(generate) additional data based on existing data.
>
> 1) Load all rules into a the GenericRuleReasoner and apply it on the
> original data -> you get a new model
>
> Reasoner reasoner = new GenericRuleReasoner(Rule.parseRules(rules));
> InfModel inf = ModelFactory.createInfModel(reasoner, rawData);
>
>
> 2) execute the SPARQL query against the new model which contains all the
> data
>
> Lorenz
> > I have some inverse property rules, symmetric, transitive and most are
> Jena
> > generic rules used in the text file.
> >
> > Thanks a lot.
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Queries against rules

2016-11-08 Thread tina sani
Hello David, I am sorry but I did not understand "use OWL rules in your
model to create relationships between objects"

The Jena rules we use are not OWL specific? You mean rules in the Protege?

On Tue, Nov 8, 2016 at 7:16 PM, David Moss <admo...@gmail.com> wrote:

> It is my understanding that you use OWL rules in your model to create
> relationships between objects.
> You can then query the model using SPARQL and a reasoner.
> The SPARQL will then not only return the triples explicitly matched, but
> those that can be inferred using the rules too.
>
> See https://jena.apache.org/documentation/inference/
>
>
>
>
>
> On 9/11/16, 2:31 am, "tina sani" <tinamadri...@gmail.com> wrote:
>
> Hello
> I have a text file, having more than twenty Jena rules. Usually we need
> SPARQL queries to execute and display the inference results.
>
> For my twenty rules, I need more or less ten queries, so what will be
> the
> sequence and proper way to use SPARQL queries?
> I have some inverse property rules, symmetric, transitive and most are
> Jena
> generic rules used in the text file.
>
> Thanks a lot.
>
>
>
>


Queries against rules

2016-11-08 Thread tina sani
Hello
I have a text file, having more than twenty Jena rules. Usually we need
SPARQL queries to execute and display the inference results.

For my twenty rules, I need more or less ten queries, so what will be the
sequence and proper way to use SPARQL queries?
I have some inverse property rules, symmetric, transitive and most are Jena
generic rules used in the text file.

Thanks a lot.


Re: [ANNOUNCE] Lorenz Buehmann elected as Committer

2016-11-02 Thread tina sani
Congrats Lorenz.

On Wed, Nov 2, 2016 at 4:31 PM, David Moss  wrote:

>
>  Congratulations, Lorenz!
> Thanks for putting in the effort.
> DM
>
>
>


Re: Use variable in SPARQL query

2016-11-02 Thread tina sani
The value of employee is either Manager or Technical. When user enter
Manager, I want the query to show instances of Manager class and when
Technical, it will show instances of Technical class.
And yes, I have used all the prefixes with full URI in my query.

On Wed, Nov 2, 2016 at 1:02 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> WHAT is a concrete value of the variable 'employee'?
>
> And, full  URIs have to be put between '<' and '>'
>
> > Lorenz, this does not work for me:
> >
> > Select * where{?emp rdf:type "+employee+"}";
> >
> > employee variable is : String employee; have values Manager or Technical
> > depend on user input.
> >
> > On Wed, Nov 2, 2016 at 10:48 AM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> It should be clear that String concatenation calls the toString() method
> >> of your object. We don't know how this is implemented in your code
> though.
> >>
> >>> Will simply putting a variable inside a query work?
> >>>
> >>> {?emp rdf:type "+employee+"}";
> >>>
> >>> On Tue, Nov 1, 2016 at 6:13 PM, lookman sanni <lookous...@gmail.com>
> >> wrote:
> >>>> Hi Tina,
> >>>>
> >>>> You can have your query stored in a composed java string (e.g. String
> >> query
> >>>> = "Select blablabla where { ?emp rdf:type " + someJavaVariable + "}"
> >>>>
> >>>> Hope that helps
> >>>> Le 1 nov. 2016 17:02, "tina sani" <tinamadri...@gmail.com> a écrit :
> >>>>
> >>>>> Hello.
> >>>>>
> >>>>> How can I use a Java variable in the SPARQL query.
> >>>>> ?emp rdf:type ?SomeVariable
> >>>>>
> >>>>> I want rdf:type of Managers and Technicals while these two
> >>>> values(Managers
> >>>>> and Technicals) are in my Java variable: employee.
> >>>>>
> >>>>> So I need something like:
> >>>>>
> >>>>> ?emp rdf:type "employee"
> >>>>>
> >>>>> Regards
> >>>>>
> >> --
> >> Lorenz Bühmann
> >> AKSW group, University of Leipzig
> >> Group: http://aksw.org - semantic web research center
> >>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Use variable in SPARQL query

2016-11-02 Thread tina sani
Lorenz, this does not work for me:

Select * where{?emp rdf:type "+employee+"}";

employee variable is : String employee; have values Manager or Technical
depend on user input.

On Wed, Nov 2, 2016 at 10:48 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> It should be clear that String concatenation calls the toString() method
> of your object. We don't know how this is implemented in your code though.
>
> > Will simply putting a variable inside a query work?
> >
> > {?emp rdf:type "+employee+"}";
> >
> > On Tue, Nov 1, 2016 at 6:13 PM, lookman sanni <lookous...@gmail.com>
> wrote:
> >
> >> Hi Tina,
> >>
> >> You can have your query stored in a composed java string (e.g. String
> query
> >> = "Select blablabla where { ?emp rdf:type " + someJavaVariable + "}"
> >>
> >> Hope that helps
> >> Le 1 nov. 2016 17:02, "tina sani" <tinamadri...@gmail.com> a écrit :
> >>
> >>> Hello.
> >>>
> >>> How can I use a Java variable in the SPARQL query.
> >>> ?emp rdf:type ?SomeVariable
> >>>
> >>> I want rdf:type of Managers and Technicals while these two
> >> values(Managers
> >>> and Technicals) are in my Java variable: employee.
> >>>
> >>> So I need something like:
> >>>
> >>> ?emp rdf:type "employee"
> >>>
> >>> Regards
> >>>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Use variable in SPARQL query

2016-11-01 Thread tina sani
Will simply putting a variable inside a query work?

{?emp rdf:type "+employee+"}";

On Tue, Nov 1, 2016 at 6:13 PM, lookman sanni <lookous...@gmail.com> wrote:

> Hi Tina,
>
> You can have your query stored in a composed java string (e.g. String query
> = "Select blablabla where { ?emp rdf:type " + someJavaVariable + "}"
>
> Hope that helps
> Le 1 nov. 2016 17:02, "tina sani" <tinamadri...@gmail.com> a écrit :
>
> > Hello.
> >
> > How can I use a Java variable in the SPARQL query.
> > ?emp rdf:type ?SomeVariable
> >
> > I want rdf:type of Managers and Technicals while these two
> values(Managers
> > and Technicals) are in my Java variable: employee.
> >
> > So I need something like:
> >
> > ?emp rdf:type "employee"
> >
> > Regards
> >
>


Use variable in SPARQL query

2016-11-01 Thread tina sani
Hello.

How can I use a Java variable in the SPARQL query.
?emp rdf:type ?SomeVariable

I want rdf:type of Managers and Technicals while these two values(Managers
and Technicals) are in my Java variable: employee.

So I need something like:

?emp rdf:type "employee"

Regards


proper way of Jena rules use

2016-10-21 Thread tina sani
Hi

What is the proper way to use Jena rules in our application(s) ?

(1) Inside code (Eclipse, etc)
(2) using some text file and then imports it.

In second case, what will be then the order of rules execution?


Re: addliteral() vs setpropertyvalue()

2016-10-17 Thread tina sani
Yes its true that it returns Null Pointer Exception.

But what you people suggest I suppose to do? One thing in my mind is to
include first:
employee.addLiteral(Property, 1)
Then employee.getPropertyValue()
Then Perform calculation/addition
And last, employee.setPropertyValue(Property, sum/calculated value).


On Mon, Oct 17, 2016 at 12:52 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Hello Tina,
>
>
>
>
> > I want to sum 5 with the value already stored in a property.
> >
> > //Property "Hours" must be started from 1 and then sum 5 with it.
> > employee.getPropertyValue(No_of_Hours);
> > //Then perform calculations.
> >
> > The problem is that if I directly use employee.getPropertyValue(), it
> gives
> > me "Exception" (and rightly, because I did not set setPropertyValue()
> > first).
> That's not true. It returns null if there is no such value - and you
> have to handle this in the code indeed.
> >
> > But the problem is that when I set employee.getPropertyValue(No_
> of_Hours);
> >  to 1 (one), it will always set the value 1(one) and not the recent
> > added(sum) value in the property.
> >
> > employee.setPropertyValue(No_of_Hours, 1); //1 is literal
> > employee.getPropertyValue(No_of_Hours);
> > //calculations
> > My requirement is like: int sum=No_of_Hours+1;
> > Then No_of_Hours plus what in the *variable sum*.
> >
> > So can I use employee.addLiteral(No_of_Hours, 1) instead of
> > employee.setPropertyValue().
> >
> > I hope you have understood what my issue is?
> >
> > Kindest regards
> >
> >
> >
> > On Sun, Oct 16, 2016 at 11:10 AM, Dave Reynolds <
> dave.e.reyno...@gmail.com>
> > wrote:
> >
> >> On 16/10/16 16:59, tina sani wrote:
> >>
> >>> Hi
> >>>
> >>> What is the difference between addLiteral() and setpropertyvalue()
> when we
> >>> want to assign values to an individual.?
> >>> For example,
> >>>
> >>> //myEmployee is an instance.
> >>>
> >>> myEmplyee.addliteral(property, value)
> >>> myEmployee.setpropertyvalue(property, value)
> >>>
> >>>
> >> addLiteral adds a value, so if there is already a value there you will
> now
> >> have multiple values.
> >>
> >> setPropertyValue removes all existing values before adding the new value
> >> so you will only have the new value at the end.
> >>
> >> Dave
> >>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: addliteral() vs setpropertyvalue()

2016-10-16 Thread tina sani
I want to sum 5 with the value already stored in a property.

//Property "Hours" must be started from 1 and then sum 5 with it.
employee.getPropertyValue(No_of_Hours);
//Then perform calculations.

The problem is that if I directly use employee.getPropertyValue(), it gives
me "Exception" (and rightly, because I did not set setPropertyValue()
first).

But the problem is that when I set employee.getPropertyValue(No_of_Hours);
 to 1 (one), it will always set the value 1(one) and not the recent
added(sum) value in the property.

employee.setPropertyValue(No_of_Hours, 1); //1 is literal
employee.getPropertyValue(No_of_Hours);
//calculations
My requirement is like: int sum=No_of_Hours+1;
Then No_of_Hours plus what in the *variable sum*.

So can I use employee.addLiteral(No_of_Hours, 1) instead of
employee.setPropertyValue().

I hope you have understood what my issue is?

Kindest regards



On Sun, Oct 16, 2016 at 11:10 AM, Dave Reynolds <dave.e.reyno...@gmail.com>
wrote:

> On 16/10/16 16:59, tina sani wrote:
>
>> Hi
>>
>> What is the difference between addLiteral() and setpropertyvalue() when we
>> want to assign values to an individual.?
>> For example,
>>
>> //myEmployee is an instance.
>>
>> myEmplyee.addliteral(property, value)
>> myEmployee.setpropertyvalue(property, value)
>>
>>
> addLiteral adds a value, so if there is already a value there you will now
> have multiple values.
>
> setPropertyValue removes all existing values before adding the new value
> so you will only have the new value at the end.
>
> Dave
>
>


addliteral() vs setpropertyvalue()

2016-10-16 Thread tina sani
Hi

What is the difference between addLiteral() and setpropertyvalue() when we
want to assign values to an individual.?
For example,

//myEmployee is an instance.

myEmplyee.addliteral(property, value)
myEmployee.setpropertyvalue(property, value)


Inference model or Model

2016-10-07 Thread tina sani
Hello, if I we have a model1 (not inference model) and we make changes to
the ontology through that model.
We have an inference model also (InfModel) and changed the ontology after
executing some rules.
Then if we have to write the changes to the disk, should we write both the
models to disk or inference model works for both cases?

Regards


instanceof

2016-10-02 Thread tina sani
I have Employee class and "Managers" and "Technicals" as two sub classes of
Employee.
Bob is instance of sub class Technical, how can I get like this:

If Bob instance of Technicals, then do something:

OntClass mgr = model.getOntClass(ns + "Managers");
 OntClass  tech = model.getOntClass(ns + "Technicals");

OntClass emp = model.getOntClass(ns + "Employee");
Individual ind = tech.createIndividual(ns + "Bob");

I am trying like below but it flush an error message.

 if (ind instanceof tech){}


Construct query

2016-09-29 Thread tina sani
I want to know about the Construct query.
How it differs from Select query
Is it create a new property/class which is not already in the ontology or
it just creates new triples.
I will appreciate if some one come with a simple example. I have searched
web, but could not grasp it.


Re: Date Object does not give correct Date and Time

2016-09-25 Thread tina sani
Thank you A. Soroka.

On Sun, Sep 25, 2016 at 6:24 AM, A. Soroka <aj...@virginia.edu> wrote:

> That is not like any normal return value for such a literal. Please give
> the actual output.
>
> It is likely in a different time zone than your local time zone. See:
>
> https://stackoverflow.com/questions/24978636/jena-
> storing-date-in-xml-datetime-unexpected-behaviour/24982714#24982714
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Sep 25, 2016, at 9:01 AM, tina sani <tinamadri...@gmail.com> wrote:
> >
> > It gives me 22.59 but my system current time is 3:59 PM .
> >
> > On Sun, Sep 25, 2016 at 5:57 AM, A. Soroka <aj...@virginia.edu> wrote:
> >
> >> Please explain what you expect to get, and what you actually get.
> >>
> >> ---
> >> A. Soroka
> >> The University of Virginia Library
> >>
> >>> On Sep 25, 2016, at 8:53 AM, tina sani <tinamadri...@gmail.com> wrote:
> >>>
> >>> I want to display the current Date and/or Time of the system, but it
> does
> >>> not give me the correct system date and time.
> >>>
> >>> Calendar cal = GregorianCalendar.getInstance();
> >>> Literal value = model.createTypedLiteral(cal);
> >>>   individual.addLiteral(date, value);  //date is property name
> >>
> >>
>
>


Re: Date Object does not give correct Date and Time

2016-09-25 Thread tina sani
It gives me 22.59 but my system current time is 3:59 PM .

On Sun, Sep 25, 2016 at 5:57 AM, A. Soroka <aj...@virginia.edu> wrote:

> Please explain what you expect to get, and what you actually get.
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Sep 25, 2016, at 8:53 AM, tina sani <tinamadri...@gmail.com> wrote:
> >
> > I want to display the current Date and/or Time of the system, but it does
> > not give me the correct system date and time.
> >
> > Calendar cal = GregorianCalendar.getInstance();
> > Literal value = model.createTypedLiteral(cal);
> >individual.addLiteral(date, value);  //date is property name
>
>


Date Object does not give correct Date and Time

2016-09-25 Thread tina sani
I want to display the current Date and/or Time of the system, but it does
not give me the correct system date and time.

 Calendar cal = GregorianCalendar.getInstance();
Literal value = model.createTypedLiteral(cal);
individual.addLiteral(date, value);  //date is property name


Re: computing multiple values of single data property

2016-09-24 Thread tina sani
Well I do not know how to do  what you have comment ( re-model your
data first, such that you have a timestamp or whatever. Then you could
use SPARQL CONSTRUCT).

But I wish it could possible because it is an integral part of my project.

Regards

On Sat, Sep 24, 2016 at 4:30 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Hello Tina,
>
> as Dave said, there is no sorting for rules. You need to re-model your
> data first, such that you have a timestamp or whatever. Then you could
> use SPARQL CONSTRUCT
>
>
>
> Kind regards,
> Lorenz
>
> > My data arrives and saved randomly to my owl file: These four values are
> > the income of employee's four weeks so in week1, he earns 200, week2  300
> >  week3  150 and week4  280.
> >
> > I need some sorting in which I can describe if the Employee progresses
> each
> > week according to his salary. If he earns like 150, 200, 280, 300, then
> for
> > sure he progresses.
> >
> > Kindly if you described the required Jena rules here to accomplish this
> > goal?
> >
> > Best regards
> >
> > On Sat, Sep 24, 2016 at 1:15 AM, Dave Reynolds <
> dave.e.reyno...@gmail.com>
> > wrote:
> >
> >> On 23/09/16 23:17, tina sani wrote:
> >>
> >>> For instance, I have a data property employee_income which have four
> >>> values
> >>> for each employee. Employee1 have income Euro 200, Euro 300, Euro 150,
> and
> >>> Euro 280 .
> >>>
> >>> Is there any way using Jena rules or other way, in which we
> >>> compute/compare
> >>> these values in some ascending or descending way. The purpose of doing
> so
> >>> is to find out whether the employee progresses or not. If she earns in
> >>> ascending order like 150, 200, 280 and 300 Euro, it means progresses.
> >>>
> >>> Thanks for understanding.
> >>>
> >> If you mean you have simply four copies of the property then they aren't
> >> ordered. E.g.
> >>
> >>:employee  :employee_income 150, 200, 280, 300 .
> >>
> >> is exactly the same set of RDF triples as:
> >>
> >>:employee  :employee_income 300, 200, 150, 280 .
> >>
> >> and
> >>
> >>:employee  :employee_income 300 .
> >>:employee  :employee_income 200 .
> >>:employee  :employee_income 280 .
> >>:employee  :employee_income 150 .
> >>
> >> triples aren't ordered.
> >>
> >> You can certainly use SPARQL to query for values and to sort them.
> >>
> >> If you want to test if the income increased in order then you need to
> >> represent either the date of the income or the order in which the income
> >> arrived in your data. Once you've decided how you will do that then
> there
> >> will be ways in SPARQL or rules to do the test for progression.
> >>
> >> Dave
> >>
> >>
> >>
> >>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: computing multiple values of single data property

2016-09-24 Thread tina sani
My data arrives and saved randomly to my owl file: These four values are
the income of employee's four weeks so in week1, he earns 200, week2  300
 week3  150 and week4  280.

I need some sorting in which I can describe if the Employee progresses each
week according to his salary. If he earns like 150, 200, 280, 300, then for
sure he progresses.

Kindly if you described the required Jena rules here to accomplish this
goal?

Best regards

On Sat, Sep 24, 2016 at 1:15 AM, Dave Reynolds <dave.e.reyno...@gmail.com>
wrote:

> On 23/09/16 23:17, tina sani wrote:
>
>> For instance, I have a data property employee_income which have four
>> values
>> for each employee. Employee1 have income Euro 200, Euro 300, Euro 150, and
>> Euro 280 .
>>
>> Is there any way using Jena rules or other way, in which we
>> compute/compare
>> these values in some ascending or descending way. The purpose of doing so
>> is to find out whether the employee progresses or not. If she earns in
>> ascending order like 150, 200, 280 and 300 Euro, it means progresses.
>>
>> Thanks for understanding.
>>
>
> If you mean you have simply four copies of the property then they aren't
> ordered. E.g.
>
>:employee  :employee_income 150, 200, 280, 300 .
>
> is exactly the same set of RDF triples as:
>
>:employee  :employee_income 300, 200, 150, 280 .
>
> and
>
>:employee  :employee_income 300 .
>:employee  :employee_income 200 .
>:employee  :employee_income 280 .
>:employee  :employee_income 150 .
>
> triples aren't ordered.
>
> You can certainly use SPARQL to query for values and to sort them.
>
> If you want to test if the income increased in order then you need to
> represent either the date of the income or the order in which the income
> arrived in your data. Once you've decided how you will do that then there
> will be ways in SPARQL or rules to do the test for progression.
>
> Dave
>
>
>
>
>


computing multiple values of single data property

2016-09-23 Thread tina sani
For instance, I have a data property employee_income which have four values
for each employee. Employee1 have income Euro 200, Euro 300, Euro 150, and
Euro 280 .

Is there any way using Jena rules or other way, in which we compute/compare
these values in some ascending or descending way. The purpose of doing so
is to find out whether the employee progresses or not. If she earns in
ascending order like 150, 200, 280 and 300 Euro, it means progresses.

Thanks for understanding.


Picture of Dbpedia resource

2016-09-22 Thread tina sani
Hi

If I download the depiction/picture from Dbpedia about a resource such as
Berlin, import it in Protege as:

 
"Coat_of_arms_of_Berlin.svg"

Then how can I display it using Jena code.


fuzzy value in current ontology

2016-08-24 Thread tina sani
Hi
I have an ontology which covers all the information about student i-e his
personal data plus his academic data.

In some part of the ontology, I need to keep the values as fuzzy like I
want to define a student as good, average or below average.

I want to ask can I make my current ontology as fuzzy based by installing
some plugins to Protege or it must be created from scratch in order to make
it a fuzzy based ontology?

Best wishes


Rdf Streaming

2016-08-18 Thread tina sani
Is there any support of Jena API for RDF Streaming? I know RDF streaming is
something which you can not store but still I am wonder if Jena is
supported or some other API is used for it?

I have read it theoretically but do not know how to implement it? CSPARQL
is one tool I hear about it but I dont think it will be the only tool to
deal with RDF stream data.


Re: Vague knowledge in Ontologies

2016-07-29 Thread tina sani
Hello Kinoshita.

I have tried to download the Protege plugn, copy the FuzzyOWL2PlugIn.jar
into Protege plugin folder, and copy the dlib folder into the Protege folder

When I tried to run the protege (Windows Batch File), protege does not
launches and flushes an error of Unknown source.

If you can provide me your email, I will write you in private because this
mailing list belongs to jena



On Fri, Jul 29, 2016 at 3:45 AM, Bruno P. Kinoshita <ki...@apache.org>
wrote:

> Hi Tina
>
>
> Someone posted similar question some time ago.
>
> I started my involvement with Apache Commons, because I needed some
> functional programming
> features for a fuzzy logic Java API (that was before Java 8).
>
> One pointer from the thread of the other question, was that Protege has a
> plug-in for
> using not just crisp predicates, but also fuzzy predicates, with your
> ontology.
>
> Here's the link
>
> http://www.umbertostraccia.it/cs/software/FuzzyOWL/
>
> The way it works, basically, is by having an ontology, with a reasoner
> that is able
> to convert certain fuzzy values and query the ontology.
>
> In you example, you would have to build fuzzy membership functions for
> useful, very useful, and
> useless. Then the reasoner would do the rest for you.
>
> You can have a look at existing reasoners that support fuzziness, and then
> either
> use Java to query your ontology with the reasoner, or try to integrate
> with the web
> interface - if necessary.
>
> Hope that helps
> Bruno
> >
> > From: tina sani <tinamadri...@gmail.com>
> >To: users@jena.apache.org
> >Sent: Friday, 29 July 2016 10:23 PM
> >Subject: Vague knowledge in Ontologies
> >
> >
> >How can we use the vague information, fuzzy based, in our ontologies.
> >Is it possible that we embed it into the already existed domain
> ontologies?
> >I will appreciate if some one share a working examples.
> >I have an ontology in which two of the classes needs fuzzy values like
> >useful, very useful and useless. How I will be able to do it without much
> >changes to my original ontology.
> >
> >with regards
> >
> >
> >
>


Re: Vague knowledge in Ontologies

2016-07-29 Thread tina sani
I really appreciate David Moss. I need some time to read the link you
provided and then will come to you, I hope, with some idea.

I hope it helps.

with regards



On Fri, Jul 29, 2016 at 3:45 AM, Bruno P. Kinoshita <ki...@apache.org>
wrote:

> Hi Tina
>
>
> Someone posted similar question some time ago.
>
> I started my involvement with Apache Commons, because I needed some
> functional programming
> features for a fuzzy logic Java API (that was before Java 8).
>
> One pointer from the thread of the other question, was that Protege has a
> plug-in for
> using not just crisp predicates, but also fuzzy predicates, with your
> ontology.
>
> Here's the link
>
> http://www.umbertostraccia.it/cs/software/FuzzyOWL/
>
> The way it works, basically, is by having an ontology, with a reasoner
> that is able
> to convert certain fuzzy values and query the ontology.
>
> In you example, you would have to build fuzzy membership functions for
> useful, very useful, and
> useless. Then the reasoner would do the rest for you.
>
> You can have a look at existing reasoners that support fuzziness, and then
> either
> use Java to query your ontology with the reasoner, or try to integrate
> with the web
> interface - if necessary.
>
> Hope that helps
> Bruno
> >
> > From: tina sani <tinamadri...@gmail.com>
> >To: users@jena.apache.org
> >Sent: Friday, 29 July 2016 10:23 PM
> >Subject: Vague knowledge in Ontologies
> >
> >
> >How can we use the vague information, fuzzy based, in our ontologies.
> >Is it possible that we embed it into the already existed domain
> ontologies?
> >I will appreciate if some one share a working examples.
> >I have an ontology in which two of the classes needs fuzzy values like
> >useful, very useful and useless. How I will be able to do it without much
> >changes to my original ontology.
> >
> >with regards
> >
> >
> >
>


Vague knowledge in Ontologies

2016-07-29 Thread tina sani
How can we use the vague information, fuzzy based, in our ontologies.
Is it possible that we embed it into the already existed domain ontologies?
I will appreciate if some one share a working examples.
I have an ontology in which two of the classes needs fuzzy values like
useful, very useful and useless. How I will be able to do it without much
changes to my original ontology.

with regards


Re: "Pre Mature end of file"

2016-07-14 Thread tina sani
I will, currently I am away from code.

On Thu, Jul 14, 2016 at 8:47 AM, A. Soroka <aj...@virginia.edu> wrote:

> Please give us a more complete example, including data, code, and a
> complete stacktrace.
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Jul 14, 2016, at 11:46 AM, tina sani <tinamadri...@gmail.com> wrote:
> >
> > No my ontology has at least 8-10 classes and similarly properties.
> >
> > On Thu, Jul 14, 2016 at 8:41 AM, A. Soroka <aj...@virginia.edu> wrote:
> >
> >> It can be from reading an empty file. Is the file you are trying to read
> >> empty?
> >>
> >> ---
> >> A. Soroka
> >> The University of Virginia Library
> >>
> >>> On Jul 14, 2016, at 11:25 AM, tina sani <tinamadri...@gmail.com>
> wrote:
> >>>
> >>> I am getting this type of error/exception: Pre Mature end of file". Is
> >> this
> >>> coming from reading a file which is empty or something else?
> >>> I have written this code
> >>> InputStream in = FileManager.get().open( somefile
> >>> if (in == null) {
> >>> throw new IllegalArgumentException( "File: " + file + "  no file
> exist");
> >>> }
> >>> model.read(in,""); );
> >>
> >>
>
>


Uri of resource

2016-07-08 Thread tina sani
I have an Rdf file created in Protege, named Company.rdf which have several
classes and properties. The file is in C:/users/desktop/Company.rdf. The
ontology URI is www.Sales.owl

I want to add another class using Jena i-e Customer, so I am confuse about
the uri ?
I mean what will be the class Customer URI and where in the code I will
mention this uri?

**(Also is it mandatory to mention the URI because we already have to read*
*the  rdf file using FileManager.get().open( inputFileName )*


Re: creating rdf file on disk using java

2016-06-19 Thread tina sani
I do not have currently code in hand but my scenario is that I have created
an ontology for university library having information about book details,
authors, employee working in library. I will read the file in Jena code
later.

But I want to keep track of each student login to the system i-e what type
of book they search usually, at what time he visits the system so I need a
file holding just name and her Id to uniquely identify her.
I have created a file using Java (as mentioned in previous email) but dont
know how to store student login information in it?

The student does not have to register first so need for database, just keep
track of her name/ID to find their preference?

Thank you


On Sun, Jun 19, 2016 at 11:09 AM, A. Soroka <aj...@virginia.edu> wrote:

> Can you show some actual example code that you are trying to use?
> Otherwise it's difficult to say what is not right.
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Jun 19, 2016, at 10:57 AM, tina sani <tinamadri...@gmail.com> wrote:
> >
> > Actually I have already read this documentation but I did not find what I
> > am looking for exactly. In documentation, it includes something like
> > this :model.write(System.out);
> > which only writes a model to a file.
> >
> > What I needed is to create an rdf file locally on disk using Jena code
> and
> > then store some users data inside that file. Like
> > FileOutputStream fout=new FileOutputStream(
> >  "C:\\desktop//tina.rdf");
> >  model.write(fout);
> > The file on my desktop is actually created but it is an empty file but I
> > want some input from users and store it in this file which currently I am
> > not sure how to do it.
> >
> > Thank you
> >
> > <
> https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail
> >
> > Virus-free.
> > www.avast.com
> > <
> https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail
> >
> > <#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
> > On Sun, Jun 19, 2016 at 7:44 AM, A. Soroka <aj...@virginia.edu> wrote:
> >
> >> Please start with the documentation provided for exactly this purpose:
> >>
> >> https://jena.apache.org/tutorials/rdf_api.html
> >> https://jena.apache.org/getting_started/
> >>
> >> ---
> >> A. Soroka
> >> The University of Virginia Library
> >>
> >>> On Jun 19, 2016, at 12:40 AM, tina sani <tinamadri...@gmail.com>
> wrote:
> >>>
> >>> Hello all.
> >>> How can I create an RDF file using Jena and then save some data like
> >>> student name. address etc?
> >>
> >>
>
>


Re: creating rdf file on disk using java

2016-06-19 Thread tina sani
Actually I have already read this documentation but I did not find what I
am looking for exactly. In documentation, it includes something like
this :model.write(System.out);
which only writes a model to a file.

What I needed is to create an rdf file locally on disk using Jena code and
then store some users data inside that file. Like
FileOutputStream fout=new FileOutputStream(
  "C:\\desktop//tina.rdf");
  model.write(fout);
The file on my desktop is actually created but it is an empty file but I
want some input from users and store it in this file which currently I am
not sure how to do it.

Thank you

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sun, Jun 19, 2016 at 7:44 AM, A. Soroka <aj...@virginia.edu> wrote:

> Please start with the documentation provided for exactly this purpose:
>
> https://jena.apache.org/tutorials/rdf_api.html
> https://jena.apache.org/getting_started/
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Jun 19, 2016, at 12:40 AM, tina sani <tinamadri...@gmail.com> wrote:
> >
> > Hello all.
> > How can I create an RDF file using Jena and then save some data like
> > student name. address etc?
>
>


creating rdf file on disk using java

2016-06-18 Thread tina sani
Hello all.
How can I create an RDF file using Jena and then save some data like
student name. address etc?