On Sat, 2016-10-01 at 03:10 -0700, 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
"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
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
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
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;
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.
>
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