Is it possible in your use case that there is more than one of these guys, or 
do you have reason to assume that if there is one, it is unique? If there is 
more than one, do you need to produce all examples? Is this the only use of the 
inference model (IOW could you do the inference in a different way) or do you 
need other inference facilities and therefore the InfModel is really required?

ajs6f

> On Dec 2, 2017, at 12:27 PM, Martynas Jusevičius <[email protected]> 
> wrote:
> 
> Hi,
> 
> what would be the most effective way to find a Resource that
> - belongs to a raw Model
> - in an instance of class X in an InfModel (which is based on the Model
> above)
> ?
> 
> I came up with something which iterates instances and filters by membership
> (lambda syntax not tested):
> 
> infModel.listSubjectsWithProperty(RDF.type, class).
>    filterKeep(r -> infModel.getRawModel().containsResource(r))
> 
> If a lot of instances were inferred in the InfModel, I can see this being
> slow.
> 
> Is there a better way? Maybe inversing the iterations somehow?
> 
> 
> Martynas

Reply via email to