Thanks for the suggestion, that led me to the problem.  In one place I used the wrong class parameter for a createIndividual, resulting in an individual being a member of itself .  I guess both Jena and Russell have concerns about that sort of thing.

On 12/20/2020 12:21 PM, Martynas Jusevičius wrote:
What are the properties of
http://adventiumlabs.com/ontology/fhowl/structuresintwoclasses#memBusEquiv_si8
?

On Sun, 20 Dec 2020 at 19.11, Steve Vestal <steve.ves...@adventiumlabs.com>
wrote:

I am getting an exception that a Resource cannot convert to an
Individual in a list of Individuals, even when I'm iterating over it as
a list of Resources.

Here is the code, where ontModel is an OntModel and resourceClass is an
OntClass.

          ExtendedIterator<? extends Resource> resourceIterator =
ontModel.listIndividuals(resourceClass);
          boolean exception = resourceIterator.hasNext();  // Exception
occurs at this line

I am getting the following exception using Jena 3.17.  Any suggestions?

org.apache.jena.ontology.ConversionException: Cannot convert node

http://adventiumlabs.com/ontology/fhowl/structuresintwoclasses#memBusEquiv_si8
to Individual
      at
org.apache.jena.ontology.impl.IndividualImpl$1.wrap(IndividualImpl.java:61)
      at
org.apache.jena.enhanced.Personality.newInstance(Personality.java:94)
      at org.apache.jena.enhanced.EnhGraph.getNodeAs(EnhGraph.java:121)
      at

org.apache.jena.ontology.impl.OntModelImpl.lambda$findByTypeAs$4(OntModelImpl.java:2954)
      at
org.apache.jena.util.iterator.Map1Iterator.next(Map1Iterator.java:46)
      at
org.apache.jena.util.iterator.WrappedIterator.next(WrappedIterator.java:94)
      at

org.apache.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:56)
      at

com.adventiumlabs.fhowl.wiki.explore.ViewContent.findResources(ViewContent.java:258)
      (trace after line above where exception occurred omitted)






Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to