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
>
> >
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
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 h
> "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
"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 S
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
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 w
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 fro
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;