Re: Construct query

2016-10-01 Thread Paul Tyson
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

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

Re: Fetch value from data property

2016-10-01 Thread Lorenz B.
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

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

Re: Fetch value from data property

2016-10-01 Thread Lorenz B.
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

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. >

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