Re: Property stored in Annotaion Section

2017-01-14 Thread neha gupta
Thank you Lorenz for your guidance. I really dont know how to upload the
ontology other than just attach with the email.

Thanks again for your time.

On Sat, Jan 14, 2017 at 6:39 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
>
> > Hi Lorenz, I have provided the whole rule in earlier messages.
> That's not true, sorry. I cite you:
>
> 
>
> Then I wrote this rule:
>
> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> http://www.semanticweb.org/soccer#Team) "
>
>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
>
> "greaterThan(?goals,30)
>  + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
> http://www.semanticweb.org/soccer#FACup  )]";
>
>
> *
>
> in that rule there was no String literal (modulo your formatting issues...)
>
> And even now you're not able to show the whole rule + the exception that
> you get.
> "Semicolon expected" can be some parse exception somewhere in your code,
> but according to your poor Java skills it can also be a Java compiler
> exception which means your code could never be compiled and therefore
> was never running - see http://bfy.tw/9TRa
>
> It's annoying that you continue ignoring my suggestion to upload the
> ontology, thus, I'm off - sorry but I'm not being paid for helping
> people here and there is still no end insight regarding this thread.
>
> Maybe somebody else can take over,
> Good luck
>
>
> > The error
> > comes when I use FACup as string. When I use it as resource, it gives the
> > result but in Annotation area.
> >
> > // when use as string
> >
> > -> (?x http://www.semanticweb.org/soccer#FavotiteLeague  "FACup" ) //it
> > gives error ; expected
> TYPO TYPO TYPO in the URI of the property ...
> >
> >
> >  //when use as resource
> >
> > -> (?x http://www.semanticweb.org/soccer#FavotiteLeague
> > http://www.semanticweb.org/soccer#FACup )
> >
> > //Annotation problem here
> TYPO TYPO TYPO in the URI of the property ...
> >
> >
> > On Sat, Jan 14, 2017 at 2:13 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> I don't understand why you want to use Strings now. And what kind of
> >> error? An addition to the error stacktrace, we have to see the WHOLE
> >> rule. Is it so difficult to provide complete information? Can you
> >> imagine how difficult it is to help remotely if you omit all necessary
> >> things?
> >>
> >> And I still don't understand the problem before. Using resources should
> >> work, for all other people it's also working.
> >>
> >>
> >> It's the last time that I'll answer here if you continue ignoring my
> >> suggestions to
> >>
> >> 1. upload the current full ontology (the latest that leads to your
> problem)
> >> 2. show the COMPLETE rule that doesn't work as expected and produces
> >> annotations in Protege
> >>
> >>> Sorry I did mistake in previous email, I used string like this
> >>>
> >>>  ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
> >>>
> >>> "FACup" and it gives error.
> >>>
> >>> The string value in rule I found on web from link below: he used rules
> >> like
> >>> [rule: (?S rdf:type data:serveur), (?S data:identifiant-reseau
> >>> "POLO")-> (?S data:newproperty "TEST")]
> >>>
> >>>
> >>> http://stackoverflow.com/questions/24649785/jena-rules-
> >> test-a-literal-property-to-string
> >>>
> >>>
> >>> On Fri, Jan 13, 2017 at 6:09 PM, neha gupta 
> >> wrote:
> >>>> Yes Andy, I tried this and it flushed an error message. Thats why I
> >> asked
> >>>> it if it is possible and if yes, in what way we can use the String in
> >> rule.
> >>>> + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
> >>>>
> >>>> http://www.semanticweb.org/soccer#
> >>>> <http://www.semanticweb.org/soccer#FACup>"FACup"
> >>>>
> >>>> On Fri, Jan 13, 2017 at 5:25 PM, Andy Seaborne 
> wrote:
> >>>>
> >>>>> On 13/01/17 13:36, neha gupta wrote:
> >>>>>
> >>>>>> Hello Lorenz, I am sorry.
> >>>>>>
> >>>>>> Can we use FA

Re: Property stored in Annotaion Section

2017-01-14 Thread neha gupta
I  wonder why this gives me error when I use it as string

-> (?x http://www.semanticweb.org/soccer#FavotiteLeague  "FACup" )

I sit Domain of FavoriteLeague as Team and Range as Literal, but still it
does not work. Error is semicolon expected,

On Sat, Jan 14, 2017 at 3:22 PM, neha gupta  wrote:

> Hi Lorenz, I have provided the whole rule in earlier messages. The error
> comes when I use FACup as string. When I use it as resource, it gives the
> result but in Annotation area.
>
> // when use as string
>
> -> (?x http://www.semanticweb.org/soccer#FavotiteLeague  "FACup" ) //it
> gives error ; expected
>
>
>  //when use as resource
>
> -> (?x http://www.semanticweb.org/soccer#FavotiteLeague
> http://www.semanticweb.org/soccer#FACup )
>
> //Annotation problem here
>
>
> On Sat, Jan 14, 2017 at 2:13 PM, Lorenz B.  leipzig.de> wrote:
>
>> I don't understand why you want to use Strings now. And what kind of
>> error? An addition to the error stacktrace, we have to see the WHOLE
>> rule. Is it so difficult to provide complete information? Can you
>> imagine how difficult it is to help remotely if you omit all necessary
>> things?
>>
>> And I still don't understand the problem before. Using resources should
>> work, for all other people it's also working.
>>
>>
>> It's the last time that I'll answer here if you continue ignoring my
>> suggestions to
>>
>> 1. upload the current full ontology (the latest that leads to your
>> problem)
>> 2. show the COMPLETE rule that doesn't work as expected and produces
>> annotations in Protege
>>
>> > Sorry I did mistake in previous email, I used string like this
>> >
>> >  ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
>> >
>> > "FACup" and it gives error.
>> >
>> > The string value in rule I found on web from link below: he used rules
>> like
>> >
>> > [rule: (?S rdf:type data:serveur), (?S data:identifiant-reseau
>> > "POLO")-> (?S data:newproperty "TEST")]
>> >
>> >
>> > http://stackoverflow.com/questions/24649785/jena-rules-test-
>> a-literal-property-to-string
>> >
>> >
>> >
>> > On Fri, Jan 13, 2017 at 6:09 PM, neha gupta 
>> wrote:
>> >
>> >> Yes Andy, I tried this and it flushed an error message. Thats why I
>> asked
>> >> it if it is possible and if yes, in what way we can use the String in
>> rule.
>> >>
>> >> + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
>> >>
>> >> http://www.semanticweb.org/soccer#
>> >> <http://www.semanticweb.org/soccer#FACup>"FACup"
>> >>
>> >> On Fri, Jan 13, 2017 at 5:25 PM, Andy Seaborne 
>> wrote:
>> >>
>> >>>
>> >>> On 13/01/17 13:36, neha gupta wrote:
>> >>>
>> >>>> Hello Lorenz, I am sorry.
>> >>>>
>> >>>> Can we use FACup as string rather than a resource.
>> >>>>
>> >>> Have you tried this?
>> >>>
>> >>> You are asking something you can debug locally.
>> >>>
>> >>> I mean it is also
>> >>>> possible, if allowed by rules, that we use something like this
>> >>>>
>> >>>> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://
>> >>>> www.semanticweb.org/soccer#Team) "
>> >>>>
>> >>>>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
>> >>>>
>> >>>> "greaterThan(?goals,30)
>> >>>>  + " ->  (?x  http://www.semanticweb.org/soc
>> cer#FavioriteLeague
>> >>>> http://www.semanticweb.org/soccer#
>> >>>> <http://www.semanticweb.org/soccer#FACup>"FACup"
>> >>>>
>> >>>> )]";
>> >>>>
>> >>>> FACup, ChampLeague etc are just some plain strings.
>> >>>>
>> >>>>
>> >>>> On Fri, Jan 13, 2017 at 12:26 AM, Lorenz Buehmann <
>> >>>> buehm...@informatik.uni-leipzig.de> wrote:
>> >>>>
>> >>>> Again, you ignored my suggestion to UPLOAD THE WHOLE ONTOLOGY and
>> SHOW
>> >>>>> US THE WHOLE RULE that does not work.
>> >>>>>
>

Re: Property stored in Annotaion Section

2017-01-14 Thread neha gupta
Hi Lorenz, I have provided the whole rule in earlier messages. The error
comes when I use FACup as string. When I use it as resource, it gives the
result but in Annotation area.

// when use as string

-> (?x http://www.semanticweb.org/soccer#FavotiteLeague  "FACup" ) //it
gives error ; expected


 //when use as resource

-> (?x http://www.semanticweb.org/soccer#FavotiteLeague
http://www.semanticweb.org/soccer#FACup )

//Annotation problem here


On Sat, Jan 14, 2017 at 2:13 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> I don't understand why you want to use Strings now. And what kind of
> error? An addition to the error stacktrace, we have to see the WHOLE
> rule. Is it so difficult to provide complete information? Can you
> imagine how difficult it is to help remotely if you omit all necessary
> things?
>
> And I still don't understand the problem before. Using resources should
> work, for all other people it's also working.
>
>
> It's the last time that I'll answer here if you continue ignoring my
> suggestions to
>
> 1. upload the current full ontology (the latest that leads to your problem)
> 2. show the COMPLETE rule that doesn't work as expected and produces
> annotations in Protege
>
> > Sorry I did mistake in previous email, I used string like this
> >
> >  ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
> >
> > "FACup" and it gives error.
> >
> > The string value in rule I found on web from link below: he used rules
> like
> >
> > [rule: (?S rdf:type data:serveur), (?S data:identifiant-reseau
> > "POLO")-> (?S data:newproperty "TEST")]
> >
> >
> > http://stackoverflow.com/questions/24649785/jena-rules-
> test-a-literal-property-to-string
> >
> >
> >
> > On Fri, Jan 13, 2017 at 6:09 PM, neha gupta 
> wrote:
> >
> >> Yes Andy, I tried this and it flushed an error message. Thats why I
> asked
> >> it if it is possible and if yes, in what way we can use the String in
> rule.
> >>
> >> + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
> >>
> >> http://www.semanticweb.org/soccer#
> >> <http://www.semanticweb.org/soccer#FACup>"FACup"
> >>
> >> On Fri, Jan 13, 2017 at 5:25 PM, Andy Seaborne  wrote:
> >>
> >>>
> >>> On 13/01/17 13:36, neha gupta wrote:
> >>>
> >>>> Hello Lorenz, I am sorry.
> >>>>
> >>>> Can we use FACup as string rather than a resource.
> >>>>
> >>> Have you tried this?
> >>>
> >>> You are asking something you can debug locally.
> >>>
> >>> I mean it is also
> >>>> possible, if allowed by rules, that we use something like this
> >>>>
> >>>> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://
> >>>> www.semanticweb.org/soccer#Team) "
> >>>>
> >>>>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
> >>>>
> >>>> "greaterThan(?goals,30)
> >>>>  + " ->  (?x  http://www.semanticweb.org/
> soccer#FavioriteLeague
> >>>> http://www.semanticweb.org/soccer#
> >>>> <http://www.semanticweb.org/soccer#FACup>"FACup"
> >>>>
> >>>> )]";
> >>>>
> >>>> FACup, ChampLeague etc are just some plain strings.
> >>>>
> >>>>
> >>>> On Fri, Jan 13, 2017 at 12:26 AM, Lorenz Buehmann <
> >>>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>>
> >>>> Again, you ignored my suggestion to UPLOAD THE WHOLE ONTOLOGY and SHOW
> >>>>> US THE WHOLE RULE that does not work.
> >>>>>
> >>>>> Not having an individual FACup in your ontology is not really an
> >>>>> explanation for me that a property will be rendered as annotation
> >>>>> property in Protege after rule execution and storing the data with
> Jena.
> >>>>>
> >>>>>
> >>>>> On 12.01.2017 15:57, neha gupta wrote:
> >>>>>
> >>>>>> I want to ask Lorenz, about the Then part of the rule:
> >>>>>>
> >>>>>> THEN-> team FavoriteLeague is FACup
> >>>>>>
> >>>>>> FACup is the resource in my owl (just followed Create Instance tab
> in

Re: Property stored in Annotaion Section

2017-01-13 Thread neha gupta
Sorry I did mistake in previous email, I used string like this

 ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague

"FACup" and it gives error.

The string value in rule I found on web from link below: he used rules like

[rule: (?S rdf:type data:serveur), (?S data:identifiant-reseau
"POLO")-> (?S data:newproperty "TEST")]


http://stackoverflow.com/questions/24649785/jena-rules-test-a-literal-property-to-string



On Fri, Jan 13, 2017 at 6:09 PM, neha gupta  wrote:

> Yes Andy, I tried this and it flushed an error message. Thats why I asked
> it if it is possible and if yes, in what way we can use the String in rule.
>
> + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
>
> http://www.semanticweb.org/soccer#
> <http://www.semanticweb.org/soccer#FACup>"FACup"
>
> On Fri, Jan 13, 2017 at 5:25 PM, Andy Seaborne  wrote:
>
>>
>>
>> On 13/01/17 13:36, neha gupta wrote:
>>
>>> Hello Lorenz, I am sorry.
>>>
>>> Can we use FACup as string rather than a resource.
>>>
>>
>> Have you tried this?
>>
>> You are asking something you can debug locally.
>>
>> I mean it is also
>>> possible, if allowed by rules, that we use something like this
>>>
>>> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://
>>> www.semanticweb.org/soccer#Team) "
>>>
>>>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
>>>
>>> "greaterThan(?goals,30)
>>>  + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
>>> http://www.semanticweb.org/soccer#
>>> <http://www.semanticweb.org/soccer#FACup>"FACup"
>>>
>>> )]";
>>>
>>> FACup, ChampLeague etc are just some plain strings.
>>>
>>>
>>> On Fri, Jan 13, 2017 at 12:26 AM, Lorenz Buehmann <
>>> buehm...@informatik.uni-leipzig.de> wrote:
>>>
>>> Again, you ignored my suggestion to UPLOAD THE WHOLE ONTOLOGY and SHOW
>>>> US THE WHOLE RULE that does not work.
>>>>
>>>> Not having an individual FACup in your ontology is not really an
>>>> explanation for me that a property will be rendered as annotation
>>>> property in Protege after rule execution and storing the data with Jena.
>>>>
>>>>
>>>> On 12.01.2017 15:57, neha gupta wrote:
>>>>
>>>>> I want to ask Lorenz, about the Then part of the rule:
>>>>>
>>>>> THEN-> team FavoriteLeague is FACup
>>>>>
>>>>> FACup is the resource in my owl (just followed Create Instance tab in
>>>>> Protege and Protege has give it the default URI like other resources in
>>>>>
>>>> the
>>>>
>>>>> file).
>>>>>
>>>>> Before we execute the rule, is it must that we should declare it in
>>>>> Java
>>>>> code like we do in Jena class before using it in Rules like
>>>>> OntClass team = model.getOntClass(ns + "Team")
>>>>>
>>>>> Because I am sure the problem lies in the resource FACup (or its URI).
>>>>>
>>>>> Regards
>>>>>
>>>>> On Thu, Jan 12, 2017 at 5:43 PM, Lorenz B. <
>>>>> buehm...@informatik.uni-leipzig.de> wrote:
>>>>>
>>>>> I don't understand your problem now, sorry. It's too confusing.
>>>>>>
>>>>>> You said that you changed the whole ontology: upload it somewhere such
>>>>>> that we can see it
>>>>>>
>>>>>> Show the final rule that doesn't work, not in pseudo-syntax but how
>>>>>> you
>>>>>> use it in Jena.
>>>>>>
>>>>>> Upload the code somewhere
>>>>>>
>>>>>> I am sorry for any inconvenience I have created. I really dont know
>>>>>>> how
>>>>>>>
>>>>>> to
>>>>>>
>>>>>>> create minimal code snippet or uses Github.
>>>>>>>
>>>>>>> Coming to the problem, what I noticed is the problem is in the object
>>>>>>>
>>>>>> i-e
>>>>
>>>>> FACup here.
>>>>>>> team1  FavoriteLeague  FACup
>>>>>>>
>>>>>>> Because I made changes and co

Re: Property stored in Annotaion Section

2017-01-13 Thread neha gupta
Yes Andy, I tried this and it flushed an error message. Thats why I asked
it if it is possible and if yes, in what way we can use the String in rule.

+ " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague

http://www.semanticweb.org/soccer# <http://www.semanticweb.org/soccer#FACup>
"FACup"

On Fri, Jan 13, 2017 at 5:25 PM, Andy Seaborne  wrote:

>
>
> On 13/01/17 13:36, neha gupta wrote:
>
>> Hello Lorenz, I am sorry.
>>
>> Can we use FACup as string rather than a resource.
>>
>
> Have you tried this?
>
> You are asking something you can debug locally.
>
> I mean it is also
>> possible, if allowed by rules, that we use something like this
>>
>> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://
>> www.semanticweb.org/soccer#Team) "
>>
>>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
>>
>> "greaterThan(?goals,30)
>>  + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
>> http://www.semanticweb.org/soccer#
>> <http://www.semanticweb.org/soccer#FACup>"FACup"
>>
>> )]";
>>
>> FACup, ChampLeague etc are just some plain strings.
>>
>>
>> On Fri, Jan 13, 2017 at 12:26 AM, Lorenz Buehmann <
>> buehm...@informatik.uni-leipzig.de> wrote:
>>
>> Again, you ignored my suggestion to UPLOAD THE WHOLE ONTOLOGY and SHOW
>>> US THE WHOLE RULE that does not work.
>>>
>>> Not having an individual FACup in your ontology is not really an
>>> explanation for me that a property will be rendered as annotation
>>> property in Protege after rule execution and storing the data with Jena.
>>>
>>>
>>> On 12.01.2017 15:57, neha gupta wrote:
>>>
>>>> I want to ask Lorenz, about the Then part of the rule:
>>>>
>>>> THEN-> team FavoriteLeague is FACup
>>>>
>>>> FACup is the resource in my owl (just followed Create Instance tab in
>>>> Protege and Protege has give it the default URI like other resources in
>>>>
>>> the
>>>
>>>> file).
>>>>
>>>> Before we execute the rule, is it must that we should declare it in Java
>>>> code like we do in Jena class before using it in Rules like
>>>> OntClass team = model.getOntClass(ns + "Team")
>>>>
>>>> Because I am sure the problem lies in the resource FACup (or its URI).
>>>>
>>>> Regards
>>>>
>>>> On Thu, Jan 12, 2017 at 5:43 PM, Lorenz B. <
>>>> buehm...@informatik.uni-leipzig.de> wrote:
>>>>
>>>> I don't understand your problem now, sorry. It's too confusing.
>>>>>
>>>>> You said that you changed the whole ontology: upload it somewhere such
>>>>> that we can see it
>>>>>
>>>>> Show the final rule that doesn't work, not in pseudo-syntax but how you
>>>>> use it in Jena.
>>>>>
>>>>> Upload the code somewhere
>>>>>
>>>>> I am sorry for any inconvenience I have created. I really dont know how
>>>>>>
>>>>> to
>>>>>
>>>>>> create minimal code snippet or uses Github.
>>>>>>
>>>>>> Coming to the problem, what I noticed is the problem is in the object
>>>>>>
>>>>> i-e
>>>
>>>> FACup here.
>>>>>> team1  FavoriteLeague  FACup
>>>>>>
>>>>>> Because I made changes and coming to the down, used different
>>>>>>
>>>>> properties
>>>
>>>> (in place of  FavoriteLeague), and made the rule simple to:
>>>>>> If x is a Team, then x FavoriteLeague is FACup ,
>>>>>> If x is a Team, then x Wins is FACup etc just for simplicity.
>>>>>>
>>>>>> In a nutshell, changed everything except object of rule FACup and it
>>>>>> appears in Annotation area so the problem for sure is in the URI of
>>>>>>
>>>>> FACup.
>>>>>
>>>>>> Now about resources FACup, PremierLeague, ChampionsLeague, these are
>>>>>>
>>>>> not
>>>
>>>> associated with anything in the ontology (neither Types of anything,
>>>>>>
>>>>> nor
>>>
>>>> data/object assertions), rather I just cr

Re: Property stored in Annotaion Section

2017-01-13 Thread neha gupta
Hello Lorenz, I am sorry.

Can we use FACup as string rather than a resource. I mean it is also
possible, if allowed by rules, that we use something like this

(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://
www.semanticweb.org/soccer#Team) "

 + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +

"greaterThan(?goals,30)
 + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
http://www.semanticweb.org/soccer#
<http://www.semanticweb.org/soccer#FACup>"FACup"
)]";

FACup, ChampLeague etc are just some plain strings.


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

> Again, you ignored my suggestion to UPLOAD THE WHOLE ONTOLOGY and SHOW
> US THE WHOLE RULE that does not work.
>
> Not having an individual FACup in your ontology is not really an
> explanation for me that a property will be rendered as annotation
> property in Protege after rule execution and storing the data with Jena.
>
>
> On 12.01.2017 15:57, neha gupta wrote:
> > I want to ask Lorenz, about the Then part of the rule:
> >
> > THEN-> team FavoriteLeague is FACup
> >
> > FACup is the resource in my owl (just followed Create Instance tab in
> > Protege and Protege has give it the default URI like other resources in
> the
> > file).
> >
> > Before we execute the rule, is it must that we should declare it in Java
> > code like we do in Jena class before using it in Rules like
> > OntClass team = model.getOntClass(ns + "Team")
> >
> > Because I am sure the problem lies in the resource FACup (or its URI).
> >
> > Regards
> >
> > On Thu, Jan 12, 2017 at 5:43 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> I don't understand your problem now, sorry. It's too confusing.
> >>
> >> You said that you changed the whole ontology: upload it somewhere such
> >> that we can see it
> >>
> >> Show the final rule that doesn't work, not in pseudo-syntax but how you
> >> use it in Jena.
> >>
> >> Upload the code somewhere
> >>
> >>> I am sorry for any inconvenience I have created. I really dont know how
> >> to
> >>> create minimal code snippet or uses Github.
> >>>
> >>> Coming to the problem, what I noticed is the problem is in the object
> i-e
> >>> FACup here.
> >>> team1  FavoriteLeague  FACup
> >>>
> >>> Because I made changes and coming to the down, used different
> properties
> >>> (in place of  FavoriteLeague), and made the rule simple to:
> >>> If x is a Team, then x FavoriteLeague is FACup ,
> >>> If x is a Team, then x Wins is FACup etc just for simplicity.
> >>>
> >>> In a nutshell, changed everything except object of rule FACup and it
> >>> appears in Annotation area so the problem for sure is in the URI of
> >> FACup.
> >>> Now about resources FACup, PremierLeague, ChampionsLeague, these are
> not
> >>> associated with anything in the ontology (neither Types of anything,
> nor
> >>> data/object assertions), rather I just created it in Protege with URI
> >> like
> >>> other resources.
> >>> URI of Team Class: http://www.semanticweb.org/soccer#Team
> >>> URI of FavoriteCategory : http://www.semanticweb.org/
> >> soccer#FavoriteCategory
> >>> and URI of FACup: http://www.semanticweb.org/soccer#FACup
> >>>
> >>> So I dont know if it is mandatory to get the value of resource
> >>> http://www.semanticweb.org/soccer#FACup first before the rules
> executes
> >>> because simple putting it in the rules not working for me.
> >>>
> >>> Sorry once again.
> >>>
> >>>
> >>> On Thu, Jan 12, 2017 at 12:12 PM, Lorenz B. <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
> >>>> in your last answer you wrote
> >>>>
> >>>> *String ns="http://www.semanticweb.org/soccer
> >>>> <http://www.semanticweb.org/soccer#FACupGoals>#";*
> >>>>
> >>>> if you provide us no information and the information that you provide
> is
> >>>> of such poor quality, then it's not possible to help you.
> >>>>
> >>>> Last time that I'll write this here:
> >>>>
> >>>> 1. provide the WHOLE ontology (there are many services only 

Re: Property stored in Annotaion Section

2017-01-12 Thread neha gupta
I want to ask Lorenz, about the Then part of the rule:

THEN-> team FavoriteLeague is FACup

FACup is the resource in my owl (just followed Create Instance tab in
Protege and Protege has give it the default URI like other resources in the
file).

Before we execute the rule, is it must that we should declare it in Java
code like we do in Jena class before using it in Rules like
OntClass team = model.getOntClass(ns + "Team")

Because I am sure the problem lies in the resource FACup (or its URI).

Regards

On Thu, Jan 12, 2017 at 5:43 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> I don't understand your problem now, sorry. It's too confusing.
>
> You said that you changed the whole ontology: upload it somewhere such
> that we can see it
>
> Show the final rule that doesn't work, not in pseudo-syntax but how you
> use it in Jena.
>
> Upload the code somewhere
>
> > I am sorry for any inconvenience I have created. I really dont know how
> to
> > create minimal code snippet or uses Github.
> >
> > Coming to the problem, what I noticed is the problem is in the object i-e
> > FACup here.
> > team1  FavoriteLeague  FACup
> >
> > Because I made changes and coming to the down, used different properties
> > (in place of  FavoriteLeague), and made the rule simple to:
> > If x is a Team, then x FavoriteLeague is FACup ,
> > If x is a Team, then x Wins is FACup etc just for simplicity.
> >
> > In a nutshell, changed everything except object of rule FACup and it
> > appears in Annotation area so the problem for sure is in the URI of
> FACup.
> >
> > Now about resources FACup, PremierLeague, ChampionsLeague, these are not
> > associated with anything in the ontology (neither Types of anything, nor
> > data/object assertions), rather I just created it in Protege with URI
> like
> > other resources.
> > URI of Team Class: http://www.semanticweb.org/soccer#Team
> > URI of FavoriteCategory : http://www.semanticweb.org/
> soccer#FavoriteCategory
> > and URI of FACup: http://www.semanticweb.org/soccer#FACup
> >
> > So I dont know if it is mandatory to get the value of resource
> > http://www.semanticweb.org/soccer#FACup first before the rules executes
> > because simple putting it in the rules not working for me.
> >
> > Sorry once again.
> >
> >
> > On Thu, Jan 12, 2017 at 12:12 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> in your last answer you wrote
> >>
> >> *String ns="http://www.semanticweb.org/soccer
> >> <http://www.semanticweb.org/soccer#FACupGoals>#";*
> >>
> >> if you provide us no information and the information that you provide is
> >> of such poor quality, then it's not possible to help you.
> >>
> >> Last time that I'll write this here:
> >>
> >> 1. provide the WHOLE ontology (there are many services only where you
> >> can put your file online for free)
> >> 2. show the minimal code snippet that makes it possible to see that it
> >> doesn't work
> >>
> >> Or put everything into a Github project
> >>
> >>
> >>> Hi Lorenz, the ns is wrong, how?
> >>>
> >>> String ns="http://www.semanticweb.org/soccer#
> >>>
> >>> Rule:
> >>>
> >>> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://
> >>> www.semanticweb.org/soccer#Team) "
> >>>
> >>>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
> >>>
> >>> "greaterThan(?goals,30)
> >>>  + " ->  (?x  http://www.semanticweb.org/
> soccer#FavioriteLeague
> >>> http://www.semanticweb.org/soccer#FACup  )]
> >>>
> >>>
> >>> On Thu, Jan 12, 2017 at 1:03 AM, Lorenz Buehmann <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
> >>>> On 11.01.2017 22:10, neha gupta wrote:
> >>>>> Hello Lorenz, I am sure I have used the FavoriteLeague as Data
> Property
> >>>> in
> >>>>> Protege and it has the same URI as other data properties and other
> >>>>> resources in the ontology ie  http://www.semanticweb.org/soccer#
> >>>>> <http://www.semanticweb.org/soccer#FACupGoals>FavoriteLeague.
> >>>>>
> >>>>> I have changed the spelling of FavoriteLeague. to FavoLeague,
> >> favLeague,
> >>>>> but ever

Re: Property stored in Annotaion Section

2017-01-12 Thread neha gupta
In simple words, do we need:

inf.getResource(URI of FACup)  ?

I did not use it so far.

On Thu, Jan 12, 2017 at 5:57 PM, neha gupta  wrote:

> I want to ask Lorenz, about the Then part of the rule:
>
> THEN-> team FavoriteLeague is FACup
>
> FACup is the resource in my owl (just followed Create Instance tab in
> Protege and Protege has give it the default URI like other resources in the
> file).
>
> Before we execute the rule, is it must that we should declare it in Java
> code like we do in Jena class before using it in Rules like
> OntClass team = model.getOntClass(ns + "Team")
>
> Because I am sure the problem lies in the resource FACup (or its URI).
>
> Regards
>
> On Thu, Jan 12, 2017 at 5:43 PM, Lorenz B.  leipzig.de> wrote:
>
>> I don't understand your problem now, sorry. It's too confusing.
>>
>> You said that you changed the whole ontology: upload it somewhere such
>> that we can see it
>>
>> Show the final rule that doesn't work, not in pseudo-syntax but how you
>> use it in Jena.
>>
>> Upload the code somewhere
>>
>> > I am sorry for any inconvenience I have created. I really dont know how
>> to
>> > create minimal code snippet or uses Github.
>> >
>> > Coming to the problem, what I noticed is the problem is in the object
>> i-e
>> > FACup here.
>> > team1  FavoriteLeague  FACup
>> >
>> > Because I made changes and coming to the down, used different properties
>> > (in place of  FavoriteLeague), and made the rule simple to:
>> > If x is a Team, then x FavoriteLeague is FACup ,
>> > If x is a Team, then x Wins is FACup etc just for simplicity.
>> >
>> > In a nutshell, changed everything except object of rule FACup and it
>> > appears in Annotation area so the problem for sure is in the URI of
>> FACup.
>> >
>> > Now about resources FACup, PremierLeague, ChampionsLeague, these are not
>> > associated with anything in the ontology (neither Types of anything, nor
>> > data/object assertions), rather I just created it in Protege with URI
>> like
>> > other resources.
>> > URI of Team Class: http://www.semanticweb.org/soccer#Team
>> > URI of FavoriteCategory : http://www.semanticweb.org/soc
>> cer#FavoriteCategory
>> > and URI of FACup: http://www.semanticweb.org/soccer#FACup
>> >
>> > So I dont know if it is mandatory to get the value of resource
>> > http://www.semanticweb.org/soccer#FACup first before the rules executes
>> > because simple putting it in the rules not working for me.
>> >
>> > Sorry once again.
>> >
>> >
>> > On Thu, Jan 12, 2017 at 12:12 PM, Lorenz B. <
>> > buehm...@informatik.uni-leipzig.de> wrote:
>> >
>> >> in your last answer you wrote
>> >>
>> >> *String ns="http://www.semanticweb.org/soccer
>> >> <http://www.semanticweb.org/soccer#FACupGoals>#";*
>> >>
>> >> if you provide us no information and the information that you provide
>> is
>> >> of such poor quality, then it's not possible to help you.
>> >>
>> >> Last time that I'll write this here:
>> >>
>> >> 1. provide the WHOLE ontology (there are many services only where you
>> >> can put your file online for free)
>> >> 2. show the minimal code snippet that makes it possible to see that it
>> >> doesn't work
>> >>
>> >> Or put everything into a Github project
>> >>
>> >>
>> >>> Hi Lorenz, the ns is wrong, how?
>> >>>
>> >>> String ns="http://www.semanticweb.org/soccer#
>> >>>
>> >>> Rule:
>> >>>
>> >>> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://
>> >>> www.semanticweb.org/soccer#Team) "
>> >>>
>> >>>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
>> >>>
>> >>> "greaterThan(?goals,30)
>> >>>  + " ->  (?x  http://www.semanticweb.org/soc
>> cer#FavioriteLeague
>> >>> http://www.semanticweb.org/soccer#FACup  )]
>> >>>
>> >>>
>> >>> On Thu, Jan 12, 2017 at 1:03 AM, Lorenz Buehmann <
>> >>> buehm...@informatik.uni-leipzig.de> wrote:
>> >>>
>> >>>> On 11.01.2017 22:10, neha gupta wrote:
>> >>>>

Re: Property stored in Annotaion Section

2017-01-12 Thread neha gupta
I am sorry for any inconvenience I have created. I really dont know how to
create minimal code snippet or uses Github.

Coming to the problem, what I noticed is the problem is in the object i-e
FACup here.
team1  FavoriteLeague  FACup

Because I made changes and coming to the down, used different properties
(in place of  FavoriteLeague), and made the rule simple to:
If x is a Team, then x FavoriteLeague is FACup ,
If x is a Team, then x Wins is FACup etc just for simplicity.

In a nutshell, changed everything except object of rule FACup and it
appears in Annotation area so the problem for sure is in the URI of FACup.

Now about resources FACup, PremierLeague, ChampionsLeague, these are not
associated with anything in the ontology (neither Types of anything, nor
data/object assertions), rather I just created it in Protege with URI like
other resources.
URI of Team Class: http://www.semanticweb.org/soccer#Team
URI of FavoriteCategory : http://www.semanticweb.org/soccer#FavoriteCategory
and URI of FACup: http://www.semanticweb.org/soccer#FACup

So I dont know if it is mandatory to get the value of resource
http://www.semanticweb.org/soccer#FACup first before the rules executes
because simple putting it in the rules not working for me.

Sorry once again.


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

> in your last answer you wrote
>
> *String ns="http://www.semanticweb.org/soccer
> <http://www.semanticweb.org/soccer#FACupGoals>#";*
>
> if you provide us no information and the information that you provide is
> of such poor quality, then it's not possible to help you.
>
> Last time that I'll write this here:
>
> 1. provide the WHOLE ontology (there are many services only where you
> can put your file online for free)
> 2. show the minimal code snippet that makes it possible to see that it
> doesn't work
>
> Or put everything into a Github project
>
>
> > Hi Lorenz, the ns is wrong, how?
> >
> > String ns="http://www.semanticweb.org/soccer#
> >
> > Rule:
> >
> > (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://
> > www.semanticweb.org/soccer#Team) "
> >
> >  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
> >
> > "greaterThan(?goals,30)
> >  + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
> > http://www.semanticweb.org/soccer#FACup  )]
> >
> >
> > On Thu, Jan 12, 2017 at 1:03 AM, Lorenz Buehmann <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >>
> >> On 11.01.2017 22:10, neha gupta wrote:
> >>> Hello Lorenz, I am sure I have used the FavoriteLeague as Data Property
> >> in
> >>> Protege and it has the same URI as other data properties and other
> >>> resources in the ontology ie  http://www.semanticweb.org/soccer#
> >>> <http://www.semanticweb.org/soccer#FACupGoals>FavoriteLeague.
> >>>
> >>> I have changed the spelling of FavoriteLeague. to FavoLeague,
> favLeague,
> >>> but every time the same disappointing result.
> >>> My namespace is also same in whole program:
> >>>
> >>> *String ns="http://www.semanticweb.org/soccer
> >>> <http://www.semanticweb.org/soccer#FACupGoals>#";*
> >> Ehm that's a totally wrong namespace declaration. To be honest, I don't
> >> understand why you don't see this...and the namespace in the rule is
> >> obviously NOT the same then
> >>> favleague is declared as:
> >>>
> >>>  *OntProperty favleague=model.getOntProperty(ns+ "FavoriteLeague");*
> >> Please tell me, what do you think is the concatenation of the String in
> >> the variable ns and the String "FavoriteLeague" ?
> >>
> >>
> >>> //All my data properties are declared like this and it works.  For ex:
> >> Goal
> >>> property
> >>> OntProperty goals=model.getOntProperty(ns+ "Goals");
> >>>
> >>>
> >>> On Wed, Jan 11, 2017 at 9:41 PM, Lorenz Buehmann <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
> >>>> Chris is right. It's beginning to become annoying if youalways ignore
> >>>> our advices to show data + the code - all the code. Even now you
> omitted
> >>>> information like
> >>>>
> >>>> * the declaration of the variable ns
> >>>>
> >>>> * the declaration of the variable favcat
> >>>>

Re: Property stored in Annotaion Section

2017-01-11 Thread neha gupta
Hi Lorenz, the ns is wrong, how?

String ns="http://www.semanticweb.org/soccer#

Rule:

(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://
www.semanticweb.org/soccer#Team) "

 + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +

"greaterThan(?goals,30)
 + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
http://www.semanticweb.org/soccer#FACup  )]


On Thu, Jan 12, 2017 at 1:03 AM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

>
>
> On 11.01.2017 22:10, neha gupta wrote:
> > Hello Lorenz, I am sure I have used the FavoriteLeague as Data Property
> in
> > Protege and it has the same URI as other data properties and other
> > resources in the ontology ie  http://www.semanticweb.org/soccer#
> > <http://www.semanticweb.org/soccer#FACupGoals>FavoriteLeague.
> >
> > I have changed the spelling of FavoriteLeague. to FavoLeague, favLeague,
> > but every time the same disappointing result.
> > My namespace is also same in whole program:
> >
> > *String ns="http://www.semanticweb.org/soccer
> > <http://www.semanticweb.org/soccer#FACupGoals>#";*
> Ehm that's a totally wrong namespace declaration. To be honest, I don't
> understand why you don't see this...and the namespace in the rule is
> obviously NOT the same then
> > favleague is declared as:
> >
> >  *OntProperty favleague=model.getOntProperty(ns+ "FavoriteLeague");*
> Please tell me, what do you think is the concatenation of the String in
> the variable ns and the String "FavoriteLeague" ?
>
>
> > //All my data properties are declared like this and it works.  For ex:
> Goal
> > property
> > OntProperty goals=model.getOntProperty(ns+ "Goals");
> >
> >
> > On Wed, Jan 11, 2017 at 9:41 PM, Lorenz Buehmann <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> Chris is right. It's beginning to become annoying if youalways ignore
> >> our advices to show data + the code - all the code. Even now you omitted
> >> information like
> >>
> >> * the declaration of the variable ns
> >>
> >> * the declaration of the variable favcat
> >>
> >>
> >> And indeed the data. IF you have anywhere in the code and/or data a
> >> typo, the rule not "fire", thus no data will be inferred. In your case,
> >> I'm pretty sure that data is inferred (you said that Protege shows it as
> >> annotation) - but the inferred property is nowhere declared as
> >> owl:DatatypeProperty in the ontology. This is mandotory for OWL/OWL
> >> API/Protege
> >>
> >>
> >> On 11.01.2017 16:48, neha gupta wrote:
> >>> I used like this
> >>>
> >>>  *OntProperty favleague=model.getOntProperty(ns+ "FavioriteLeague");*
> >>> Then I wrote this rule:
> >>>
> >>> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> >>> http://www.semanticweb.org/soccer#Team) "
> >>>
> >>>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
> >>>
> >>> "greaterThan(?goals,30)
> >>>  + " ->  (?x  http://www.semanticweb.org/
> soccer#FavioriteLeague
> >>> http://www.semanticweb.org/soccer#FACup  )]";
> >>> //FACupe is resource in the ontology:
> >>>
> >>> Then
> >>>   *inf.listStatements(null,favcat,(RDFNode)null);*
> >>>
> >>>
> >>> I think the problem is not in typo because I run similar rule for
> another
> >>> data property FavioriteStadium and it also saves in Annotation area.
> >>>
> >>> On Wed, Jan 11, 2017 at 6:31 PM, Chris Dollin <
> >> chris.dol...@epimorphics.com>
> >>> wrote:
> >>>
> >>>> On 11/01/17 15:15, neha gupta wrote:
> >>>>
> >>>>> Even this not works
> >>>>>
> >>>>>  inf.listStatements(null,favleague,(RDFNode)null);
> >>>>>
> >>>>> Gives the result but in Annotation area of Protege
> >>>>>
> >>>> COMPLETE MINIMAL EXAMPLE, please. You have so many
> >>>> errors & omissions in the code you show us we can't
> >>>> tell which one is the one you're asking about.
> >>>>
> >>>> If Protege is putting things in the annotation area
> >>>> I'd guess that means the thing isn't declared as either
> >>>> a DataProperty or an ObjectProperty. Given your erratic
> >>>> spelling that's quite likely.
> >>>>
> >>>>
> >>>> Chris
> >>>>
> >>>> --
> >>>> "He could not weigh up which was worse and so tried not to think about
> >>>> either."
> >>>> /The Spellgrinder's
> >>>> Apprentice/
> >>>>
> >>>> Epimorphics Ltd, http://www.epimorphics.com
> >>>> Registered address: Court Lodge, 105 High Street, Portishead, Bristol
> >> BS20
> >>>> 6PT
> >>>> Epimorphics Ltd. is a limited company registered in England (number
> >>>> 7016688)
> >>>>
> >>
>
>


Re: Property stored in Annotaion Section

2017-01-11 Thread neha gupta
Hello Lorenz, I am sure I have used the FavoriteLeague as Data Property in
Protege and it has the same URI as other data properties and other
resources in the ontology ie  http://www.semanticweb.org/soccer#
<http://www.semanticweb.org/soccer#FACupGoals>FavoriteLeague.

I have changed the spelling of FavoriteLeague. to FavoLeague, favLeague,
but every time the same disappointing result.
My namespace is also same in whole program:

*String ns="http://www.semanticweb.org/soccer
<http://www.semanticweb.org/soccer#FACupGoals>#";*
favleague is declared as:

 *OntProperty favleague=model.getOntProperty(ns+ "FavoriteLeague");*
//All my data properties are declared like this and it works.  For ex: Goal
property
OntProperty goals=model.getOntProperty(ns+ "Goals");


On Wed, Jan 11, 2017 at 9:41 PM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> Chris is right. It's beginning to become annoying if youalways ignore
> our advices to show data + the code - all the code. Even now you omitted
> information like
>
> * the declaration of the variable ns
>
> * the declaration of the variable favcat
>
>
> And indeed the data. IF you have anywhere in the code and/or data a
> typo, the rule not "fire", thus no data will be inferred. In your case,
> I'm pretty sure that data is inferred (you said that Protege shows it as
> annotation) - but the inferred property is nowhere declared as
> owl:DatatypeProperty in the ontology. This is mandotory for OWL/OWL
> API/Protege
>
>
> On 11.01.2017 16:48, neha gupta wrote:
> > I used like this
> >
> >  *OntProperty favleague=model.getOntProperty(ns+ "FavioriteLeague");*
> > Then I wrote this rule:
> >
> > (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> > http://www.semanticweb.org/soccer#Team) "
> >
> >  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
> >
> > "greaterThan(?goals,30)
> >  + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
> > http://www.semanticweb.org/soccer#FACup  )]";
> > //FACupe is resource in the ontology:
> >
> > Then
> >   *inf.listStatements(null,favcat,(RDFNode)null);*
> >
> >
> > I think the problem is not in typo because I run similar rule for another
> > data property FavioriteStadium and it also saves in Annotation area.
> >
> > On Wed, Jan 11, 2017 at 6:31 PM, Chris Dollin <
> chris.dol...@epimorphics.com>
> > wrote:
> >
> >>
> >> On 11/01/17 15:15, neha gupta wrote:
> >>
> >>> Even this not works
> >>>
> >>>  inf.listStatements(null,favleague,(RDFNode)null);
> >>>
> >>> Gives the result but in Annotation area of Protege
> >>>
> >> COMPLETE MINIMAL EXAMPLE, please. You have so many
> >> errors & omissions in the code you show us we can't
> >> tell which one is the one you're asking about.
> >>
> >> If Protege is putting things in the annotation area
> >> I'd guess that means the thing isn't declared as either
> >> a DataProperty or an ObjectProperty. Given your erratic
> >> spelling that's quite likely.
> >>
> >>
> >> Chris
> >>
> >> --
> >> "He could not weigh up which was worse and so tried not to think about
> >> either."
> >> /The Spellgrinder's
> >> Apprentice/
> >>
> >> Epimorphics Ltd, http://www.epimorphics.com
> >> Registered address: Court Lodge, 105 High Street, Portishead, Bristol
> BS20
> >> 6PT
> >> Epimorphics Ltd. is a limited company registered in England (number
> >> 7016688)
> >>
>
>


Re: Property stored in Annotaion Section

2017-01-11 Thread neha gupta
I used like this

 *OntProperty favleague=model.getOntProperty(ns+ "FavioriteLeague");*
Then I wrote this rule:

(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.semanticweb.org/soccer#Team) "

 + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +

"greaterThan(?goals,30)
 + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
http://www.semanticweb.org/soccer#FACup  )]";
//FACupe is resource in the ontology:

Then
  *inf.listStatements(null,favcat,(RDFNode)null);*


I think the problem is not in typo because I run similar rule for another
data property FavioriteStadium and it also saves in Annotation area.

On Wed, Jan 11, 2017 at 6:31 PM, Chris Dollin 
wrote:

>
>
> On 11/01/17 15:15, neha gupta wrote:
>
>> Even this not works
>>
>>  inf.listStatements(null,favleague,(RDFNode)null);
>>
>> Gives the result but in Annotation area of Protege
>>
>
> COMPLETE MINIMAL EXAMPLE, please. You have so many
> errors & omissions in the code you show us we can't
> tell which one is the one you're asking about.
>
> If Protege is putting things in the annotation area
> I'd guess that means the thing isn't declared as either
> a DataProperty or an ObjectProperty. Given your erratic
> spelling that's quite likely.
>
>
> Chris
>
> --
> "He could not weigh up which was worse and so tried not to think about
> either."
> /The Spellgrinder's
> Apprentice/
>
> Epimorphics Ltd, http://www.epimorphics.com
> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20
> 6PT
> Epimorphics Ltd. is a limited company registered in England (number
> 7016688)
>


Re: Property stored in Annotaion Section

2017-01-11 Thread neha gupta
Even this not works

 inf.listStatements(null,favleague,(RDFNode)null);

Gives the result but in Annotation area of Protege

On Wed, Jan 11, 2017 at 3:42 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
>
> > I used FavioriteLeague, though I later knew the spelling is incorrect.
> >
> > What you suggest Lorenz now what should I do to handle this problem
> because
> > it has stopped me to move forward in my project.
> According to the Javadoc [1] use an RDFNode object with the full URI of
> the class instead of a String ""
>
>
> [1]
> https://jena.apache.org/documentation/javadoc/jena/
> org/apache/jena/rdf/model/Model.html#listStatements-org.
> apache.jena.rdf.model.Resource-org.apache.jena.rdf.
> model.Property-org.apache.jena.rdf.model.RDFNode-
> >
> > Thank you
> >
> > On Wed, Jan 11, 2017 at 2:31 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> I am sorry, in theory I know most of things, but when it come to
> coding, I
> >>> make mistakes.
> >>>
> >>> I know Literal can be any string or integer value and resources are
> what
> >> we
> >>> used in our ontology (some things).
> >>>
> >>> Object of property FavioriteLeague is a resource : FACup, in this case,
> >>> whose URI is
> >>>
> >>>
> >>>
> >>> http://www.semanticweb.org/soccer#
> >>> <http://www.semanticweb.org/soccer#FavioriteLeague>FACup or
> >>> http://www.semanticweb.org/soccer#ChampLeague etc
> >> More important, the object of triples with the predicate rdf:type is
> >> either a URI u or a blank node b, i.e.
> >>
> >> An RDF triple is basically defined as (old definition, RDF 1.1 is based
> >> on IRIs)
> >>
> >> t = U ∪B  x  U  x  U ∪B ∪L
> >>
> >> and for rdf:type triples we only have
> >>
> >> t = U∪B  x  rdf:type  x  U∪B
> >>
> >> with U being the set of URIs, B the set of blank node and L the set of
> >> literals.
> >>
> >>
> >> By the way, I don't know if "Faviorite" is correct in your language, but
> >> for me it looks like a typo. At least it doesn't look like proper
> >> English - favorite (US) or favourite is how I would write it
> >>> Thank you
> >>>
> >>> On Wed, Jan 11, 2017 at 2:04 PM, Lorenz B. <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
> >>>>>  How should I share the ontology, the attachment is not allowed here?
> >>>>>
> >>>>>  I used this to execute the rule
> >>>>>
> >>>>>  for (Iterator i = inf.listResourcesWithProperty(RDF.type,
> >>>>> favioriteleague); i.hasNext();)
> >>>>>  {
> >>>>>  inf.listStatements(null,RDF.type, "FavioriteLeague");
> >>>>>
> >>>>> }
> >>>>>
> >>>>> I think the problem is here in the code.
> >>>> I don't know how often we told you that RDF resources are identified
> by
> >>>> URIs...
> >>>> Your class is
> >>>>
> >>>> http://www.semanticweb.org/soccer#FavioriteLeague
> >>>>
> >>>> and you use a literal
> >>>>
> >>>> "FavioriteLeague"
> >>>>
> >>>> in the code when you write
> >>>>
> >>>> inf.listStatements(null,RDF.type, "FavioriteLeague");
> >>>>
> >>>> Please please read an RDF tutorial for the beginning. Please make sure
> >>>> that you understand the difference between literals and resources in
> >> RDF.
> >>>>> On Wed, Jan 11, 2017 at 1:12 PM, Lorenz B. <
> >>>>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>>>
> >>>>>> Can you please share the whole ontology with us?
> >>>>>> And the snippet of code that loads + executes the rule.
> >>>>>>> *FACup* here is the resource in my ontology
> >>>>>>>
> >>>>>>> On Tue, Jan 10, 2017 at 11:40 PM, neha gupta <
> neha.bang...@gmail.com
> >>>>>> wrote:
> >>>>>>>> Lorenz, what actually I did is created a data property in Protege
> :
> >>>>>>>> "FavioriteLeague".
> &

Re: Property stored in Annotaion Section

2017-01-11 Thread neha gupta
I used FavioriteLeague, though I later knew the spelling is incorrect.

What you suggest Lorenz now what should I do to handle this problem because
it has stopped me to move forward in my project.

Thank you

On Wed, Jan 11, 2017 at 2:31 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> I am sorry, in theory I know most of things, but when it come to coding, I
> > make mistakes.
> >
> > I know Literal can be any string or integer value and resources are what
> we
> > used in our ontology (some things).
> >
> > Object of property FavioriteLeague is a resource : FACup, in this case,
> > whose URI is
> >
> >
> >
> > http://www.semanticweb.org/soccer#
> > <http://www.semanticweb.org/soccer#FavioriteLeague>FACup or
> > http://www.semanticweb.org/soccer#ChampLeague etc
> More important, the object of triples with the predicate rdf:type is
> either a URI u or a blank node b, i.e.
>
> An RDF triple is basically defined as (old definition, RDF 1.1 is based
> on IRIs)
>
> t = U ∪B  x  U  x  U ∪B ∪L
>
> and for rdf:type triples we only have
>
> t = U∪B  x  rdf:type  x  U∪B
>
> with U being the set of URIs, B the set of blank node and L the set of
> literals.
>
>
> By the way, I don't know if "Faviorite" is correct in your language, but
> for me it looks like a typo. At least it doesn't look like proper
> English - favorite (US) or favourite is how I would write it
> > Thank you
> >
> > On Wed, Jan 11, 2017 at 2:04 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >>>  How should I share the ontology, the attachment is not allowed here?
> >>>
> >>>  I used this to execute the rule
> >>>
> >>>  for (Iterator i = inf.listResourcesWithProperty(RDF.type,
> >>> favioriteleague); i.hasNext();)
> >>>  {
> >>>  inf.listStatements(null,RDF.type, "FavioriteLeague");
> >>>
> >>> }
> >>>
> >>> I think the problem is here in the code.
> >> I don't know how often we told you that RDF resources are identified by
> >> URIs...
> >> Your class is
> >>
> >> http://www.semanticweb.org/soccer#FavioriteLeague
> >>
> >> and you use a literal
> >>
> >> "FavioriteLeague"
> >>
> >> in the code when you write
> >>
> >> inf.listStatements(null,RDF.type, "FavioriteLeague");
> >>
> >> Please please read an RDF tutorial for the beginning. Please make sure
> >> that you understand the difference between literals and resources in
> RDF.
> >>> On Wed, Jan 11, 2017 at 1:12 PM, Lorenz B. <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
> >>>> Can you please share the whole ontology with us?
> >>>> And the snippet of code that loads + executes the rule.
> >>>>> *FACup* here is the resource in my ontology
> >>>>>
> >>>>> On Tue, Jan 10, 2017 at 11:40 PM, neha gupta  >
> >>>> wrote:
> >>>>>> Lorenz, what actually I did is created a data property in Protege :
> >>>>>> "FavioriteLeague".
> >>>>>>
> >>>>>> Then I wrote this rule:
> >>>>>>
> >>>>>> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> >>>>>> http://www.semanticweb.org/soccer#Team) "
> >>>>>>
> >>>>>>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
> >>>>>>
> >>>>>> "greaterThan(?goals,30)
> >>>>>>  + " ->  (?x  http://www.semanticweb.org/
> >> soccer#FavioriteLeague
> >>>>>> http://www.semanticweb.org/soccer#FACup  )]";
> >>>>>>
> >>>>>>
> >>>>>> On Tue, Jan 10, 2017 at 3:53 PM, Lorenz Buehmann
> >>>>  >>>>>> leipzig.de> wrote:
> >>>>>>
> >>>>>>> Sorry to say that, but with that one line of code I cannot help
> you.
> >>>>>>>
> >>>>>>>
> >>>>>>> It's not clear how you use the property. And as always, the correct
> >> URI
> >>>>>>> matters. If you have somewhere in the code a small type, then it
> will
> >>>>>>> 

Re: Property stored in Annotaion Section

2017-01-11 Thread neha gupta
I am sorry, in theory I know most of things, but when it come to coding, I
make mistakes.

I know Literal can be any string or integer value and resources are what we
used in our ontology (some things).

Object of property FavioriteLeague is a resource : FACup, in this case,
whose URI is



http://www.semanticweb.org/soccer#
<http://www.semanticweb.org/soccer#FavioriteLeague>FACup or
http://www.semanticweb.org/soccer#ChampLeague etc

Thank you

On Wed, Jan 11, 2017 at 2:04 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
> >  How should I share the ontology, the attachment is not allowed here?
> >
> >  I used this to execute the rule
> >
> >  for (Iterator i = inf.listResourcesWithProperty(RDF.type,
> > favioriteleague); i.hasNext();)
> >  {
> >  inf.listStatements(null,RDF.type, "FavioriteLeague");
> >
> > }
> >
> > I think the problem is here in the code.
> I don't know how often we told you that RDF resources are identified by
> URIs...
> Your class is
>
> http://www.semanticweb.org/soccer#FavioriteLeague
>
> and you use a literal
>
> "FavioriteLeague"
>
> in the code when you write
>
> inf.listStatements(null,RDF.type, "FavioriteLeague");
>
> Please please read an RDF tutorial for the beginning. Please make sure
> that you understand the difference between literals and resources in RDF.
> >
> > On Wed, Jan 11, 2017 at 1:12 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> Can you please share the whole ontology with us?
> >> And the snippet of code that loads + executes the rule.
> >>> *FACup* here is the resource in my ontology
> >>>
> >>> On Tue, Jan 10, 2017 at 11:40 PM, neha gupta 
> >> wrote:
> >>>> Lorenz, what actually I did is created a data property in Protege :
> >>>> "FavioriteLeague".
> >>>>
> >>>> Then I wrote this rule:
> >>>>
> >>>> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> >>>> http://www.semanticweb.org/soccer#Team) "
> >>>>
> >>>>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
> >>>>
> >>>> "greaterThan(?goals,30)
> >>>>  + " ->  (?x  http://www.semanticweb.org/
> soccer#FavioriteLeague
> >>>> http://www.semanticweb.org/soccer#FACup  )]";
> >>>>
> >>>>
> >>>> On Tue, Jan 10, 2017 at 3:53 PM, Lorenz Buehmann
> >>  >>>> leipzig.de> wrote:
> >>>>
> >>>>> Sorry to say that, but with that one line of code I cannot help you.
> >>>>>
> >>>>>
> >>>>> It's not clear how you use the property. And as always, the correct
> URI
> >>>>> matters. If you have somewhere in the code a small type, then it will
> >>>>> create a different property. And if that property is not typed as OWL
> >>>>> data property, it will be an RDF property. OWL API and thus Protege
> >> will
> >>>>> render this then as OWL annotation property.
> >>>>>
> >>>>>
> >>>>> On 10.01.2017 12:49, neha gupta wrote:
> >>>>>> The data is stored in RDF/XML
> >>>>>>
> >>>>>>  model.write(writer, "RDF/XML");
> >>>>>>
> >>>>>> All other properties works fine and stored as data property but just
> >>>>> this
> >>>>>> one property is stored in Annotation area.
> >>>>>> Some weeks ago, I face the same problem but then it was fixed by
> >> random
> >>>>>> changes to code. I dont know in which situation this problem comes?
> >>>>>> I did not show the code because one type of code depends on other
> and
> >>>>> you
> >>>>>> will not be able to understand it easily.
> >>>>>>
> >>>>>> On Tue, Jan 10, 2017 at 2:22 PM, Lorenz Buehmann <
> >>>>>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>>>>
> >>>>>>> You're missing again all necessary information...
> >>>>>>>
> >>>>>>> You don't show use the code and the data. What is the ontology? In
> >>>>> which
> >>>>>>> format do 

Re: Property stored in Annotaion Section

2017-01-11 Thread neha gupta
 How should I share the ontology, the attachment is not allowed here?

 I used this to execute the rule

 for (Iterator i = inf.listResourcesWithProperty(RDF.type,
favioriteleague); i.hasNext();)
 {
 inf.listStatements(null,RDF.type, "FavioriteLeague");

}

I think the problem is here in the code.

On Wed, Jan 11, 2017 at 1:12 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Can you please share the whole ontology with us?
> And the snippet of code that loads + executes the rule.
> > *FACup* here is the resource in my ontology
> >
> > On Tue, Jan 10, 2017 at 11:40 PM, neha gupta 
> wrote:
> >
> >> Lorenz, what actually I did is created a data property in Protege :
> >> "FavioriteLeague".
> >>
> >> Then I wrote this rule:
> >>
> >> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> >> http://www.semanticweb.org/soccer#Team) "
> >>
> >>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
> >>
> >> "greaterThan(?goals,30)
> >>  + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
> >> http://www.semanticweb.org/soccer#FACup  )]";
> >>
> >>
> >> On Tue, Jan 10, 2017 at 3:53 PM, Lorenz Buehmann
>  >> leipzig.de> wrote:
> >>
> >>> Sorry to say that, but with that one line of code I cannot help you.
> >>>
> >>>
> >>> It's not clear how you use the property. And as always, the correct URI
> >>> matters. If you have somewhere in the code a small type, then it will
> >>> create a different property. And if that property is not typed as OWL
> >>> data property, it will be an RDF property. OWL API and thus Protege
> will
> >>> render this then as OWL annotation property.
> >>>
> >>>
> >>> On 10.01.2017 12:49, neha gupta wrote:
> >>>> The data is stored in RDF/XML
> >>>>
> >>>>  model.write(writer, "RDF/XML");
> >>>>
> >>>> All other properties works fine and stored as data property but just
> >>> this
> >>>> one property is stored in Annotation area.
> >>>> Some weeks ago, I face the same problem but then it was fixed by
> random
> >>>> changes to code. I dont know in which situation this problem comes?
> >>>> I did not show the code because one type of code depends on other and
> >>> you
> >>>> will not be able to understand it easily.
> >>>>
> >>>> On Tue, Jan 10, 2017 at 2:22 PM, Lorenz Buehmann <
> >>>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>>
> >>>>> You're missing again all necessary information...
> >>>>>
> >>>>> You don't show use the code and the data. What is the ontology? In
> >>> which
> >>>>> format do you save it and how? What do you expect from us with no
> >>>>> information like that?
> >>>>>
> >>>>> I don't see the problem so far.
> >>>>>
> >>>>> You load an OWL ontology that has the data property declarations, and
> >>>>> later on you write the same model to disk. Nothing will be converted
> >>>>> into an annotation property then.
> >>>>>
> >>>>>
> >>>>>
> >>>>> On 09.01.2017 22:17, neha gupta wrote:
> >>>>>> Hi
> >>>>>> I have a rule like this
> >>>>>>
> >>>>>> If a team Goal>30 in a League (PremLeague, ChampLeague etc) then it
> is
> >>>>> the
> >>>>>> team FavioriteLeague.
> >>>>>>
> >>>>>> FavioriteLeague is a data property to which teams will be assigned
> >>>>> through
> >>>>>> rules. But the problem here in my case is when I run the program,
> the
> >>>>>> FavioriteLeague property is saved in the "Annotations" section, near
> >>>>>> rdfs:comment and label. Also I see ManchesterCity FavioriteCategory
> >>>>>> PremLeague in Annotation section.
> >>>>>>
> >>>>>> Why this stored there and not as Data property of the team.?
> >>>>>>
> >>>>>> Thank you
> >>>>>>
> >>>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Property stored in Annotaion Section

2017-01-10 Thread neha gupta
*FACup* here is the resource in my ontology

On Tue, Jan 10, 2017 at 11:40 PM, neha gupta  wrote:

> Lorenz, what actually I did is created a data property in Protege :
> "FavioriteLeague".
>
> Then I wrote this rule:
>
> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> http://www.semanticweb.org/soccer#Team) "
>
>  + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +
>
> "greaterThan(?goals,30)
>  + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
> http://www.semanticweb.org/soccer#FACup  )]";
>
>
> On Tue, Jan 10, 2017 at 3:53 PM, Lorenz Buehmann  leipzig.de> wrote:
>
>> Sorry to say that, but with that one line of code I cannot help you.
>>
>>
>> It's not clear how you use the property. And as always, the correct URI
>> matters. If you have somewhere in the code a small type, then it will
>> create a different property. And if that property is not typed as OWL
>> data property, it will be an RDF property. OWL API and thus Protege will
>> render this then as OWL annotation property.
>>
>>
>> On 10.01.2017 12:49, neha gupta wrote:
>> > The data is stored in RDF/XML
>> >
>> >  model.write(writer, "RDF/XML");
>> >
>> > All other properties works fine and stored as data property but just
>> this
>> > one property is stored in Annotation area.
>> > Some weeks ago, I face the same problem but then it was fixed by random
>> > changes to code. I dont know in which situation this problem comes?
>> > I did not show the code because one type of code depends on other and
>> you
>> > will not be able to understand it easily.
>> >
>> > On Tue, Jan 10, 2017 at 2:22 PM, Lorenz Buehmann <
>> > buehm...@informatik.uni-leipzig.de> wrote:
>> >
>> >> You're missing again all necessary information...
>> >>
>> >> You don't show use the code and the data. What is the ontology? In
>> which
>> >> format do you save it and how? What do you expect from us with no
>> >> information like that?
>> >>
>> >> I don't see the problem so far.
>> >>
>> >> You load an OWL ontology that has the data property declarations, and
>> >> later on you write the same model to disk. Nothing will be converted
>> >> into an annotation property then.
>> >>
>> >>
>> >>
>> >> On 09.01.2017 22:17, neha gupta wrote:
>> >>> Hi
>> >>> I have a rule like this
>> >>>
>> >>> If a team Goal>30 in a League (PremLeague, ChampLeague etc) then it is
>> >> the
>> >>> team FavioriteLeague.
>> >>>
>> >>> FavioriteLeague is a data property to which teams will be assigned
>> >> through
>> >>> rules. But the problem here in my case is when I run the program, the
>> >>> FavioriteLeague property is saved in the "Annotations" section, near
>> >>> rdfs:comment and label. Also I see ManchesterCity FavioriteCategory
>> >>> PremLeague in Annotation section.
>> >>>
>> >>> Why this stored there and not as Data property of the team.?
>> >>>
>> >>> Thank you
>> >>>
>> >>
>>
>>
>


Re: Property stored in Annotaion Section

2017-01-10 Thread neha gupta
Lorenz, what actually I did is created a data property in Protege :
"FavioriteLeague".

Then I wrote this rule:

(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.semanticweb.org/soccer#Team) "

 + "( ?x http://www.semanticweb.org/soccer#FACupGoals  ?goals )" +

"greaterThan(?goals,30)
 + " ->  (?x  http://www.semanticweb.org/soccer#FavioriteLeague
http://www.semanticweb.org/soccer#FACup  )]";


On Tue, Jan 10, 2017 at 3:53 PM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> Sorry to say that, but with that one line of code I cannot help you.
>
>
> It's not clear how you use the property. And as always, the correct URI
> matters. If you have somewhere in the code a small type, then it will
> create a different property. And if that property is not typed as OWL
> data property, it will be an RDF property. OWL API and thus Protege will
> render this then as OWL annotation property.
>
>
> On 10.01.2017 12:49, neha gupta wrote:
> > The data is stored in RDF/XML
> >
> >  model.write(writer, "RDF/XML");
> >
> > All other properties works fine and stored as data property but just this
> > one property is stored in Annotation area.
> > Some weeks ago, I face the same problem but then it was fixed by random
> > changes to code. I dont know in which situation this problem comes?
> > I did not show the code because one type of code depends on other and you
> > will not be able to understand it easily.
> >
> > On Tue, Jan 10, 2017 at 2:22 PM, Lorenz Buehmann <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> You're missing again all necessary information...
> >>
> >> You don't show use the code and the data. What is the ontology? In which
> >> format do you save it and how? What do you expect from us with no
> >> information like that?
> >>
> >> I don't see the problem so far.
> >>
> >> You load an OWL ontology that has the data property declarations, and
> >> later on you write the same model to disk. Nothing will be converted
> >> into an annotation property then.
> >>
> >>
> >>
> >> On 09.01.2017 22:17, neha gupta wrote:
> >>> Hi
> >>> I have a rule like this
> >>>
> >>> If a team Goal>30 in a League (PremLeague, ChampLeague etc) then it is
> >> the
> >>> team FavioriteLeague.
> >>>
> >>> FavioriteLeague is a data property to which teams will be assigned
> >> through
> >>> rules. But the problem here in my case is when I run the program, the
> >>> FavioriteLeague property is saved in the "Annotations" section, near
> >>> rdfs:comment and label. Also I see ManchesterCity FavioriteCategory
> >>> PremLeague in Annotation section.
> >>>
> >>> Why this stored there and not as Data property of the team.?
> >>>
> >>> Thank you
> >>>
> >>
>
>


Re: Property stored in Annotaion Section

2017-01-10 Thread neha gupta
The data is stored in RDF/XML

 model.write(writer, "RDF/XML");

All other properties works fine and stored as data property but just this
one property is stored in Annotation area.
Some weeks ago, I face the same problem but then it was fixed by random
changes to code. I dont know in which situation this problem comes?
I did not show the code because one type of code depends on other and you
will not be able to understand it easily.

On Tue, Jan 10, 2017 at 2:22 PM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> You're missing again all necessary information...
>
> You don't show use the code and the data. What is the ontology? In which
> format do you save it and how? What do you expect from us with no
> information like that?
>
> I don't see the problem so far.
>
> You load an OWL ontology that has the data property declarations, and
> later on you write the same model to disk. Nothing will be converted
> into an annotation property then.
>
>
>
> On 09.01.2017 22:17, neha gupta wrote:
> > Hi
> > I have a rule like this
> >
> > If a team Goal>30 in a League (PremLeague, ChampLeague etc) then it is
> the
> > team FavioriteLeague.
> >
> > FavioriteLeague is a data property to which teams will be assigned
> through
> > rules. But the problem here in my case is when I run the program, the
> > FavioriteLeague property is saved in the "Annotations" section, near
> > rdfs:comment and label. Also I see ManchesterCity FavioriteCategory
> > PremLeague in Annotation section.
> >
> > Why this stored there and not as Data property of the team.?
> >
> > Thank you
> >
>
>


Property stored in Annotaion Section

2017-01-09 Thread neha gupta
Hi
I have a rule like this

If a team Goal>30 in a League (PremLeague, ChampLeague etc) then it is the
team FavioriteLeague.

FavioriteLeague is a data property to which teams will be assigned through
rules. But the problem here in my case is when I run the program, the
FavioriteLeague property is saved in the "Annotations" section, near
rdfs:comment and label. Also I see ManchesterCity FavioriteCategory
PremLeague in Annotation section.

Why this stored there and not as Data property of the team.?

Thank you


Add(Sum) operation about individuals not working

2016-12-31 Thread neha gupta
Hello

I have team ontology in which we need to store information about teams like
team wins, goals etc. I need to calculate the team goals in three
categories: PremiurLeague, ChampionsLeague and FA cup.(From combo box each
category should be selected)

 if (Category=="PremiurLeague"){
//get goals
int premGoals=somevalue;
team1.setPropertyValue(goals, literalvalue);

}
if (Category=="ChampLeague"){
//get goals
int champGoals=somevalue;
team1.setPropertyValue(goals, literalvalue);
}
if (Category=="FACup"){
//get goals
int FAGoals=somevalue;
team1.setPropertyValue(goals, literalvalue);
}

int total=premGoals+champGoals+FAGoals;

But it does not give me the total goals, though it gives the individual
league goals.

Note: We enter the information about teams in one or two league at one time
and of third league some other time. So its not necessary to enter
information about all three leagues at one day. *Is it the main issue
because we use setpropertyvalue() method which replaces previous values*.

Thanks and happy New Year

int total


Re: listresourceswithproperty()

2016-12-29 Thread neha gupta
What is the difference between then in
"model.listresourceswithproperty(RDF:type,
Student )"  and

 model.listStatements(null,RDF.type, "Student"); //Student is class in our
ontology

If we want to just retrieve the list of Students (rdf:type Student), which
of the above statement is correct? Or we should write both these
statements.

Regards

On Thu, Dec 29, 2016 at 5:00 PM, A. Soroka  wrote:

> No. The "resources in this model that have property p": the resource that
> has a property is the subject of that property.
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Dec 29, 2016, at 8:57 AM, neha gupta  wrote:
> >
> > Hi Soroka, it will lists both the subjects and objects of the Property p,
> > right?
> >
> >
> >
> > On Thu, Dec 29, 2016 at 4:29 PM, A. Soroka  wrote:
> >
> >> Please consult the Javadocs.
> >>
> >> https://jena.apache.org/documentation/javadoc/jena/
> >> org/apache/jena/rdf/model/Model.html#listResourcesWithProperty-org.
> >> apache.jena.rdf.model.Property-
> >>
> >> "Answer an iterator [with no duplicates] over all the resources in this
> >> model that have property p. remove() is not implemented on this
> iterator."
> >>
> >> ---
> >> A. Soroka
> >> The University of Virginia Library
> >>
> >>> On Dec 29, 2016, at 8:23 AM, neha gupta 
> wrote:
> >>>
> >>> Hello, I want to ask what is the function of this method:
> >>> listresourceswithproperty()
> >>>
> >>> And is it the same as when we query SPARQL like:
> >>>
> >>> Select ?x
> >>> where { ?x rdf:type ?someclass }
> >>>
> >>> A simple example is highly appreciated as I did not find any solid
> >> examples
> >>> on web about it.
> >>>
> >>> Thank you
> >>
> >>
>
>


Re: listresourceswithproperty()

2016-12-29 Thread neha gupta
Hi Soroka, it will lists both the subjects and objects of the Property p,
right?



On Thu, Dec 29, 2016 at 4:29 PM, A. Soroka  wrote:

> Please consult the Javadocs.
>
> https://jena.apache.org/documentation/javadoc/jena/
> org/apache/jena/rdf/model/Model.html#listResourcesWithProperty-org.
> apache.jena.rdf.model.Property-
>
> "Answer an iterator [with no duplicates] over all the resources in this
> model that have property p. remove() is not implemented on this iterator."
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Dec 29, 2016, at 8:23 AM, neha gupta  wrote:
> >
> > Hello, I want to ask what is the function of this method:
> > listresourceswithproperty()
> >
> > And is it the same as when we query SPARQL like:
> >
> > Select ?x
> > where { ?x rdf:type ?someclass }
> >
> > A simple example is highly appreciated as I did not find any solid
> examples
> > on web about it.
> >
> > Thank you
>
>


listresourceswithproperty()

2016-12-29 Thread neha gupta
Hello, I want to ask what is the function of this method:
 listresourceswithproperty()

And is it the same as when we query SPARQL like:

Select ?x
where { ?x rdf:type ?someclass }

A simple example is highly appreciated as I did not find any solid examples
on web about it.

Thank you


Re: Correct syntax of rules

2016-12-01 Thread neha gupta
Thanks Dave, its really new knowledge for me as I thought ^ is used as
AND(conjunction).

On Thu, Dec 1, 2016 at 2:03 AM, Dave Reynolds 
wrote:

> On 30/11/16 17:55, neha gupta wrote:
>
>> (1) greaterThan(?score1,?score2)^(?score1, ?score3)
>>
>>  (2) greaterThan(?score1,?score2)^ greaterThan(?score1, ?score3)
>>
>>  In Jena rules, the ist statement is correct or the second?
>>
>
> Neither, conjunction of terms in Jena rules is just "," so
>
>  ... greaterThan(?score1,?score2), greaterThan(?score1, ?score3) ...
>
> Dave
>
>
>


Correct syntax of rules

2016-11-30 Thread neha gupta
(1) greaterThan(?score1,?score2)^(?score1, ?score3)

 (2) greaterThan(?score1,?score2)^ greaterThan(?score1, ?score3)

 In Jena rules, the ist statement is correct or the second?


Re: "Resource as Object" in Rules

2016-11-24 Thread neha gupta
Hello Lorenz, I have tried but did not work. It means the problem will be
somewhere else. I am working on it.

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

> I don't see why this should not be possible.
>
> And I don't understand why you cannot try it out and see if the expected
> data will be inferred.
>
> > I have a rule like if a team "wins" in Etihad stadium is greater than
> some
> > threshold, Then
> > ?team lg:FavioriteStadium lg:Etihad.
> >
> > lg:Etihad is an instance/resource in my owl file, so can I use this as
> > object in Then part of the rule? Some one told me you can only use a
> Class
> > as object in Then part and that lg:Etihad must me a class, not resource.
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


"Resource as Object" in Rules

2016-11-23 Thread neha gupta
I have a rule like if a team "wins" in Etihad stadium is greater than some
threshold, Then
?team lg:FavioriteStadium lg:Etihad.

lg:Etihad is an instance/resource in my owl file, so can I use this as
object in Then part of the rule? Some one told me you can only use a Class
as object in Then part and that lg:Etihad must me a class, not resource.


Re: Infer data property values

2016-11-16 Thread neha gupta
Hello Lorenz Thanks again. My variable is like

 OntClass favVariable = model.getOntClass(ns + "FavioriteStadium");

//then Jena rule

Since I will login to the system as team1, all information saved will be
for team1. Similarly for other teams.

In my owl file, I have instances (Resources) like "Manchester, Arsenal,
Chelsea etc" for objects of my triples like:
team1  FavStadium  Manchester
team2  FavStadium  Chelsea etc

If I just write the inference model inf to the file like inf.write(), where
it will be saved? As data property?

I have saved all other properties (not in inference model, but traditional
model) like:

team1.setPropertyValue(). I dont know how to do this in the inf model case.

Regards



On Wed, Nov 16, 2016 at 5:21 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
>
> > Hello
> >
> > I have a data property in my owl file: "FavoriteStadium" for a team.
> > Triples will be like team1  FavoriteStadium   ?stadium.
> This is NOT a triple but a triple pattern in SPARQL...triples do not
> contain variables.
> >
> > I will infer the instances using a Jena rule like if a team win % is more
> > in a particular stadium, it will be her favorite stadium.
> > I have two questions here:
> >
> > 1) How can I get the instances like  team1  FavoriteStadium   ?stadium.
> This is not an instance! Again, this is a triple pattern. An instance
> would be team1.
> > Is it the right approach? * inf.listResourcesWithProperty(
> FavoriteStadium,
> > favVariable);*
> This will list the subjects, e.g. team1 in your example, but given that
> favVariable is a variable, this will not work. Your example is confusing
> as you're mixing up SPARQL variable and Java variables. If favVariable
> is some RDFNode, i.e. in your case an RDF resource that denotes a
> particular stadium, then it will return all resources whose favorite
> stadium is the stadium denoted by your Java variable favStadium.
> >
> > 2) *How can I then save it as data property in a file for team1*? I have
> > other properties like this:
> > team1  Wins  10
> > team1  Goals  150
> > team1  income  70%
> >
> > Similarly I want to add it like
> > team1  FavoriteStadium  ?SomeStadium
> Save it as data property? What does this mean? I would assume that a
> stadium is an RDF resource, not a plain String literal.
> And what do you mean by save to file? You can serialize the whole RDF
> model to disk, or you could generate a model for team1 only and
> serialize write it to disk, or you could write it as CSV to disk ,or ...
> >
> > Thanks
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Infer data property values

2016-11-16 Thread neha gupta
Hello

I have a data property in my owl file: "FavoriteStadium" for a team.
Triples will be like team1  FavoriteStadium   ?stadium.

I will infer the instances using a Jena rule like if a team win % is more
in a particular stadium, it will be her favorite stadium.
I have two questions here:

1) How can I get the instances like  team1  FavoriteStadium   ?stadium.
Is it the right approach? * inf.listResourcesWithProperty(FavoriteStadium,
favVariable);*

2) *How can I then save it as data property in a file for team1*? I have
other properties like this:
team1  Wins  10
team1  Goals  150
team1  income  70%

Similarly I want to add it like
team1  FavoriteStadium  ?SomeStadium

Thanks


Re: property values

2016-11-10 Thread neha gupta
Thanks Lorenz sir.

On Wed, Nov 9, 2016 at 12:23 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
> > When I use team1.addLiteral() before team1.getPropertyValue(), it does
> not
> > give me Null error.
> What do you mean by "Null error"? Show us the code please. The method
> returns NULL if there is no such value for the given property:
>
> |RDFNode
>  org/apache/jena/rdf/model/RDFNode.html>|
> |getPropertyValue
>  org/apache/jena/ontology/OntResource.html#getPropertyValue-org.apache.
> jena.rdf.model.Property->(Property
>  org/apache/jena/rdf/model/Property.html> property)|
>
> Answer the value of a given RDF property for this resource, or null if
> it doesn't have one.
>
>
> RDFNode val = team1.getPropertyValue(prop);
> if(val == null) {
> // handle the case here
> }
>
> Is this not clear? How do you do this with other methods or APIs that
> return NULL if no values exists?
> >
> > On Tue, Nov 8, 2016 at 3:11 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> "Good" is very subjective and depends on your design decisions...it
> >> would work, sure.
> >> But, what is the problem with checking for NULL in your code?
> >>
> >>> Is it a good idea to use team1.addLiteral() before
> >> team1.getPropertyValue()
> >>> just to assign some value to the property?
> >>> And then we can write team1.setPropertyValue() to assign the final
> value?
> >>>
> >>>
> >>> On Mon, Nov 7, 2016 at 9:53 AM, Lorenz B. <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
> > I want to ask why data property value "win" does not have default
> zero
> > value? If it was zero, team1.getPropertyValue() would not flush
> >> exception
> > error message?
>  Which exception do you mean? There is no exception thrown but NULL
>  returned. Please show the code and do not ignore this again. Andy also
>  asked you for code.
>  And as Adam said, information in RDF can be "unknown". Moreover, it is
>  schema-less, and it's not a relational database with default values.
> > On Sun, Nov 6, 2016 at 4:44 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> Comments inline:
> >>> Hi
> >>> I want to get the property value and then add add/sum 2 for each
> team
> >> with
> >>> it.
> >>> team1(win value +2) // value is 2 here
> >>> team1(win value +2) // value is 4 here
> >>>
> >>> team.getPropertyValue(Win);
> >>> //then next operation to get value and sum 2
> >>>
> >>> But the issue is I get error as I have not set the value first.
> >> Which "error" do you get? According to [1] it returns null if there
> >> hasn't been a value set before.
> >> Java allows for
> >>
> >> if(something) {
> >> // do something
> >> }
> >>
> >> [1]
> >> https://jena.apache.org/documentation/javadoc/jena/
> >> org/apache/jena/ontology/OntResource.html#
> >> getPropertyValue-org.apache.
> >> jena.rdf.model.Property-
> >>> But if I
> >>> set value before get the value, the property "win" always show that
>  value
> >>> and not after calculated value.
> >>> Is there any way for this issue?
> >> Using an Integer variable in Java that holds the value before if
> >> exists,
> >> else 0 ... ?
> >>
> >> --
> >> 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
> 
> 
> 
> >> --
> >> 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: property values

2016-11-08 Thread neha gupta
When I use team1.addLiteral() before team1.getPropertyValue(), it does not
give me Null error.

On Tue, Nov 8, 2016 at 3:11 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> "Good" is very subjective and depends on your design decisions...it
> would work, sure.
> But, what is the problem with checking for NULL in your code?
>
> > Is it a good idea to use team1.addLiteral() before
> team1.getPropertyValue()
> > just to assign some value to the property?
> > And then we can write team1.setPropertyValue() to assign the final value?
> >
> >
> > On Mon, Nov 7, 2016 at 9:53 AM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >>> I want to ask why data property value "win" does not have default zero
> >>> value? If it was zero, team1.getPropertyValue() would not flush
> exception
> >>> error message?
> >> Which exception do you mean? There is no exception thrown but NULL
> >> returned. Please show the code and do not ignore this again. Andy also
> >> asked you for code.
> >> And as Adam said, information in RDF can be "unknown". Moreover, it is
> >> schema-less, and it's not a relational database with default values.
> >>> On Sun, Nov 6, 2016 at 4:44 PM, Lorenz B. <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
>  Comments inline:
> > Hi
> > I want to get the property value and then add add/sum 2 for each team
>  with
> > it.
> > team1(win value +2) // value is 2 here
> > team1(win value +2) // value is 4 here
> >
> > team.getPropertyValue(Win);
> > //then next operation to get value and sum 2
> >
> > But the issue is I get error as I have not set the value first.
>  Which "error" do you get? According to [1] it returns null if there
>  hasn't been a value set before.
>  Java allows for
> 
>  if(something) {
>  // do something
>  }
> 
>  [1]
>  https://jena.apache.org/documentation/javadoc/jena/
>  org/apache/jena/ontology/OntResource.html#
> getPropertyValue-org.apache.
>  jena.rdf.model.Property-
> > But if I
> > set value before get the value, the property "win" always show that
> >> value
> > and not after calculated value.
> > Is there any way for this issue?
>  Using an Integer variable in Java that holds the value before if
> exists,
>  else 0 ... ?
> 
>  --
>  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
> >>
> >>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: property values

2016-11-08 Thread neha gupta
Is it a good idea to use team1.addLiteral() before team1.getPropertyValue()
just to assign some value to the property?
And then we can write team1.setPropertyValue() to assign the final value?


On Mon, Nov 7, 2016 at 9:53 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
> > I want to ask why data property value "win" does not have default zero
> > value? If it was zero, team1.getPropertyValue() would not flush exception
> > error message?
> Which exception do you mean? There is no exception thrown but NULL
> returned. Please show the code and do not ignore this again. Andy also
> asked you for code.
> And as Adam said, information in RDF can be "unknown". Moreover, it is
> schema-less, and it's not a relational database with default values.
> >
> > On Sun, Nov 6, 2016 at 4:44 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> Comments inline:
> >>> Hi
> >>> I want to get the property value and then add add/sum 2 for each team
> >> with
> >>> it.
> >>> team1(win value +2) // value is 2 here
> >>> team1(win value +2) // value is 4 here
> >>>
> >>> team.getPropertyValue(Win);
> >>> //then next operation to get value and sum 2
> >>>
> >>> But the issue is I get error as I have not set the value first.
> >> Which "error" do you get? According to [1] it returns null if there
> >> hasn't been a value set before.
> >> Java allows for
> >>
> >> if(something) {
> >> // do something
> >> }
> >>
> >> [1]
> >> https://jena.apache.org/documentation/javadoc/jena/
> >> org/apache/jena/ontology/OntResource.html#getPropertyValue-org.apache.
> >> jena.rdf.model.Property-
> >>> But if I
> >>> set value before get the value, the property "win" always show that
> value
> >>> and not after calculated value.
> >>> Is there any way for this issue?
> >> Using an Integer variable in Java that holds the value before if exists,
> >> else 0 ... ?
> >>
> >> --
> >> 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: property values

2016-11-06 Thread neha gupta
I want to ask why data property value "win" does not have default zero
value? If it was zero, team1.getPropertyValue() would not flush exception
error message?

On Sun, Nov 6, 2016 at 4:44 PM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Comments inline:
> > Hi
> > I want to get the property value and then add add/sum 2 for each team
> with
> > it.
> > team1(win value +2) // value is 2 here
> > team1(win value +2) // value is 4 here
> >
> > team.getPropertyValue(Win);
> > //then next operation to get value and sum 2
> >
> > But the issue is I get error as I have not set the value first.
> Which "error" do you get? According to [1] it returns null if there
> hasn't been a value set before.
> Java allows for
>
> if(something) {
> // do something
> }
>
> [1]
> https://jena.apache.org/documentation/javadoc/jena/
> org/apache/jena/ontology/OntResource.html#getPropertyValue-org.apache.
> jena.rdf.model.Property-
> > But if I
> > set value before get the value, the property "win" always show that value
> > and not after calculated value.
> > Is there any way for this issue?
> Using an Integer variable in Java that holds the value before if exists,
> else 0 ... ?
>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>
>


property values

2016-11-05 Thread neha gupta
Hi
I want to get the property value and then add add/sum 2 for each team with
it.
team1(win value +2) // value is 2 here
team1(win value +2) // value is 4 here

team.getPropertyValue(Win);
//then next operation to get value and sum 2

But the issue is I get error as I have not set the value first. But if I
set value before get the value, the property "win" always show that value
and not after calculated value.
Is there any way for this issue?


Re: resultset as string

2016-11-03 Thread neha gupta
It gives me error:

NoSuchElementException: QueryIteratorCloseable
t
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.nextBinding(QueryIteratorBase.java:93)

On Thu, Nov 3, 2016 at 3:35 PM, neha gupta  wrote:

> Thanks Lorenz, I did not know about this method.
>
>
> On Thu, Nov 3, 2016 at 3:00 PM, Lorenz B.  leipzig.de> wrote:
>
>> If you know that there is exactly 1 result why does it not work to call
>> just once rs.next() ? E.g.
>>
>> rs.next().getLiteral(THE_VAR_NAME).getLexicalForm();
>>
>> Lorenz
>>
>> > I have a query which has output of one single string line "My name is
>> ---,
>> > living in city -, located in country .
>> >
>> > After query string , I have executed the query
>> >
>> >  Query query = QueryFactory.create(queryString);
>> > QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
>> > ResultSet rs = qexec.execSelect() ;
>> > I want this string to be displayed as string:
>> > JOptionPane.showMessageDialog(null, string);
>> >
>> > But I dont think I need while(rs.hasNext()) and convert it to string
>> > because resultset only contain one string output at one time.
>> > How can I display the resultset as string?
>> >
>> --
>> Lorenz Bühmann
>> AKSW group, University of Leipzig
>> Group: http://aksw.org - semantic web research center
>>
>>
>


Re: resultset as string

2016-11-03 Thread neha gupta
Thanks Lorenz, I did not know about this method.


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

> If you know that there is exactly 1 result why does it not work to call
> just once rs.next() ? E.g.
>
> rs.next().getLiteral(THE_VAR_NAME).getLexicalForm();
>
> Lorenz
>
> > I have a query which has output of one single string line "My name is
> ---,
> > living in city -, located in country .
> >
> > After query string , I have executed the query
> >
> >  Query query = QueryFactory.create(queryString);
> > QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
> > ResultSet rs = qexec.execSelect() ;
> > I want this string to be displayed as string:
> > JOptionPane.showMessageDialog(null, string);
> >
> > But I dont think I need while(rs.hasNext()) and convert it to string
> > because resultset only contain one string output at one time.
> > How can I display the resultset as string?
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


resultset as string

2016-11-03 Thread neha gupta
I have a query which has output of one single string line "My name is ---,
living in city -, located in country .

After query string , I have executed the query

 Query query = QueryFactory.create(queryString);
QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
ResultSet rs = qexec.execSelect() ;
I want this string to be displayed as string:
JOptionPane.showMessageDialog(null, string);

But I dont think I need while(rs.hasNext()) and convert it to string
because resultset only contain one string output at one time.
How can I display the resultset as string?


Re: Two Models handling

2016-10-29 Thread neha gupta
I mean my main issue and question is how to write few methods like
team.addLiteral() to the second model.?

On Sat, Oct 29, 2016 at 1:49 PM, neha gupta  wrote:

> I have ontology in which I want to add Team wins and goals. In this
> ontology I uses only the current wins using:
> team.setPropertyValue() as it over write old data.
>
> I also need to keep track of previous team wins, goals etc so I want to
> store it in another owl file and will use
> team.addLiteral(). I will use another model for that i-e model2
>
> But I dont know how to write that specific values to second ontology. I
> mean I will have team.setPropertyValue() in my main model and will be
> stored in my main owl file. But how can I store team.addLiteral() in my
> second owl file using model2 ?
>
> my main model to write in file is at the end of code is :
>  infmodel.write(writer, "RDF/XML"); //Because I used rules
>


Two Models handling

2016-10-29 Thread neha gupta
I have ontology in which I want to add Team wins and goals. In this
ontology I uses only the current wins using:
team.setPropertyValue() as it over write old data.

I also need to keep track of previous team wins, goals etc so I want to
store it in another owl file and will use
team.addLiteral(). I will use another model for that i-e model2

But I dont know how to write that specific values to second ontology. I
mean I will have team.setPropertyValue() in my main model and will be
stored in my main owl file. But how can I store team.addLiteral() in my
second owl file using model2 ?

my main model to write in file is at the end of code is :
 infmodel.write(writer, "RDF/XML"); //Because I used rules


Re: Statistic of Data in owl file

2016-10-19 Thread neha gupta
Yes students here are working on projects but we are working independently.

Will it be useful if we use another owl file to store information,  apart
from our main owl file. And use team1.addLiteral() for Number of goals,
wins etc so that data might not be over written.
And in our main owl file, just use recent information using
team1.setPropertyValue().

On Wed, Oct 19, 2016 at 12:42 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Neha,
>
> given that many of you (I read a lots of similar questions) are doing
> some exercise, you should try to think more complex then.
>
> Obviously, one way would be to keep track of the event when data was
> entered.
>
> > I want just to know is there any approach in which we can keep track of
> > data previously entered.
> > I am very sorry but I have not tried any thing related to it as I am
> > completely blind it? I searched the web from last three-four days but
> could
> > not found hints. That is why I asked here in the experts forum.
> >
> >
> >
> > On Tue, Oct 18, 2016 at 11:27 AM, Andy Seaborne  wrote:
> >
> >> neha,
> >>
> >> Your question is too open ended.  Sounds like the whole exercise you
> have
> >> been asked to do.
> >>
> >> What have you tried?
> >>
> >> Try something and show what you have tried and your thoughts about it.
> (a
> >> complete, minimal example - emphasis on "complete" and "minimal").
> >>
> >> Andy
> >>
> >> On 18/10/16 18:41, neha gupta wrote:
> >>
> >>> Good evening,
> >>> I have some team information in my ontology i-e team1 wins, goals, Euro
> >>> goals, Worldcup goals.
> >>>
> >>>  team1 information will be stored like this in owl file. After one
> month,
> >>> again team1 information will be entered, which of course, will over
> write
> >>> the previous one.
> >>>
> >>> Can I maintain the information previously entered *(store previous
> >>> information in some pdf, word format or any other method*) because
> after
> >>> one year I have to maintain some statistics of team1 and their
> performance
> >>> in the year?
> >>>
> >>>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Statistic of Data in owl file

2016-10-18 Thread neha gupta
David, what if we write something like this

team1.setPropertyValue(Goals, literalvalue)

If we enter Goals next time, the previous value will be vanish, right?

On Tue, Oct 18, 2016 at 12:00 PM, David Jordan 
wrote:

> No reason to overwrite anything, each event will have attributes, including
> a date.
>
> On Tue, Oct 18, 2016 at 2:27 PM, Andy Seaborne  wrote:
>
> > neha,
> >
> > Your question is too open ended.  Sounds like the whole exercise you have
> > been asked to do.
> >
> > What have you tried?
> >
> > Try something and show what you have tried and your thoughts about it. (a
> > complete, minimal example - emphasis on "complete" and "minimal").
> >
> > Andy
> >
> >
> > On 18/10/16 18:41, neha gupta wrote:
> >
> >> Good evening,
> >> I have some team information in my ontology i-e team1 wins, goals, Euro
> >> goals, Worldcup goals.
> >>
> >>  team1 information will be stored like this in owl file. After one
> month,
> >> again team1 information will be entered, which of course, will over
> write
> >> the previous one.
> >>
> >> Can I maintain the information previously entered *(store previous
> >> information in some pdf, word format or any other method*) because after
> >> one year I have to maintain some statistics of team1 and their
> performance
> >> in the year?
> >>
> >>
>


Re: Statistic of Data in owl file

2016-10-18 Thread neha gupta
I want just to know is there any approach in which we can keep track of
data previously entered.
I am very sorry but I have not tried any thing related to it as I am
completely blind it? I searched the web from last three-four days but could
not found hints. That is why I asked here in the experts forum.



On Tue, Oct 18, 2016 at 11:27 AM, Andy Seaborne  wrote:

> neha,
>
> Your question is too open ended.  Sounds like the whole exercise you have
> been asked to do.
>
> What have you tried?
>
> Try something and show what you have tried and your thoughts about it. (a
> complete, minimal example - emphasis on "complete" and "minimal").
>
> Andy
>
> On 18/10/16 18:41, neha gupta wrote:
>
>> Good evening,
>> I have some team information in my ontology i-e team1 wins, goals, Euro
>> goals, Worldcup goals.
>>
>>  team1 information will be stored like this in owl file. After one month,
>> again team1 information will be entered, which of course, will over write
>> the previous one.
>>
>> Can I maintain the information previously entered *(store previous
>> information in some pdf, word format or any other method*) because after
>> one year I have to maintain some statistics of team1 and their performance
>> in the year?
>>
>>


Statistic of Data in owl file

2016-10-18 Thread neha gupta
Good evening,
I have some team information in my ontology i-e team1 wins, goals, Euro
goals, Worldcup goals.

 team1 information will be stored like this in owl file. After one month,
again team1 information will be entered, which of course, will over write
the previous one.

Can I maintain the information previously entered *(store previous
information in some pdf, word format or any other method*) because after
one year I have to maintain some statistics of team1 and their performance
in the year?


Re: sum property values

2016-10-12 Thread neha gupta
No I have not tried it yet because Lorenz sir, you did not endorse it in
the last email.
Now I will try it.

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

> I do not understand. You already have the answer and your query does
> what you want. What is the problem now? Did you try the query?
>
> > I am still waiting for any response about how to add/sum values of
> > different data property values in SPARQL?
> >
> >
> >
> > On Sun, Oct 9, 2016 at 8:19 AM, neha gupta 
> wrote:
> >
> >> yes because what I studied about SUM is it sum the values of single
> >> variable.
> >>
> >> SELECT (?worldcupgoals + ?eurogoals+ ?othergoals))
> >> where { ?team rdf:type ont:Team . ?team ont:WorldCup_Goals
> ?worldcupgoals;
> >> ont:EuroCup_Goals ?eurogoals ; ont:Other_Goals ?othergoals}
> >>
> >> On Sun, Oct 9, 2016 at 5:15 AM, Lorenz B.  >> leipzig.de> wrote:
> >>
> >>> No, that's obviously wrong. And you don't need GROUP BY and SUM - in
> >>> your examples it's even the wrong way.
> >>> Simply SELECT the team and use '+' to compute the sum of the different
> >>> goal values.
> >>>
> >>> And why can't you try it out?
> >>>
> >>>> Will it works like:
> >>>>
> >>>> SELECT (SUM(?worldcupgoals ?eurogoals ?othergoals))
> >>>> where { ?team rdf:type ont:Team . ?team ont:WorldCup_Goals
> >>> ?worldcupgoals;
> >>>> ont:EuroCup_Goals ?eurogoals ; ont:Other_Goals ?othergoals}
> >>>>
> >>>>
> >>>> On Sat, Oct 8, 2016 at 12:43 PM, Martynas Jusevičius <
> >>> marty...@graphity.org>
> >>>> wrote:
> >>>>
> >>>>> https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#aggr
> >>> egateExample
> >>>>> On Sat, Oct 8, 2016 at 9:35 PM, neha gupta 
> >>> wrote:
> >>>>>> I am sorry but need some details? I really have no idea how to sum
> >>>>> multiple
> >>>>>> values (data properties) using SPARQL, despite searched the web.
> >>>>>>
> >>>>>> On Sat, Oct 8, 2016 at 11:21 AM, Andy Seaborne 
> >>> wrote:
> >>>>>>> SUM and GROUP BY
> >>>>>>>
> >>>>>>> Andy
> >>>>>>>
> >>>>>>>
> >>>>>>> On 08/10/16 19:14, neha gupta wrote:
> >>>>>>>
> >>>>>>>> team1  WorldCup_Goals  20
> >>>>>>>> team1  EuroCup_Goals   25
> >>>>>>>> team1  Other_Goals50
> >>>>>>>>
> >>>>>>>> WorldCup_Goals,  EuroCup_Goals and Other_Goals are my properties.
> >>>>>>>>
> >>>>>>>> How to calculate total goals of team1 using SPARQL?
> >>>>>>>>
> >>>>>>>>
> >>> --
> >>> 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: sum property values

2016-10-11 Thread neha gupta
I am still waiting for any response about how to add/sum values of
different data property values in SPARQL?



On Sun, Oct 9, 2016 at 8:19 AM, neha gupta  wrote:

> yes because what I studied about SUM is it sum the values of single
> variable.
>
> SELECT (?worldcupgoals + ?eurogoals+ ?othergoals))
> where { ?team rdf:type ont:Team . ?team ont:WorldCup_Goals ?worldcupgoals;
> ont:EuroCup_Goals ?eurogoals ; ont:Other_Goals ?othergoals}
>
> On Sun, Oct 9, 2016 at 5:15 AM, Lorenz B.  leipzig.de> wrote:
>
>> No, that's obviously wrong. And you don't need GROUP BY and SUM - in
>> your examples it's even the wrong way.
>> Simply SELECT the team and use '+' to compute the sum of the different
>> goal values.
>>
>> And why can't you try it out?
>>
>> > Will it works like:
>> >
>> > SELECT (SUM(?worldcupgoals ?eurogoals ?othergoals))
>> > where { ?team rdf:type ont:Team . ?team ont:WorldCup_Goals
>> ?worldcupgoals;
>> > ont:EuroCup_Goals ?eurogoals ; ont:Other_Goals ?othergoals}
>> >
>> >
>> > On Sat, Oct 8, 2016 at 12:43 PM, Martynas Jusevičius <
>> marty...@graphity.org>
>> > wrote:
>> >
>> >> https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#aggr
>> egateExample
>> >>
>> >> On Sat, Oct 8, 2016 at 9:35 PM, neha gupta 
>> wrote:
>> >>> I am sorry but need some details? I really have no idea how to sum
>> >> multiple
>> >>> values (data properties) using SPARQL, despite searched the web.
>> >>>
>> >>> On Sat, Oct 8, 2016 at 11:21 AM, Andy Seaborne 
>> wrote:
>> >>>
>> >>>> SUM and GROUP BY
>> >>>>
>> >>>> Andy
>> >>>>
>> >>>>
>> >>>> On 08/10/16 19:14, neha gupta wrote:
>> >>>>
>> >>>>> team1  WorldCup_Goals  20
>> >>>>> team1  EuroCup_Goals   25
>> >>>>> team1  Other_Goals50
>> >>>>>
>> >>>>> WorldCup_Goals,  EuroCup_Goals and Other_Goals are my properties.
>> >>>>>
>> >>>>> How to calculate total goals of team1 using SPARQL?
>> >>>>>
>> >>>>>
>> --
>> Lorenz Bühmann
>> AKSW group, University of Leipzig
>> Group: http://aksw.org - semantic web research center
>>
>>
>


Re: sum property values

2016-10-09 Thread neha gupta
yes because what I studied about SUM is it sum the values of single
variable.

SELECT (?worldcupgoals + ?eurogoals+ ?othergoals))
where { ?team rdf:type ont:Team . ?team ont:WorldCup_Goals ?worldcupgoals;
ont:EuroCup_Goals ?eurogoals ; ont:Other_Goals ?othergoals}

On Sun, Oct 9, 2016 at 5:15 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> No, that's obviously wrong. And you don't need GROUP BY and SUM - in
> your examples it's even the wrong way.
> Simply SELECT the team and use '+' to compute the sum of the different
> goal values.
>
> And why can't you try it out?
>
> > Will it works like:
> >
> > SELECT (SUM(?worldcupgoals ?eurogoals ?othergoals))
> > where { ?team rdf:type ont:Team . ?team ont:WorldCup_Goals
> ?worldcupgoals;
> > ont:EuroCup_Goals ?eurogoals ; ont:Other_Goals ?othergoals}
> >
> >
> > On Sat, Oct 8, 2016 at 12:43 PM, Martynas Jusevičius <
> marty...@graphity.org>
> > wrote:
> >
> >> https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#
> aggregateExample
> >>
> >> On Sat, Oct 8, 2016 at 9:35 PM, neha gupta 
> wrote:
> >>> I am sorry but need some details? I really have no idea how to sum
> >> multiple
> >>> values (data properties) using SPARQL, despite searched the web.
> >>>
> >>> On Sat, Oct 8, 2016 at 11:21 AM, Andy Seaborne 
> wrote:
> >>>
> >>>> SUM and GROUP BY
> >>>>
> >>>> Andy
> >>>>
> >>>>
> >>>> On 08/10/16 19:14, neha gupta wrote:
> >>>>
> >>>>> team1  WorldCup_Goals  20
> >>>>> team1  EuroCup_Goals   25
> >>>>> team1  Other_Goals50
> >>>>>
> >>>>> WorldCup_Goals,  EuroCup_Goals and Other_Goals are my properties.
> >>>>>
> >>>>> How to calculate total goals of team1 using SPARQL?
> >>>>>
> >>>>>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: sum property values

2016-10-08 Thread neha gupta
Will it works like:

SELECT (SUM(?worldcupgoals ?eurogoals ?othergoals))
where { ?team rdf:type ont:Team . ?team ont:WorldCup_Goals ?worldcupgoals;
ont:EuroCup_Goals ?eurogoals ; ont:Other_Goals ?othergoals}


On Sat, Oct 8, 2016 at 12:43 PM, Martynas Jusevičius 
wrote:

> https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#aggregateExample
>
> On Sat, Oct 8, 2016 at 9:35 PM, neha gupta  wrote:
> > I am sorry but need some details? I really have no idea how to sum
> multiple
> > values (data properties) using SPARQL, despite searched the web.
> >
> > On Sat, Oct 8, 2016 at 11:21 AM, Andy Seaborne  wrote:
> >
> >> SUM and GROUP BY
> >>
> >> Andy
> >>
> >>
> >> On 08/10/16 19:14, neha gupta wrote:
> >>
> >>> team1  WorldCup_Goals  20
> >>> team1  EuroCup_Goals   25
> >>> team1  Other_Goals50
> >>>
> >>> WorldCup_Goals,  EuroCup_Goals and Other_Goals are my properties.
> >>>
> >>> How to calculate total goals of team1 using SPARQL?
> >>>
> >>>
>


Re: sum property values

2016-10-08 Thread neha gupta
I am sorry but need some details? I really have no idea how to sum multiple
values (data properties) using SPARQL, despite searched the web.

On Sat, Oct 8, 2016 at 11:21 AM, Andy Seaborne  wrote:

> SUM and GROUP BY
>
> Andy
>
>
> On 08/10/16 19:14, neha gupta wrote:
>
>> team1  WorldCup_Goals  20
>> team1  EuroCup_Goals   25
>> team1  Other_Goals50
>>
>> WorldCup_Goals,  EuroCup_Goals and Other_Goals are my properties.
>>
>> How to calculate total goals of team1 using SPARQL?
>>
>>


sum property values

2016-10-08 Thread neha gupta
team1  WorldCup_Goals  20
team1  EuroCup_Goals   25
team1  Other_Goals50

WorldCup_Goals,  EuroCup_Goals and Other_Goals are my properties.

How to calculate total goals of team1 using SPARQL?


Re: Fetch value from data property

2016-10-02 Thread neha gupta
Thanks a lot sir Lorenz.


On Sun, Oct 2, 2016 at 5:30 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Yes, but according to Javadoc only if there is at most one value,
> otherwise you get one of the values randomly. For multiple values you
> would have to use listPropertyValues
>
> > Is it the right way to get int value from a property?
> >
> >  RDFNode intValue =team1.getPropertyValue(wins);
> >
> > On Sun, Oct 2, 2016 at 4:27 AM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >>
> >>> "You have to get the "wins" value for "team1" first"
> >>> This is the basic problem I do not know how to get the int value from
> >>> "wins"?
> >> Not from "wins" but from the resource "team1" which is related by the
> >> property "wins" to an integer value. If you do not understand this, you
> >> will never be able to solve the problem and also do not ask the right
> >> questions here.
> >>> "you first have to get the "team1" individual/resource."
> >>> I have individual like this:
> >>>  Individual team1 = team.createIndividual(ns + name); //name java
> >> variable.
> >> I told you to use Javadoc and the documentation of Jena which is quite
> >> good. You have to learn to use Javadoc if you're programming in Java...
> >>
> >> https://jena.apache.org/documentation/javadoc/jena/
> >> org/apache/jena/ontology/Individual.html
> >>
> >> Now, try to find out which method makes sense for your needs. You have a
> >> property and want its value(s)
> >>> On Sat, Oct 1, 2016 at 8:20 AM, Lorenz B. <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
>  You have to get the "wins" value for "team1" first, then set the new
>  "wins" value for "team1" . That means you first have to get the
> "team1"
>  individual/resource.
> 
>  RDF data model:
> 
>  team1 wins 3
> 
>  team1 = is an individual resp. a resource
>  wins = is a data property
>  3 = is a literal value
> 
> > I am sorry Lorenz sir,
> > Basically what I want to sum a team wins. When value is entered in
> text
> > field, it is saved as data property "Wins" value in the file i-e
> team1
>  Wins
> > 3. Since this value 3 is stored in owl file, when another entry is
> made
>  for
> > Wins property, say 2, I want to sum this new value with the previous
>  value
> > of Wins property so that it does not stored in the file as:
> > team1 wins 2
> > team1 wins 3
> >
> > *but rather it is stored as:*
> > *team1 wins 5*
> >
> > // variable is java variable having integer value i-e 2
> > *Literal wins=model.createTypedLiteral(variable);*
> > *int win_value=wins.getInt();*
> >
> > *I just want to sum win_value (i-e  2)  with the value in data
> property
> > "Wins"*
> >
> > OntProperty winsProperty = model.getOntProperty(ns+ "Wins");
> >
> > So without SPARQL, can we get integer value of data property Wins so
> >> that
> > we can do
> >
> >  int total_wins= win_value+ (The value from data property Wins).
> >
> > Sorry again for these types of questions, but I am learning Jena
> course
>  my
> > own and I have not studied it in my Bachelor degree (But have to use
> it
>  in
> > my BS project)
> >
> >
> >
> > On Sat, Oct 1, 2016 at 7:07 AM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> What the hell are you doing here?! Javadoc + Jena documentation is
> >> your
> >> friend.
> >>
> >> It does not fetch any data, but creates a property and a literal
> with
> >> the value that is the property object which is totally wrong.
> >>
> >> First, use proper variable names.
> >>
> >>
> >>> Is this a proper way to fetch the int value from data property?
> >>>
> >>> OntProperty value=model.getOntProperty(ns+ "Wins");
> >> Obviously, this line creates a property object, i.e. call it
> >> "property"
> >> or "p" or "winsProperty" or whatever, but not value.
> >>
> >> OntProperty winsProperty = model.getOntProperty(ns+ "Wins");
> >>
> >>
> >>>  Literal myliteral = model.createTypedLiteral(value);
> >> This line creates a Literal object whose value is the property
> object,
> >> but that's totally wrong. If you want to create an int literal, use
> an
> >> integer as argument
> >>
> >> Literal myliteral = model.createTypedLiteral(3);
> >>
> >>
> >>
> >>>int sum=myliteral.getInt();
> >> Again weird naming of Java variables which makes the code unreadable
> >> and
> >> even more nobody will understand what you want to achieve.
> >> The sum of what?
> >>>sum=sum+1;
> >> It should be clear that data is assigned to RDF resources, that
> means
> >> you need a resource as well ,that's why the RDF data model is made
> of
> >> triples (subject, predicate, object), and from the above code you
> onl

Re: Fetch value from data property

2016-10-02 Thread neha gupta
Is it the right way to get int value from a property?

 RDFNode intValue =team1.getPropertyValue(wins);

On Sun, Oct 2, 2016 at 4:27 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
>
> > "You have to get the "wins" value for "team1" first"
> > This is the basic problem I do not know how to get the int value from
> > "wins"?
> Not from "wins" but from the resource "team1" which is related by the
> property "wins" to an integer value. If you do not understand this, you
> will never be able to solve the problem and also do not ask the right
> questions here.
> >
> > "you first have to get the "team1" individual/resource."
> > I have individual like this:
> >  Individual team1 = team.createIndividual(ns + name); //name java
> variable.
> I told you to use Javadoc and the documentation of Jena which is quite
> good. You have to learn to use Javadoc if you're programming in Java...
>
> https://jena.apache.org/documentation/javadoc/jena/
> org/apache/jena/ontology/Individual.html
>
> Now, try to find out which method makes sense for your needs. You have a
> property and want its value(s)
> >
> > On Sat, Oct 1, 2016 at 8:20 AM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> You have to get the "wins" value for "team1" first, then set the new
> >> "wins" value for "team1" . That means you first have to get the "team1"
> >> individual/resource.
> >>
> >> RDF data model:
> >>
> >> team1 wins 3
> >>
> >> team1 = is an individual resp. a resource
> >> wins = is a data property
> >> 3 = is a literal value
> >>
> >>> I am sorry Lorenz sir,
> >>> Basically what I want to sum a team wins. When value is entered in text
> >>> field, it is saved as data property "Wins" value in the file i-e team1
> >> Wins
> >>> 3. Since this value 3 is stored in owl file, when another entry is made
> >> for
> >>> Wins property, say 2, I want to sum this new value with the previous
> >> value
> >>> of Wins property so that it does not stored in the file as:
> >>> team1 wins 2
> >>> team1 wins 3
> >>>
> >>> *but rather it is stored as:*
> >>> *team1 wins 5*
> >>>
> >>> // variable is java variable having integer value i-e 2
> >>> *Literal wins=model.createTypedLiteral(variable);*
> >>> *int win_value=wins.getInt();*
> >>>
> >>> *I just want to sum win_value (i-e  2)  with the value in data property
> >>> "Wins"*
> >>>
> >>> OntProperty winsProperty = model.getOntProperty(ns+ "Wins");
> >>>
> >>> So without SPARQL, can we get integer value of data property Wins so
> that
> >>> we can do
> >>>
> >>>  int total_wins= win_value+ (The value from data property Wins).
> >>>
> >>> Sorry again for these types of questions, but I am learning Jena course
> >> my
> >>> own and I have not studied it in my Bachelor degree (But have to use it
> >> in
> >>> my BS project)
> >>>
> >>>
> >>>
> >>> On Sat, Oct 1, 2016 at 7:07 AM, Lorenz B. <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
>  What the hell are you doing here?! Javadoc + Jena documentation is
> your
>  friend.
> 
>  It does not fetch any data, but creates a property and a literal with
>  the value that is the property object which is totally wrong.
> 
>  First, use proper variable names.
> 
> 
> > Is this a proper way to fetch the int value from data property?
> >
> > OntProperty value=model.getOntProperty(ns+ "Wins");
>  Obviously, this line creates a property object, i.e. call it
> "property"
>  or "p" or "winsProperty" or whatever, but not value.
> 
>  OntProperty winsProperty = model.getOntProperty(ns+ "Wins");
> 
> 
> >  Literal myliteral = model.createTypedLiteral(value);
>  This line creates a Literal object whose value is the property object,
>  but that's totally wrong. If you want to create an int literal, use an
>  integer as argument
> 
>  Literal myliteral = model.createTypedLiteral(3);
> 
> 
> 
> >int sum=myliteral.getInt();
>  Again weird naming of Java variables which makes the code unreadable
> and
>  even more nobody will understand what you want to achieve.
>  The sum of what?
> >sum=sum+1;
>  It should be clear that data is assigned to RDF resources, that means
>  you need a resource as well ,that's why the RDF data model is made of
>  triples (subject, predicate, object), and from the above code you only
>  have predicate and object.
> 
>  --
>  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
> >>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Fetch value from data property

2016-10-01 Thread neha gupta
"You have to get the "wins" value for "team1" first"
This is the basic problem I do not know how to get the int value from
"wins"?

"you first have to get the "team1" individual/resource."
I have individual like this:
 Individual team1 = team.createIndividual(ns + name); //name java variable.

On Sat, Oct 1, 2016 at 8:20 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> You have to get the "wins" value for "team1" first, then set the new
> "wins" value for "team1" . That means you first have to get the "team1"
> individual/resource.
>
> RDF data model:
>
> team1 wins 3
>
> team1 = is an individual resp. a resource
> wins = is a data property
> 3 = is a literal value
>
> > I am sorry Lorenz sir,
> > Basically what I want to sum a team wins. When value is entered in text
> > field, it is saved as data property "Wins" value in the file i-e team1
> Wins
> > 3. Since this value 3 is stored in owl file, when another entry is made
> for
> > Wins property, say 2, I want to sum this new value with the previous
> value
> > of Wins property so that it does not stored in the file as:
> > team1 wins 2
> > team1 wins 3
> >
> > *but rather it is stored as:*
> > *team1 wins 5*
> >
> > // variable is java variable having integer value i-e 2
> > *Literal wins=model.createTypedLiteral(variable);*
> > *int win_value=wins.getInt();*
> >
> > *I just want to sum win_value (i-e  2)  with the value in data property
> > "Wins"*
> >
> > OntProperty winsProperty = model.getOntProperty(ns+ "Wins");
> >
> > So without SPARQL, can we get integer value of data property Wins so that
> > we can do
> >
> >  int total_wins= win_value+ (The value from data property Wins).
> >
> > Sorry again for these types of questions, but I am learning Jena course
> my
> > own and I have not studied it in my Bachelor degree (But have to use it
> in
> > my BS project)
> >
> >
> >
> > On Sat, Oct 1, 2016 at 7:07 AM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> What the hell are you doing here?! Javadoc + Jena documentation is your
> >> friend.
> >>
> >> It does not fetch any data, but creates a property and a literal with
> >> the value that is the property object which is totally wrong.
> >>
> >> First, use proper variable names.
> >>
> >>
> >>> Is this a proper way to fetch the int value from data property?
> >>>
> >>> OntProperty value=model.getOntProperty(ns+ "Wins");
> >> Obviously, this line creates a property object, i.e. call it "property"
> >> or "p" or "winsProperty" or whatever, but not value.
> >>
> >> OntProperty winsProperty = model.getOntProperty(ns+ "Wins");
> >>
> >>
> >>>  Literal myliteral = model.createTypedLiteral(value);
> >> This line creates a Literal object whose value is the property object,
> >> but that's totally wrong. If you want to create an int literal, use an
> >> integer as argument
> >>
> >> Literal myliteral = model.createTypedLiteral(3);
> >>
> >>
> >>
> >>>int sum=myliteral.getInt();
> >> Again weird naming of Java variables which makes the code unreadable and
> >> even more nobody will understand what you want to achieve.
> >> The sum of what?
> >>>sum=sum+1;
> >> It should be clear that data is assigned to RDF resources, that means
> >> you need a resource as well ,that's why the RDF data model is made of
> >> triples (subject, predicate, object), and from the above code you only
> >> have predicate and object.
> >>
> >> --
> >> 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: Fetch value from data property

2016-10-01 Thread neha gupta
I am sorry Lorenz sir,
Basically what I want to sum a team wins. When value is entered in text
field, it is saved as data property "Wins" value in the file i-e team1 Wins
3. Since this value 3 is stored in owl file, when another entry is made for
Wins property, say 2, I want to sum this new value with the previous value
of Wins property so that it does not stored in the file as:
team1 wins 2
team1 wins 3

*but rather it is stored as:*
*team1 wins 5*

// variable is java variable having integer value i-e 2
*Literal wins=model.createTypedLiteral(variable);*
*int win_value=wins.getInt();*

*I just want to sum win_value (i-e  2)  with the value in data property
"Wins"*

OntProperty winsProperty = model.getOntProperty(ns+ "Wins");

So without SPARQL, can we get integer value of data property Wins so that
we can do

 int total_wins= win_value+ (The value from data property Wins).

Sorry again for these types of questions, but I am learning Jena course my
own and I have not studied it in my Bachelor degree (But have to use it in
my BS project)



On Sat, Oct 1, 2016 at 7:07 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> What the hell are you doing here?! Javadoc + Jena documentation is your
> friend.
>
> It does not fetch any data, but creates a property and a literal with
> the value that is the property object which is totally wrong.
>
> First, use proper variable names.
>
>
> > Is this a proper way to fetch the int value from data property?
> >
> > OntProperty value=model.getOntProperty(ns+ "Wins");
> Obviously, this line creates a property object, i.e. call it "property"
> or "p" or "winsProperty" or whatever, but not value.
>
> OntProperty winsProperty = model.getOntProperty(ns+ "Wins");
>
>
> >
> >  Literal myliteral = model.createTypedLiteral(value);
> This line creates a Literal object whose value is the property object,
> but that's totally wrong. If you want to create an int literal, use an
> integer as argument
>
> Literal myliteral = model.createTypedLiteral(3);
>
>
>
> >
> >int sum=myliteral.getInt();
> Again weird naming of Java variables which makes the code unreadable and
> even more nobody will understand what you want to achieve.
> The sum of what?
> >sum=sum+1;
>
> It should be clear that data is assigned to RDF resources, that means
> you need a resource as well ,that's why the RDF data model is made of
> triples (subject, predicate, object), and from the above code you only
> have predicate and object.
>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Fetch value from data property

2016-10-01 Thread neha gupta
Is this a proper way to fetch the int value from data property?

OntProperty value=model.getOntProperty(ns+ "Wins");

 Literal myliteral = model.createTypedLiteral(value);

   int sum=myliteral.getInt();
   sum=sum+1;


Re: Construct query

2016-10-01 Thread neha gupta
Actually I have the same query like Tina, but can you explain it in term of
a Student ontology because I understand the Student ontology more.

Like Student hasCourse ?course.
Teacher teaches ?course

On Sat, Oct 1, 2016 at 3:10 AM, neha gupta  wrote:

> Paul, thank you.
>
> If I have Student/University ontology and the ontology does not have
> "hasResearch" property can we create like this:
>
> CONSTRUCT {?s ex:hasResearch ?research}
> WHERE {?s rdf:type ex:Student;ex:hasResearch  "C-SPARQL"}
>
> to create the property and assign instance to it?
>
> On Fri, Sep 30, 2016 at 8:52 PM, Paul Tyson  wrote:
>
>> On Thu, 2016-09-29 at 13:44 -0700, tina sani wrote:
>> > I want to know about the Construct query.
>> > How it differs from Select query
>>
>> One way to think about it, if you have any background in relational
>> databases, is that SELECT returns a highly denormalized table (at least,
>> from any non-trivial query). On the other hand, CONSTRUCT will give you
>> an over-normalized set of tables, if you think of each RDF property
>> triple (or quad, if you include graph uri) as an RDBMS table.
>>
>> That is a very abstract view. Syntactically, the results of CONSTRUCT
>> and SELECT are quite different. SELECT must be serialized into something
>> like a table model (csv or the isomorphic xml, json, or text versions).
>> CONSTRUCT results are serialized into some RDF format.
>>
>> > Is it create a new property/class which is not already in the ontology
>> or
>> > it just creates new triples.
>>
>> You can do either (or both). You can use CONSTRUCT to extract a
>> subgraph, or to create new triples based on some rules about the
>> existing data.
>>
>> > I will appreciate if some one come with a simple example. I have
>> searched
>> > web, but could not grasp it.
>>
>> Extract a subgraph. Just get rdf:type and rdfs:label of all subjects.
>> CONSTRUCT {?s rdf:type ?type;rdfs:label ?label}
>> WHERE {?s rdf:type ?type;rdfs:label ?label}
>>
>> Make a new statement based on certain conditions in the dataset.
>> CONSTRUCT {?s :new-property false}
>> WHERE {?s rdf:type ex:TypeA;ex:property1 "A"}
>>
>> Materialize superclass properties:
>> CONSTRUCT {?s rdf:type ?super}
>> WHERE {?s rdf:type ?type;?type rdfs:subClassOf* ?super}
>>
>> As another responder mentioned, CONSTRUCT just returns the triples--it
>> does not modify the dataset. Use a SPARQL update statement
>> (INSERT/WHERE) for that. I've found that with complex or large results
>> it is better in jena to do a CONSTRUCT query and then load the triples
>> into the TDB repository, rather than do an INSERT/WHERE update, which
>> can exhaust resources if the resulting graph is large.
>>
>> Hope this helps.
>>
>> Regards,
>> --Paul
>>
>>
>


Re: Construct query

2016-10-01 Thread neha gupta
Paul, thank you.

If I have Student/University ontology and the ontology does not have
"hasResearch" property can we create like this:

CONSTRUCT {?s ex:hasResearch ?research}
WHERE {?s rdf:type ex:Student;ex:hasResearch  "C-SPARQL"}

to create the property and assign instance to it?

On Fri, Sep 30, 2016 at 8:52 PM, Paul Tyson  wrote:

> On Thu, 2016-09-29 at 13:44 -0700, tina sani wrote:
> > I want to know about the Construct query.
> > How it differs from Select query
>
> One way to think about it, if you have any background in relational
> databases, is that SELECT returns a highly denormalized table (at least,
> from any non-trivial query). On the other hand, CONSTRUCT will give you
> an over-normalized set of tables, if you think of each RDF property
> triple (or quad, if you include graph uri) as an RDBMS table.
>
> That is a very abstract view. Syntactically, the results of CONSTRUCT
> and SELECT are quite different. SELECT must be serialized into something
> like a table model (csv or the isomorphic xml, json, or text versions).
> CONSTRUCT results are serialized into some RDF format.
>
> > Is it create a new property/class which is not already in the ontology or
> > it just creates new triples.
>
> You can do either (or both). You can use CONSTRUCT to extract a
> subgraph, or to create new triples based on some rules about the
> existing data.
>
> > I will appreciate if some one come with a simple example. I have searched
> > web, but could not grasp it.
>
> Extract a subgraph. Just get rdf:type and rdfs:label of all subjects.
> CONSTRUCT {?s rdf:type ?type;rdfs:label ?label}
> WHERE {?s rdf:type ?type;rdfs:label ?label}
>
> Make a new statement based on certain conditions in the dataset.
> CONSTRUCT {?s :new-property false}
> WHERE {?s rdf:type ex:TypeA;ex:property1 "A"}
>
> Materialize superclass properties:
> CONSTRUCT {?s rdf:type ?super}
> WHERE {?s rdf:type ?type;?type rdfs:subClassOf* ?super}
>
> As another responder mentioned, CONSTRUCT just returns the triples--it
> does not modify the dataset. Use a SPARQL update statement
> (INSERT/WHERE) for that. I've found that with complex or large results
> it is better in jena to do a CONSTRUCT query and then load the triples
> into the TDB repository, rather than do an INSERT/WHERE update, which
> can exhaust resources if the resulting graph is large.
>
> Hope this helps.
>
> Regards,
> --Paul
>
>


Re: New entered value does not sum with previous value in owl file

2016-09-30 Thread neha gupta
Hello Lorenz, I have assigned the value to team1 but mistakenly typed only
team.
The Chris Dollin comment about "*setPropertyValue is /documented/ as
deleting any previous value **for that property" *
*makes sense but if I write *
team1.addLiteral(goals, p), in place of team1.setPropertyValue(goals, p)

then it saves new data and the previously saved data is also there.

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

> I don't understand why you assign an integer value to a class "Team" and
> not an individual like "team1" which belongs to the class "Team"
>
> > Hello this does not sum the newly entered goals with the one already
> saved
> > in my owl file. Every time I enter new goal (integer value), new data is
> > saved and does not added(sum) with previously entered values.
> >
> > * int goalsss = soln.getLiteral("goal").getInt() ; //return integer
> value*
> > *int totalgoals=goalsss+totalgoals;   // total goals initial value is 0*
> >
> > *Literal p = model.createTypedLiteral(totalgoals);*
> > * team.setPropertyValue(goals, p);// here goals is property name*
> >
> >
> > OntModel model=ModelFactory.createOntologyModel();
> > InputStream in =FileManager.get().open("D://ont/soccer.owl");
> > if (in==null) {
> > throw new IllegalArgumentException( "File: " +  " not
> > there");
> > }   model.read(in,"");
> >  String ns="http://www.semanticweb.
> org/neha/ontologies/2016/6/
> > untitled-ontology-11#";
> >
> >  OntClass team = model.getOntClass(ns + "Team");
> > OntProperty goals=model.getOntProperty(ns+ "Goals");
> >
> > //Goals  are entered by admin, so I want to sum the newly entered
> >  //goals with previous stored in ontology.
> > //This is why I need integer values from these properties.
> >
> > SELECT  *" +
> > " WHERE {  ?x rdf:type  ont:Team . ?x ont:Goals  ?goal  )
> >  ";
> >
> >
> > Query query = QueryFactory.create(queryString) ;
> >  QueryExecution qexec = QueryExecutionFactory.create(
> query,
> > model);
> >  ResultSet results = qexec.execSelect() ;
> >  while(results.hasNext()){
> >   QuerySolution soln = results.nextSolution() ;
> >  int goalsss = soln.getLiteral("goal").getInt() ;
> > int totalgoals=goalsss+totalgoals;
> > Literal p = model.createTypedLiteral(totalgoals);
> >  team.setPropertyValue(goals, p);// here goals is property name
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: New entered value does not sum with previous value in owl file

2016-09-30 Thread neha gupta
Actually their are many call from other classes thats why it is useless to
copy all the code and paste here.
I tried to type the code so that you understand it. I am sorry for any
inconvenience.


On Fri, Sep 30, 2016 at 5:06 AM, Chris Dollin 
wrote:

> On 30/09/16 12:08, neha gupta wrote:
>
>> Hello this does not sum the newly entered goals with the one already saved
>> in my owl file. Every time I enter new goal (integer value), new data is
>> saved and does not added(sum) with previously entered values.
>>
>
> You are not showing us the code you are using.
>
> Really, you're not.
>
> >
> > * int goalsss = soln.getLiteral("goal").getInt() ; //return integer
> value*
> > *int totalgoals=goalsss+totalgoals;   // total goals initial value is 0*
> >
> > *Literal p = model.createTypedLiteral(totalgoals);*
> > * team.setPropertyValue(goals, p);// here goals is property name*
> >
>
> There are these asterisks, which you probably meant as
> highlighting. Don't do that. We want to be able to paste
> the code you wrote, which should be the same as the code you
> sent, into our local editors/IDEs, and tinker with it.
> The line
>
>  *int totalgoals=goalsss+totalgoals;   // total goals initial value
> is 0*
>
> isn't legal even if you drop the * and pretend it's in the middle
> of a function, and
>
>   team.setPropertyValue(goals, p);// here goals is property name*
>
> isn't legal because `team` isn't declared yet.
>
> So if we can't see the code you wrote, we can't tell
> whether it's right or not.
>
>   team.setPropertyValue(goals, p);// here goals is property name
>
> setPropertyValue is /documented/ as deleting any previous value
> for that property and, if it didn't do that, all sorts of other
> things wouldn't work. I think it's more likely that you're
> not applying it to the right object -- but since you /don't
> show your code/ and /don't show your data/, how are we to tell?
>
> Chris
>
>
>
>


New entered value does not sum with previous value in owl file

2016-09-30 Thread neha gupta
Hello this does not sum the newly entered goals with the one already saved
in my owl file. Every time I enter new goal (integer value), new data is
saved and does not added(sum) with previously entered values.

* int goalsss = soln.getLiteral("goal").getInt() ; //return integer value*
*int totalgoals=goalsss+totalgoals;   // total goals initial value is 0*

*Literal p = model.createTypedLiteral(totalgoals);*
* team.setPropertyValue(goals, p);// here goals is property name*


OntModel model=ModelFactory.createOntologyModel();
InputStream in =FileManager.get().open("D://ont/soccer.owl");
if (in==null) {
throw new IllegalArgumentException( "File: " +  " not
there");
}   model.read(in,"");
 String ns="http://www.semanticweb.org/neha/ontologies/2016/6/
untitled-ontology-11#";

 OntClass team = model.getOntClass(ns + "Team");
OntProperty goals=model.getOntProperty(ns+ "Goals");

//Goals  are entered by admin, so I want to sum the newly entered
 //goals with previous stored in ontology.
//This is why I need integer values from these properties.

SELECT  *" +
" WHERE {  ?x rdf:type  ont:Team . ?x ont:Goals  ?goal  )
 ";


Query query = QueryFactory.create(queryString) ;
 QueryExecution qexec = QueryExecutionFactory.create(query,
model);
 ResultSet results = qexec.execSelect() ;
 while(results.hasNext()){
  QuerySolution soln = results.nextSolution() ;
 int goalsss = soln.getLiteral("goal").getInt() ;
int totalgoals=goalsss+totalgoals;
Literal p = model.createTypedLiteral(totalgoals);
 team.setPropertyValue(goals, p);// here goals is property name


Re: filter error in query

2016-09-29 Thread neha gupta
Thank you Lorenz, yes I am really enjoying learning Jena and also enjoying
this supportive group.
However, still I did not receive any guidance from my earlier question.

*how can we add/sum  data property values (newly entered) with previous
ones?*


On Thu, Sep 29, 2016 at 4:10 AM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> Ok, happy to hear that it works now. Although it would be interesting to
> know what "random changes" you did. Nevertheless, have fun in using Jena.
>
>
> On 29.09.2016 12:34, neha gupta wrote:
> > I am sorry Lorenz for late reply. It gives me the now the integer
> number. I
> > do not know even now how, but I made some random changes to the code and
> it
> > shows me the result now.
> >
> > Kind regards
> >
> > On Thu, Sep 29, 2016 at 12:33 AM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> Obviously not, otherwise you wouldn't get a parse exception?! You can't
> >> have a filter outside of the query. See SPARQL specs and/or tutorials.
> >>
> >> And that's what we already told you in the other thread.
> >>
> >> You know, it's really strange that you do not answer our questions. So
> >> again, how can you get the exception with the literals given that your
> >> query does not compile and thus you can't get to the point where
> >> literals would have been parsed to Java objects?
> >>
> >>> SELECT  *" +
> >>> " WHERE {  ?x rdf:type  ont:Team . ?x ont:team_goal
> >> ?goal
> >>> . ?x ont:team_wins ?wins}  filter(?goal>10 && ?wins >>>
> >>> Is this syntax correct because it gives me error:* Encountered "
> "filter"
> >>> "filter "" at line 1, column 265.*
> >>>
> >> --
> >> Lorenz Bühmann
> >> AKSW group, University of Leipzig
> >> Group: http://aksw.org - semantic web research center
> >>
> >>
>
>


Re: filter error in query

2016-09-29 Thread neha gupta
I am sorry Lorenz for late reply. It gives me the now the integer number. I
do not know even now how, but I made some random changes to the code and it
shows me the result now.

Kind regards

On Thu, Sep 29, 2016 at 12:33 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Obviously not, otherwise you wouldn't get a parse exception?! You can't
> have a filter outside of the query. See SPARQL specs and/or tutorials.
>
> And that's what we already told you in the other thread.
>
> You know, it's really strange that you do not answer our questions. So
> again, how can you get the exception with the literals given that your
> query does not compile and thus you can't get to the point where
> literals would have been parsed to Java objects?
>
> > SELECT  *" +
> > " WHERE {  ?x rdf:type  ont:Team . ?x ont:team_goal
> ?goal
> > . ?x ont:team_wins ?wins}  filter(?goal>10 && ?wins >
> > Is this syntax correct because it gives me error:* Encountered " "filter"
> > "filter "" at line 1, column 265.*
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Typed value Exception

2016-09-28 Thread neha gupta
This does not show any result: (No error but empty output console)

int l = soln.getLiteral("score").getInt() ;

However, same query runs when I write:
 ResultSetFormatter.out(System.out, results, query);

On Wed, Sep 28, 2016 at 7:24 AM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> This is weird. If the query is wrong like you showed here, how can you
> get a parse exception?! And as Chris said,
>
> PRINT THE VALUE OF soln.getLiteral("goals") by Java and show us the output.
>
>
> On 28.09.2016 13:58, neha gupta wrote:
> > Here is the code, I have typed it so might have some mistakes.
> >
> >
> > OntModel model=ModelFactory.createOntologyModel();
> > InputStream in =FileManager.get().open("D://ont/soccer.owl");
> > if (in==null) {
> > throw new IllegalArgumentException( "File: " +  " not
> > there");
> > }   model.read(in,"");
> >  String
> > ns="http://www.semanticweb.org/neha/ontologies/2016/6/
> untitled-ontology-11#";
> >
> >   OntClass team = model.getOntClass(ns + "Team");
> > OntProperty goals=model.getOntProperty(ns+ "Goals");
> > OntProperty wins=model.getOntProperty(ns+ "Wins");
> >
> > //Goals and Wins are entered by admin, so I want to sum the newly
> > entered //goals with previous stored in ontology.
> > //This is why I need integer values from these properties.
> >
> > SELECT  *" +
> > " WHERE {  ?x rdf:type  ont:Team . ?x ont:Goals  ?goal
> > . ?x ont:Wins ?wins}  filter(?goal>10 && ?wins > //the query also gives error , not recognizing Filter.
> >
> > Query query = QueryFactory.create(queryString) ;
> >  QueryExecution qexec =
> > QueryExecutionFactory.create(query, model);
> >  ResultSet results = qexec.execSelect() ;
> >  while(results.hasNext()){
> >   QuerySolution soln = results.nextSolution() ;
> >  int lit = soln.getLiteral("goal").getInt() ;
> > int lit2=soln.getLiteral("wins").getInt() ;
> > System.out.println("goals"+lit);
> >
> > Inline image 2
> >
> >
> >
> >
> > On Wed, Sep 28, 2016 at 4:28 AM, Chris Dollin
> > mailto:chris.dol...@epimorphics.com>>
> > wrote:
> >
> > On 28/09/16 12:15, neha gupta wrote:
> >
> > I just want to get the integer value from data property "Goals".
> >
> >
> > I know. You said that. But you have ignored my suggestion.
> >
> > //Goals is already a data property in my owl file and it has
> > integer value.
> >
> >
> > How do you know? Show us the data. Show us the code. Show us what
> > soln.getLiteral("goals") is. Maybe it isn't the integer you think it
> > is.
> >
> > OntProperty goals=model.getOntProperty(ns+ "Goals");
> >
> > How can I get this integer value for future arithmetic
> operations.
> >
> > On Wed, Sep 28, 2016 at 12:11 AM, Chris Dollin
> >  > <mailto:chris.dol...@epimorphics.com>
> >
> > wrote:
> >
> >
> > On 27/09/16 21:59, neha gupta wrote:
> >
> >int l = soln.getLiteral("goals").getInt() ;
> >
> > "goals"  contain integer value but it gives me exception:
> >
> > Error converting typed value to a number.
> >
> >
> > Print soln.getLiteral("goals") so that we can see the lexical
> > form and type of the literal. Note that spaces are not
> > permitted
> > in integer lexical forms -- make sure there's no extra spaces
> > in your print.
> >
> >
> > Chris
> >
> > --
> > "Always a BOM tomorrow."
> >Unsaid
> > /Babylon 5/
> >
> > Epimorphics Ltd, http://www.epimorphics.com
> > Registered address: Court Lodge, 105 High Street,
> > Portishead, Bristol BS20
> > 6PT
> > Epimorphics Ltd. is a limited company registered in
> > England (number
> > 7016688)
> >
> >
> >
> > --
> > "A facility for quotation covers the absence of original
> > thought."/Gaudy Night/
> >
> >
> > Epimorphics Ltd, http://www.epimorphics.com
> > Registered address: Court Lodge, 105 High Street, Portishead,
> > Bristol BS20 6PT
> > Epimorphics Ltd. is a limited company registered in England
> > (number 7016688)
> >
> >
>
>


Re: Typed value Exception

2016-09-28 Thread neha gupta
Here is the code, I have typed it so might have some mistakes.


OntModel model=ModelFactory.createOntologyModel();
InputStream in =FileManager.get().open("D://ont/soccer.owl");
if (in==null) {
throw new IllegalArgumentException( "File: " +  " not
there");
}   model.read(in,"");
 String ns="
http://www.semanticweb.org/neha/ontologies/2016/6/untitled-ontology-11#";;

  OntClass team = model.getOntClass(ns + "Team");
OntProperty goals=model.getOntProperty(ns+ "Goals");
OntProperty wins=model.getOntProperty(ns+ "Wins");

//Goals and Wins are entered by admin, so I want to sum the newly entered
//goals with previous stored in ontology.
//This is why I need integer values from these properties.

SELECT  *" +
" WHERE {  ?x rdf:type  ont:Team . ?x ont:Goals  ?goal . ?x
ont:Wins ?wins}  filter(?goal>10 && ?wins
wrote:

> On 28/09/16 12:15, neha gupta wrote:
>
>> I just want to get the integer value from data property "Goals".
>>
>
> I know. You said that. But you have ignored my suggestion.
>
> //Goals is already a data property in my owl file and it has integer value.
>>
>
> How do you know? Show us the data. Show us the code. Show us what
> soln.getLiteral("goals") is. Maybe it isn't the integer you think it
> is.
>
> OntProperty goals=model.getOntProperty(ns+ "Goals");
>>
>> How can I get this integer value for future arithmetic operations.
>>
>> On Wed, Sep 28, 2016 at 12:11 AM, Chris Dollin <
>> chris.dol...@epimorphics.com
>>
>>> wrote:
>>>
>>
>> On 27/09/16 21:59, neha gupta wrote:
>>>
>>>int l = soln.getLiteral("goals").getInt() ;
>>>>
>>>> "goals"  contain integer value but it gives me exception:
>>>>
>>>> Error converting typed value to a number.
>>>>
>>>>
>>> Print soln.getLiteral("goals") so that we can see the lexical
>>> form and type of the literal. Note that spaces are not permitted
>>> in integer lexical forms -- make sure there's no extra spaces
>>> in your print.
>>>
>>>
>>> Chris
>>>
>>> --
>>> "Always a BOM tomorrow." Unsaid
>>> /Babylon 5/
>>>
>>> Epimorphics Ltd, http://www.epimorphics.com
>>> Registered address: Court Lodge, 105 High Street, Portishead, Bristol
>>> BS20
>>> 6PT
>>> Epimorphics Ltd. is a limited company registered in England (number
>>> 7016688)
>>>
>>>
>>
> --
> "A facility for quotation covers the absence of original thought."/Gaudy
> Night/
>
>
> Epimorphics Ltd, http://www.epimorphics.com
> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20
> 6PT
> Epimorphics Ltd. is a limited company registered in England (number
> 7016688)
>


Re: Typed value Exception

2016-09-28 Thread neha gupta
I just want to get the integer value from data property "Goals".


//Goals is already a data property in my owl file and it has integer value.
OntProperty goals=model.getOntProperty(ns+ "Goals");

How can I get this integer value for future arithmetic operations.

On Wed, Sep 28, 2016 at 12:11 AM, Chris Dollin  wrote:

> On 27/09/16 21:59, neha gupta wrote:
>
>>   int l = soln.getLiteral("goals").getInt() ;
>>
>> "goals"  contain integer value but it gives me exception:
>>
>> Error converting typed value to a number.
>>
>
> Print soln.getLiteral("goals") so that we can see the lexical
> form and type of the literal. Note that spaces are not permitted
> in integer lexical forms -- make sure there's no extra spaces
> in your print.
>
>
> Chris
>
> --
> "Always a BOM tomorrow." Unsaid
> /Babylon 5/
>
> Epimorphics Ltd, http://www.epimorphics.com
> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20
> 6PT
> Epimorphics Ltd. is a limited company registered in England (number
> 7016688)
>


filter error in query

2016-09-28 Thread neha gupta
SELECT  *" +
" WHERE {  ?x rdf:type  ont:Team . ?x ont:team_goal  ?goal
. ?x ont:team_wins ?wins}  filter(?goal>10 && ?wins

Typed value Exception

2016-09-27 Thread neha gupta
 int l = soln.getLiteral("goals").getInt() ;

"goals"  contain integer value but it gives me exception:

Error converting typed value to a number.


adding data values

2016-09-25 Thread neha gupta
I want to store team goals after each match. Team(Manchester for ex) Goals
2. Goals is data property in Protege.. After another match , another entry
of goals is entered and stored. Each time it is saved as 2, 1, 3 but  I
need to add the new value with previous ones like 2+1+3=6.

So how can we add data propert values (newly entered) with previous ones?

Thank you.


Re: Ontclass vs OntResource

2016-09-22 Thread neha gupta
I am confuse about RDF Resource, with createResource() I do not know a
class is created, an individual or a property is created?

Man drives Car.
Man and Car are classes here, drives predicates, so in this case what will
be the Resource?

On Thu, Sep 22, 2016 at 1:02 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

> Resource: RDF resource
> OntClass: OWL class
>
> > What is the basic difference between model.createResource() and
> > model.createOntClass()?
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Ontclass vs OntResource

2016-09-22 Thread neha gupta
What is the basic difference between model.createResource() and
model.createOntClass()?


Re: Calculating numeric values of Data property in Ontology

2016-09-12 Thread neha gupta
Thanks Andy, how can I use the getInt here as I have not seen much details
about it on Jena page except

 getInt
<https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Statement.html#getInt-->
()
Return the object of the statement.



On Mon, Sep 12, 2016 at 1:10 AM, Andy Seaborne  wrote:

> 1/ SPARQL
>
> 2/ Literal.getInt
>
> Andy
>
>
> On 12/09/16 09:04, neha gupta wrote:
>
>> Yes I want the arithmetic calculation of these literals. If students have
>> these individual scores in three subjects, how can I calculate the total
>> of
>> these subjects score?
>>
>>
>>
>> On Mon, Sep 12, 2016 at 12:18 AM, George News 
>> wrote:
>>
>> I think what he/she wants it the addition (1+1=2). He wants to know if
>>> it is possible to automatically create a literal that is the addition of
>>> some values.
>>>
>>> I think you should do it manually, or otherwise you can create a SPARQL
>>> sentence that does the addition.
>>>
>>> Regards
>>>
>>> On 12/09/2016 8:01, Lorenz Buehmann wrote:
>>>
>>>> You already showed us code that add literals values (the scores) to
>>>> resources, so what's the question now?
>>>>
>>>>
>>>> On 11.09.2016 21:14, neha gupta wrote:
>>>>
>>>>> I have data properties in my ontology as: Java score=55, another data
>>>>> property C++ score=60, and lets suppose Semantic web score=80. Can we
>>>>>
>>>> add
>>>
>>>> these three scores in Jena and if yes how?
>>>>>
>>>>> But we have to do it for each instance of Student like student1,
>>>>>
>>>> student2
>>>
>>>> etc
>>>>>
>>>>>  Property prop1= model.getProperty(ns,"JavaScore");
>>>>>
>>>>>  Property prop2= model.getProperty(ns,"C++Score");
>>>>>  Property prop3= model.getProperty(ns,"Semantic webScore");
>>>>>
>>>>> student1.addLiteral(prop, javascore);
>>>>> student1.addLiteral(prop, c++score);
>>>>> student1.addLiteral(prop, semanticweb score");   etc
>>>>>
>>>>>
>>>>
>>>>
>>>
>>


Re: Calculating numeric values of Data property in Ontology

2016-09-12 Thread neha gupta
Yes I want the arithmetic calculation of these literals. If students have
these individual scores in three subjects, how can I calculate the total of
these subjects score?



On Mon, Sep 12, 2016 at 12:18 AM, George News  wrote:

> I think what he/she wants it the addition (1+1=2). He wants to know if
> it is possible to automatically create a literal that is the addition of
> some values.
>
> I think you should do it manually, or otherwise you can create a SPARQL
> sentence that does the addition.
>
> Regards
>
> On 12/09/2016 8:01, Lorenz Buehmann wrote:
> > You already showed us code that add literals values (the scores) to
> > resources, so what's the question now?
> >
> >
> > On 11.09.2016 21:14, neha gupta wrote:
> >> I have data properties in my ontology as: Java score=55, another data
> >> property C++ score=60, and lets suppose Semantic web score=80. Can we
> add
> >> these three scores in Jena and if yes how?
> >>
> >> But we have to do it for each instance of Student like student1,
> student2
> >> etc
> >>
> >>  Property prop1= model.getProperty(ns,"JavaScore");
> >>
> >>  Property prop2= model.getProperty(ns,"C++Score");
> >>  Property prop3= model.getProperty(ns,"Semantic webScore");
> >>
> >> student1.addLiteral(prop, javascore);
> >> student1.addLiteral(prop, c++score);
> >> student1.addLiteral(prop, semanticweb score");   etc
> >>
> >
> >
>


Calculating numeric values of Data property in Ontology

2016-09-11 Thread neha gupta
I have data properties in my ontology as: Java score=55, another data
property C++ score=60, and lets suppose Semantic web score=80. Can we add
these three scores in Jena and if yes how?

But we have to do it for each instance of Student like student1, student2
etc

 Property prop1= model.getProperty(ns,"JavaScore");

 Property prop2= model.getProperty(ns,"C++Score");
 Property prop3= model.getProperty(ns,"Semantic webScore");

student1.addLiteral(prop, javascore);
student1.addLiteral(prop, c++score);
student1.addLiteral(prop, semanticweb score");   etc


Re: Creating individuals if not already exists

2016-09-06 Thread neha gupta
So it means there is no method which check if an individual exists or not?

On Tue, Sep 6, 2016 at 4:55 AM, John A. Fereira  wrote:

> You could run a query to get a resource with specific criteria (e.g. it
> has an rdfs:label which has the users name).  If you get a result, replace
> the triple which has their GPS, otherwise create a new Student.
>
> -Original Message-----
> From: neha gupta [mailto:neha.bang...@gmail.com]
> Sent: Tuesday, September 6, 2016 3:13 AM
> To: users@jena.apache.org
> Subject: Creating individuals if not already exists
>
> I have created Students individuals in Jena and stored them in a file.
> Every time students login, updates their information like GPA and updates
> stored in the file.
> Student.createIndividual(ns, stdName);
>
> With this statement, suppose a student Neha is created with her
> information in the file. Next time, she login, again a new instance will be
> created when the application executes *Student.createIndividual(ns,
> stdName);?*
>
> *Is there any condition which states if the individual not already exists,
> create it otherwise skip createIndividual statement?*
>


Creating individuals if not already exists

2016-09-06 Thread neha gupta
I have created Students individuals in Jena and stored them in a file.
Every time students login, updates their information like GPA and updates
stored in the file.
Student.createIndividual(ns, stdName);

With this statement, suppose a student Neha is created with her information
in the file. Next time, she login, again a new instance will be created
when the application executes
*Student.createIndividual(ns, stdName);?*

*Is there any condition which states if the individual not already exists,
create it otherwise skip createIndividual statement?*


Re: Derefrencing URI

2016-08-20 Thread neha gupta
Hello Soroka thanks for your reply.

Actually I know these basics. I have read the owl file in Jena, run SPARQL,
execute it and display the question/answers(required output).

What I need is to download/show  the rdfs:comment or rdfs:abstract of the
ten resources(ten cities of Europe Berlin, London) from dbpedia in a
page/document .

Can I do it if I hard code them in the rdfs:comment in Protege with each
question and display it along the answer of the question?

On Fri, Aug 19, 2016 at 11:58 AM, A. Soroka  wrote:

> If you have not written any Jena code than you should begin with the
> tutorials provided exactly for that purpose:
>
> https://jena.apache.org/getting_started/index.html
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Aug 19, 2016, at 2:49 PM, neha gupta  wrote:
> >
> > Dear Soroka, I do not know how to use Gist etc but if this mailing list
> > support attachment , I can attach the owl file.. Jena code, I did not try
> > it because I am totally clueless how can I do it?
> >
> > In one statement, my question is can I get rdfs:comments of , say ten
> > resources, of dbpedia using Jena methods?
> > Thanks.
> >
> > On Fri, Aug 19, 2016 at 7:42 AM, A. Soroka  wrote:
> >
> >> No, please provide _actual data_. You are describing your data in words.
> >> That is not helpful. Make your OWL data available somewhere using a
> service
> >> like Gist or at the very least, include an excerpt. Also please include
> the
> >> code you have written so far.
> >>
> >> ---
> >> A. Soroka
> >> The University of Virginia Library
> >>
> >>> On Aug 19, 2016, at 10:34 AM, neha gupta 
> wrote:
> >>>
> >>> I am working on undergrad project. The detail is I have owl file where
> I
> >>> included ten questions about European cities like Born city belongs to
> >>> which country? The resources/answers are imported from dbpedia in
> Protege
> >>> Individual tab. I then used Jena API. The questions/answers work fine.
> >>>
> >>> The point where I have problem is I want a document/file etc where I
> >>> include the rdfs:comments or rdfs:abstract of these cities so that the
> >>> users knows about the resources.
> >>>
> >>> I mean when users finishes all the ten questions, at the end he/she
> gets
> >>> rdfs:comment details about these resources in a document or so.If this
> is
> >>> not possible, then please suggest me some soloutions which is near to
> it.
> >>>
> >>> I hope I conveyed my message?
> >>>
> >>> On Fri, Aug 19, 2016 at 7:12 AM, A. Soroka  wrote:
> >>>
> >>>> Please give us an actual example with data and your attempts at code.
> As
> >>>> for "dereferencing":
> >>>>
> >>>> https://www.w3.org/wiki/DereferenceURI
> >>>>
> >>>> ---
> >>>> A. Soroka
> >>>> The University of Virginia Library
> >>>>
> >>>>> On Aug 19, 2016, at 4:36 AM, neha gupta 
> >> wrote:
> >>>>>
> >>>>> I want the rdfs:comment of European capital cities in one file using
> >>>> Jena.
> >>>>> While studied a lot about it, I still have no idea how to do this. I
> >> can
> >>>> do
> >>>>> it of individual resource using Virtuoso but combining these into one
> >>>> file
> >>>>> using Jena is currently beyond my knowledge.
> >>>>> Also what is Dereference URI to RDF?
> >>>>>
> >>>>> Kindly if some one can help me here.
> >>>>
> >>>>
> >>
> >>
>
>


Re: Derefrencing URI

2016-08-19 Thread neha gupta
Dear Soroka, I do not know how to use Gist etc but if this mailing list
support attachment , I can attach the owl file.. Jena code, I did not try
it because I am totally clueless how can I do it?

In one statement, my question is can I get rdfs:comments of , say ten
resources, of dbpedia using Jena methods?
Thanks.

On Fri, Aug 19, 2016 at 7:42 AM, A. Soroka  wrote:

> No, please provide _actual data_. You are describing your data in words.
> That is not helpful. Make your OWL data available somewhere using a service
> like Gist or at the very least, include an excerpt. Also please include the
> code you have written so far.
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Aug 19, 2016, at 10:34 AM, neha gupta  wrote:
> >
> > I am working on undergrad project. The detail is I have owl file where I
> > included ten questions about European cities like Born city belongs to
> > which country? The resources/answers are imported from dbpedia in Protege
> > Individual tab. I then used Jena API. The questions/answers work fine.
> >
> > The point where I have problem is I want a document/file etc where I
> > include the rdfs:comments or rdfs:abstract of these cities so that the
> > users knows about the resources.
> >
> > I mean when users finishes all the ten questions, at the end he/she gets
> > rdfs:comment details about these resources in a document or so.If this is
> > not possible, then please suggest me some soloutions which is near to it.
> >
> > I hope I conveyed my message?
> >
> > On Fri, Aug 19, 2016 at 7:12 AM, A. Soroka  wrote:
> >
> >> Please give us an actual example with data and your attempts at code. As
> >> for "dereferencing":
> >>
> >> https://www.w3.org/wiki/DereferenceURI
> >>
> >> ---
> >> A. Soroka
> >> The University of Virginia Library
> >>
> >>> On Aug 19, 2016, at 4:36 AM, neha gupta 
> wrote:
> >>>
> >>> I want the rdfs:comment of European capital cities in one file using
> >> Jena.
> >>> While studied a lot about it, I still have no idea how to do this. I
> can
> >> do
> >>> it of individual resource using Virtuoso but combining these into one
> >> file
> >>> using Jena is currently beyond my knowledge.
> >>> Also what is Dereference URI to RDF?
> >>>
> >>> Kindly if some one can help me here.
> >>
> >>
>
>


Re: Derefrencing URI

2016-08-19 Thread neha gupta
I am working on undergrad project. The detail is I have owl file where I
included ten questions about European cities like Born city belongs to
which country? The resources/answers are imported from dbpedia in Protege
Individual tab. I then used Jena API. The questions/answers work fine.

The point where I have problem is I want a document/file etc where I
include the rdfs:comments or rdfs:abstract of these cities so that the
users knows about the resources.

I mean when users finishes all the ten questions, at the end he/she gets
rdfs:comment details about these resources in a document or so.If this is
not possible, then please suggest me some soloutions which is near to it.

I hope I conveyed my message?

On Fri, Aug 19, 2016 at 7:12 AM, A. Soroka  wrote:

> Please give us an actual example with data and your attempts at code. As
> for "dereferencing":
>
> https://www.w3.org/wiki/DereferenceURI
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Aug 19, 2016, at 4:36 AM, neha gupta  wrote:
> >
> > I want the rdfs:comment of European capital cities in one file using
> Jena.
> > While studied a lot about it, I still have no idea how to do this. I can
> do
> > it of individual resource using Virtuoso but combining these into one
> file
> > using Jena is currently beyond my knowledge.
> > Also what is Dereference URI to RDF?
> >
> > Kindly if some one can help me here.
>
>


Derefrencing URI

2016-08-19 Thread neha gupta
I want the rdfs:comment of European capital cities in one file using Jena.
While studied a lot about it, I still have no idea how to do this. I can do
it of individual resource using Virtuoso but combining these into one file
using Jena is currently beyond my knowledge.
Also what is Dereference URI to RDF?

Kindly if some one can help me here.


Re: query not working

2016-08-11 Thread neha gupta
URI? I have used the prefixes in my query.

User have to select taught or research in combo box and I need to filter my
query based on user selection.

When I dont use user selection and direct use like this:

select ?student where {?student my:hasClass my:taught}
it works but I need to use the string value here entered by user.

Thanks for understanding.

On Thu, Aug 11, 2016 at 7:30 AM, Jean-Marc Vanel 
wrote:

> "taught" and "research" are just strings , you need the real URI's between
> <> .
>
>
>
> 2016-08-11 16:19 GMT+02:00 neha gupta :
>
> > I have query
> >
> > select ?student where {?student my:hasClass ?class FILTER (?class
> > =''"+string+"}
> >
> > hasClass has two individuals: taught and research. I will take this from
> > user as:
> > String string=box1.getSelectedItem().toString(); (user will enter either
> > taught or research).
> >
>
>
>
> --
> Jean-Marc Vanel
> Déductions SARL - Consulting, services, training,
> Rule-based programming, Semantic Web
> http://deductions-software.com/
> +33 (0)6 89 16 29 52
> Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui
>


query not working

2016-08-11 Thread neha gupta
I have query

select ?student where {?student my:hasClass ?class FILTER (?class
=''"+string+"}

hasClass has two individuals: taught and research. I will take this from
user as:
String string=box1.getSelectedItem().toString(); (user will enter either
taught or research).


Re: Querysoloution return same individual

2016-08-03 Thread neha gupta
I think loop will not be then appropriate for me because I want all three
radio buttons to be populated at once. This all happens under button click
event so if button is pressed, three individuals should be assigned to
three radios.

On Wed, Aug 3, 2016 at 2:46 AM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

> If you loop over a set of individuals, why do you assign in each iteration
> three times the same value to all radio buttons? In one iteration you have
> only one individual, thus, you can assign this value only to one
> radiobutton.
>
>
>
> On 03.08.2016 11:17, neha gupta wrote:
>
>> Select *  + where {  ?Employee   rdf:type  emp:Employee }";This return
>> three individuals.
>>
>> I use then it to assign to three radiobuttons but it assign one (same)
>> individual to all three radiobuttons. Where is the mistake in code.
>>
>> while(result.hasNext()) {
>>
>>   QuerySolution sol = result.nextSolution();
>>
>>   RDFNode x=sol.getResource("?Employee");
>>   RDFNode x2=sol.getResource("?Employee");
>> RDFNode x3=sol.getResource("?Employee");
>>   rd1.setText(x.toString());
>>   rd2.setText(x2.toString());
>> rd3.setText(x3.toString());
>>
>>
>


Querysoloution return same individual

2016-08-03 Thread neha gupta
Select *  + where {  ?Employee   rdf:type  emp:Employee }";This return
three individuals.

I use then it to assign to three radiobuttons but it assign one (same)
individual to all three radiobuttons. Where is the mistake in code.

while(result.hasNext()) {

 QuerySolution sol = result.nextSolution();

 RDFNode x=sol.getResource("?Employee");
 RDFNode x2=sol.getResource("?Employee");
RDFNode x3=sol.getResource("?Employee");
 rd1.setText(x.toString());
 rd2.setText(x2.toString());
rd3.setText(x3.toString());


Adding multiple individuals

2016-07-21 Thread neha gupta
Thank you Admin for adding me.
I am Neha and in the final semester of my Bachelor degree. My project is in
Semantic web and Jena, unfortunately.
I have read a lot about Jena and knows how to create classes and
individuals. I know how to create single individual and assign it to a
variable like

Individual janeSmith = class.createIndividual(ns + "Jane");

If we have to create two or three individuals, we will assign it to
variables and will print or do something with it.

My question here is what if we have to create hundreds of individuals and
we do not know the limit of individuals.

There are some other questions but I will try to figure it out, if could
not, will ask here.

I will be very thank full for help.