> 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